Skip to content

Commit

Permalink
FACT-1468 added docstrings to bulk-scan-processor (#3257)
Browse files Browse the repository at this point in the history
* added docstrings for controllers and config

* added endpoints and entity docstrings

* added docstrings for exceptionhandlers, exceptions, info and launchdarkly

* added docstrings for model

* added docstrings for services

* rest of docstrings

* checkstylemain fixes

* added missing bits
  • Loading branch information
justiceia authored Mar 25, 2024
1 parent 308f898 commit e377899
Show file tree
Hide file tree
Showing 245 changed files with 4,494 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,64 @@

import java.util.List;

/**
* Configuration properties for access token.
*/
@ConfigurationProperties("accesstoken")
public class AccessTokenProperties {
private List<TokenConfig> serviceConfig;

/**
* Get configuration properties for access token.
* @return List of TokenConfig
*/
public List<TokenConfig> getServiceConfig() {
return serviceConfig;
}

/**
* Set configuration properties for access token.
* @param serviceConfig List of TokenConfig
*/
public void setServiceConfig(List<TokenConfig> serviceConfig) {
this.serviceConfig = serviceConfig;
}

/**
* Configuration properties for access token.
*/
public static class TokenConfig {
private String serviceName;
private int validity;

/**
* Get service name.
* @return Service name
*/
public String getServiceName() {
return serviceName;
}

/**
* Set service name.
* @param serviceName Service name
*/
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}

/**
* Get validity.
* @return Validity
*/
public int getValidity() {
return validity;
}

/**
* Set validity.
* @param validity Validity
*/
public void setValidity(int validity) {
this.validity = validity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@

import java.util.List;

/**
* Configuration for auth service.
*/
@Configuration
@Lazy
@EnableFeignClients(clients = IdamApi.class)
public class AuthServiceConfig {

/**
* Bean for AuthTokenGenerator.
* @param secret The secret
* @param name The name
* @param serviceAuthorisationApi The ServiceAuthorisationApi
* @return The AuthTokenGenerator
*/
@Bean
@ConditionalOnProperty(name = "idam.s2s-auth.url")
public AuthTokenGenerator authTokenGenerator(
Expand All @@ -31,6 +41,10 @@ public AuthTokenGenerator authTokenGenerator(
return AuthTokenGeneratorFactory.createDefaultGenerator(secret, name, serviceAuthorisationApi);
}

/**
* Bean for AuthTokenGenerator.
* @return The AuthTokenGenerator
*/
@Bean
@ConditionalOnProperty(name = "idam.s2s-auth.url", havingValue = "false")
public AuthTokenGenerator authTokenGeneratorStub() {
Expand All @@ -39,12 +53,21 @@ public AuthTokenGenerator authTokenGeneratorStub() {
};
}

/**
* Bean for AuthTokenValidator.
* @param s2sApi The ServiceAuthorisationApi
* @return The AuthTokenValidator
*/
@Bean
@ConditionalOnProperty(name = "idam.s2s-auth.url")
public AuthTokenValidator tokenValidator(ServiceAuthorisationApi s2sApi) {
return new ServiceAuthTokenValidator(s2sApi);
}

/**
* Bean for AuthTokenValidator.
* @return The AuthTokenValidator
*/
@Bean
@ConditionalOnProperty(name = "idam.s2s-auth.url", havingValue = "false")
public AuthTokenValidator tokenValidatorStub() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
* Configuration properties for blob management.
*/
@ConfigurationProperties("storage")
public class BlobManagementProperties {

Expand All @@ -15,42 +18,82 @@ public class BlobManagementProperties {

private Integer blobLeaseAcquireDelayInSeconds;

/**
* Get blob copy timeout in milliseconds.
* @return Blob copy timeout in milliseconds
*/
public Integer getBlobCopyTimeoutInMillis() {
return blobCopyTimeoutInMillis;
}

/**
* Set blob copy timeout in milliseconds.
* @param blobCopyTimeoutInMillis Blob copy timeout in milliseconds
*/
public void setBlobCopyTimeoutInMillis(int blobCopyTimeoutInMillis) {
this.blobCopyTimeoutInMillis = blobCopyTimeoutInMillis;
}

/**
* Get blob lease timeout.
* @return Blob lease timeout
*/
public Integer getBlobLeaseTimeout() {
return blobLeaseTimeout;
}

/**
* Set blob lease timeout.
* @param blobLeaseTimeout Blob lease timeout
*/
public void setBlobLeaseTimeout(Integer blobLeaseTimeout) {
this.blobLeaseTimeout = blobLeaseTimeout;
}

/**
* Get blob copy polling delay in milliseconds.
* @return Blob copy polling delay in milliseconds
*/
public Integer getBlobCopyPollingDelayInMillis() {
return blobCopyPollingDelayInMillis;
}

/**
* Set blob copy polling delay in milliseconds.
* @param blobCopyPollingDelayInMillis Blob copy polling delay in milliseconds
*/
public void setBlobCopyPollingDelayInMillis(int blobCopyPollingDelayInMillis) {
this.blobCopyPollingDelayInMillis = blobCopyPollingDelayInMillis;
}

/**
* Get blob selected container.
* @return Blob selected container
*/
public String getBlobSelectedContainer() {
return blobSelectedContainer;
}

/**
* Set blob selected container.
* @param blobSelectedContainer Blob selected container
*/
public void setBlobSelectedContainer(String blobSelectedContainer) {
this.blobSelectedContainer = blobSelectedContainer;
}

/**
* Get blob lease acquire delay in seconds.
* @return Blob lease acquire delay in seconds
*/
public Integer getBlobLeaseAcquireDelayInSeconds() {
return blobLeaseAcquireDelayInSeconds;
}

/**
* Set blob lease acquire delay in seconds.
* @param blobLeaseAcquireDelayInSeconds Blob lease acquire delay in seconds
*/
public void setBlobLeaseAcquireDelayInSeconds(Integer blobLeaseAcquireDelayInSeconds) {
this.blobLeaseAcquireDelayInSeconds = blobLeaseAcquireDelayInSeconds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@

import static uk.gov.hmcts.reform.bulkscanprocessor.util.TimeZones.EUROPE_LONDON_ZONE_ID;

/**
* Configuration for clock.
*/
@Configuration
public class ClockConfig {

/**
* Bean for ClockProvider.
* @return The ClockProvider
*/
@Bean
public ClockProvider clockProvider() {
return () -> Clock.system(EUROPE_LONDON_ZONE_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,32 @@

import java.util.List;

/**
* Configuration for container mappings.
*/
@ConfigurationProperties(prefix = "containers")
public class ContainerMappings {
private List<Mapping> mappings;

// region getters and setters
/**
* Get list of mappings.
* @return The mappings
*/
public List<Mapping> getMappings() {
return mappings;
}

/**
* Set list of mappings.
* @param mappings The mappings
*/
public void setMappings(List<Mapping> mappings) {
this.mappings = mappings;
}
// endregion

/**
* Mapping model.
*/
public static class Mapping {

private String container;
Expand All @@ -27,7 +39,15 @@ public static class Mapping {
private boolean paymentsEnabled;
private boolean enabled = true;

// region constructor, getters and setters
/**
* Constructor.
* @param container The container
* @param jurisdiction The jurisdiction
* @param poBoxes The poBoxes
* @param ocrValidationUrl The ocrValidationUrl
* @param paymentsEnabled The paymentsEnabled
* @param enabled The enabled
*/
public Mapping(
String container,
String jurisdiction,
Expand All @@ -44,58 +64,107 @@ public Mapping(
this.enabled = enabled;
}

/**
* Constructor.
*/
public Mapping() {
// Spring needs it.
}

/**
* Get container.
* @return The container
*/
public String getContainer() {
return container;
}

/**
* Set container.
* @param container The container
*/
public void setContainer(String container) {
this.container = container;
}

/**
* Get jurisdiction.
* @return The jurisdiction
*/
public String getJurisdiction() {
return jurisdiction;
}

/**
* Set jurisdiction.
* @param jurisdiction The jurisdiction
*/
public void setJurisdiction(String jurisdiction) {
this.jurisdiction = jurisdiction;
}

/**
* Get poBoxes.
* @return The poBoxes
*/
public List<String> getPoBoxes() {
return poBoxes;
}

/**
* Set poBoxes.
* @param poBoxes The poBoxes
*/
public void setPoBoxes(List<String> poBoxes) {
this.poBoxes = poBoxes;
}

/**
* Get ocrValidationUrl.
* @return The ocrValidationUrl
*/
public String getOcrValidationUrl() {
return ocrValidationUrl;
}

/**
* Set ocrValidationUrl.
* @param ocrValidationUrl The ocrValidationUrl
*/
public void setOcrValidationUrl(String ocrValidationUrl) {
this.ocrValidationUrl = ocrValidationUrl;
}

/**
* Get paymentsEnabled.
* @return The paymentsEnabled
*/
public boolean isPaymentsEnabled() {
return paymentsEnabled;
}

/**
* Set paymentsEnabled.
* @param paymentsEnabled The paymentsEnabled
*/
public void setPaymentsEnabled(boolean paymentsEnabled) {
this.paymentsEnabled = paymentsEnabled;
}

/**
* Get enabled.
* @return The enabled
*/
public boolean isEnabled() {
return enabled;
}

/**
* Set enabled.
* @param enabled The enabled
*/
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

// endregion
}
}
Loading

0 comments on commit e377899

Please sign in to comment.