Skip to content

Commit

Permalink
issue #3437 tidied javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
  • Loading branch information
punktilious committed May 30, 2022
1 parent ca0bfa0 commit 246897f
Show file tree
Hide file tree
Showing 10 changed files with 271 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
public interface ParameterValueVisitorAdapter {

/**
* Process a string parameter
*
* @param name
* @param valueString
* @param compositeId
Expand All @@ -24,6 +26,8 @@ public interface ParameterValueVisitorAdapter {
void stringValue(String name, String valueString, Integer compositeId, boolean wholeSystem);

/**
* Process a number parameter
*
* @param name
* @param valueNumber
* @param valueNumberLow
Expand All @@ -33,6 +37,8 @@ public interface ParameterValueVisitorAdapter {
void numberValue(String name, BigDecimal valueNumber, BigDecimal valueNumberLow, BigDecimal valueNumberHigh, Integer compositeId);

/**
* Process a date parameter
*
* @param name
* @param valueDateStart
* @param valueDateEnd
Expand All @@ -42,6 +48,8 @@ public interface ParameterValueVisitorAdapter {
void dateValue(String name, Instant valueDateStart, Instant valueDateEnd, Integer compositeId, boolean wholeSystem);

/**
* Process a token parameter
*
* @param name
* @param valueSystem
* @param valueCode
Expand All @@ -50,6 +58,8 @@ public interface ParameterValueVisitorAdapter {
void tokenValue(String name, String valueSystem, String valueCode, Integer compositeId);

/**
* Process a tag parameter
*
* @param name
* @param valueSystem
* @param valueCode
Expand All @@ -59,6 +69,8 @@ public interface ParameterValueVisitorAdapter {
void tagValue(String name, String valueSystem, String valueCode, boolean wholeSystem);

/**
* Process a profile parameter
*
* @param name
* @param url
* @param version
Expand All @@ -68,6 +80,8 @@ public interface ParameterValueVisitorAdapter {
void profileValue(String name, String url, String version, String fragment, boolean wholeSystem);

/**
* Process a security parameter
*
* @param name
* @param valueSystem
* @param valueCode
Expand All @@ -76,6 +90,8 @@ public interface ParameterValueVisitorAdapter {
void securityValue(String name, String valueSystem, String valueCode, boolean wholeSystem);

/**
* Process a quantity parameter
*
* @param name
* @param valueSystem
* @param valueCode
Expand All @@ -88,6 +104,8 @@ void quantityValue(String name, String valueSystem, String valueCode, BigDecimal
Integer compositeId);

/**
* Process a location parameter
*
* @param name
* @param valueLatitude
* @param valueLongitude
Expand All @@ -96,6 +114,8 @@ void quantityValue(String name, String valueSystem, String valueCode, BigDecimal
void locationValue(String name, Double valueLatitude, Double valueLongitude, Integer compositeId);

/**
* Process a reference parameter
*
* @param name
* @param refResourceType
* @param refLogicalId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,4 @@ public Integer getRefVersionId() {
public void setRefVersionId(Integer refVersionId) {
this.refVersionId = refVersionId;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
*/
public interface IMessageHandler {

/**
* Ask the handler to process the list of messages.
* @param messages
* @throws FHIRPersistenceException
*/
void process(List<String> messages) throws FHIRPersistenceException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ private void initIdentityCache() throws FHIRPersistenceException {
throw new FHIRPersistenceException("cache init failed", x);
}
}

/**
* Create a new consumer
* @return
Expand All @@ -282,6 +283,9 @@ private KafkaConsumer<String,String> buildConsumer() {
return consumer;
}

/**
* Set things up to talk to a PostgreSQL database
*/
private void configureForPostgres() {
this.translator = new PostgresTranslator();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public abstract class BaseMessageHandler implements IMessageHandler {
private SecureRandom random = new SecureRandom();

private final long maxReadyWaitMs;

/**
* Protected constructor
* @param maxReadyWaitMs the max time in ms to wait for the upstream transaction to make the data ready
Expand Down Expand Up @@ -283,6 +284,8 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException
}

/**
* Process the given LocationParameter p
*
* @param tenantId
* @param requestShard
* @param resourceType
Expand All @@ -293,6 +296,8 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException
protected abstract void process(String tenantId, String requestShard, String resourceType, String logicalId, long logicalResourceId, LocationParameter p) throws FHIRPersistenceException;

/**
* Process the given TokenParameter p
*
* @param tenantId
* @param requestShard
* @param resourceType
Expand All @@ -303,6 +308,7 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException
protected abstract void process(String tenantId, String requestShard, String resourceType, String logicalId, long logicalResourceId, TokenParameter p) throws FHIRPersistenceException;

/**
* Process the given TagParameter p
*
* @param tenantId
* @param requestShard
Expand All @@ -315,6 +321,7 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException
protected abstract void process(String tenantId, String requestShard, String resourceType, String logicalId, long logicalResourceId, TagParameter p) throws FHIRPersistenceException;

/**
* Process the given ProfileParameter p
*
* @param tenantId
* @param requestShard
Expand All @@ -327,6 +334,7 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException
protected abstract void process(String tenantId, String requestShard, String resourceType, String logicalId, long logicalResourceId, ProfileParameter p) throws FHIRPersistenceException;

/**
* Proces the given SecurityParameter p
*
* @param tenantId
* @param requestShard
Expand All @@ -339,6 +347,8 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException
protected abstract void process(String tenantId, String requestShard, String resourceType, String logicalId, long logicalResourceId, SecurityParameter p) throws FHIRPersistenceException;

/**
* Process the given QuantityParameter p
*
* @param tenantId
* @param requestShard
* @param resourceType
Expand All @@ -349,6 +359,8 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException
protected abstract void process(String tenantId, String requestShard, String resourceType, String logicalId, long logicalResourceId, QuantityParameter p) throws FHIRPersistenceException;

/**
* Process the given NumberParameter p
*
* @param tenantId
* @param requestShard
* @param resourceType
Expand All @@ -359,6 +371,8 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException
protected abstract void process(String tenantId, String requestShard, String resourceType, String logicalId, long logicalResourceId, NumberParameter p) throws FHIRPersistenceException;

/**
* Process the given DateParameter p
*
* @param tenantId
* @param requestShard
* @param resourceType
Expand All @@ -369,6 +383,7 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException
protected abstract void process(String tenantId, String requestShard, String resourceType, String logicalId, long logicalResourceId, DateParameter p) throws FHIRPersistenceException;

/**
* Process the given ReferenceParameter p
*
* @param tenantId
* @param requestShard
Expand All @@ -392,7 +407,8 @@ private void process(RemoteIndexMessage message) throws FHIRPersistenceException

/**
* Tell the persistence layer to commit the current transaction, or perform a rollback
* if setRollbackOnly() has been called
* if setRollbackOnly() has been called.
*
* @throws FHIRPersistenceException
*/
protected abstract void endTransaction() throws FHIRPersistenceException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ public CacheLoader(IdentityCacheImpl cache) {
this.cache = cache;
}

/**
* Read records from the database using the given connection and apply the
* values to the configured cache object.
* @param connection
* @throws FHIRPersistenceException
*/
public void apply(Connection connection) throws FHIRPersistenceException {
// load the static list of resource types
List<ResourceTypeValue> resourceTypes = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public class LogicalResourceValue {
private final int versionId;
private final Timestamp lastUpdated;
private final String parameterHash;

/**
* Builder for fluent creation of LogicalResourceValue objects
*/
public static class Builder {
private short shardKey;
private long logicalResourceId;
Expand All @@ -28,30 +32,71 @@ public static class Builder {
private Timestamp lastUpdated;
private String parameterHash;

/**
* Set the shardKey
* @param shardKey
* @return
*/
public Builder withShardKey(short shardKey) {
this.shardKey = shardKey;
return this;
}

/**
* Set the logicalResourceId value
* @param logicalResourceId
* @return
*/
public Builder withLogicalResourceId(long logicalResourceId) {
this.logicalResourceId = logicalResourceId;
return this;
}

/**
* Set the resourceType value
* @param resourceType
* @return
*/
public Builder withResourceType(String resourceType) {
this.resourceType = resourceType;
return this;
}

/**
* Set the logicalId value
* @param logicalId
* @return
*/
public Builder withLogicalId(String logicalId) {
this.logicalId = logicalId;
return this;
}

/**
* Set the versionId value
* @param versionId
* @return
*/
public Builder withVersionId(int versionId) {
this.versionId = versionId;
return this;
}

/**
* Set the lastUpdated value
* @param lastUpdated
* @return
*/
public Builder withLastUpdated(Timestamp lastUpdated) {
this.lastUpdated = lastUpdated;
return this;
}

/**
* Set the parameterHash value
* @param parameterHash
* @return
*/
public Builder withParameterHash(String parameterHash) {
this.parameterHash = parameterHash;
return this;
Expand All @@ -67,15 +112,16 @@ public LogicalResourceValue build() {
}

/**
* Factor function to create a fresh instance of a {@link Builder}
* Factory function to create a fresh instance of a {@link Builder}
* @return
*/
public static Builder builder() {
return new Builder();
}

/**
* Public constructor
* Canonical constructor
*
* @param shardKey
* @param logicalResourceId
* @param resourceType
Expand Down
Loading

0 comments on commit 246897f

Please sign in to comment.