Open peterhambly opened 5 years ago
Comments on the changes required.
The properties file above is: RIFServiceStartupProperties.properties
. A similar property called statisticsServiceServer
would need to be added.
The code to supports the taxonomyServicesServer
property is in:
C:\Users\peter_2\Documents\GitHub\rapidInquiryFacility>findstr /s /c:"taxonomyServicesServer" *.java
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: * @param taxonomyServicesServer [from RIF ServiceStartupProperties.java parameter] (required; may be NULL)
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: final String taxonomyServicesServer)
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: if (taxonomyServicesServer != null && !taxonomyServicesServer.equals("")) {
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: rifLogger.info(this.getClass(), "Using taxonomyServicesServer parameter for base URL: " +
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: taxonomyServicesServer);
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: this.url =taxonomyServicesServer;
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: * @param taxonomyServicesServer (required)
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: final String taxonomyServicesServer,
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: if (taxonomyServicesServer != null &
& !taxonomyServicesServer.equals("")) {
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\GetStudyJSON.java: this.url =taxonomyServicesServer;
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\RifZipFile.java: * @param String taxonomyServicesServer [parameter] (required)
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\RifZipFile.java: final String taxonomyServicesServer)
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\RifZipFile.java: connection, user, studyID, locale, url, taxonomyServicesServer,
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\RifZipFile.java: final String taxonomyServicesServer,
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\RifZipFile.java: getStudyJSON, locale, 1 /* headerLevel */, url, taxonomyServicesServer);
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\RifZipFile.java: final String taxonomyServicesServer)
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\RifZipFile.java:
JSONObject taxonomyObject = getStudyJSON.getHealthCodeDescription(url, taxonomyServicesServer, value);
rifServices\src\main\java\org\sahsu\rif\services\datastorage\common\RifZipFile.java:
JSONObject taxonomyObject = getStudyJSON.getHealthCodeDescription(url, taxonomyServicesServer, value);
rifServices\src\main\java\org\sahsu\rif\services\system\RIFServiceStartupOptions.java: private String taxonomyServicesServer;
rifServices\src\main\java\org\sahsu\rif\services\system\RIFServiceStartupOptions.java: taxonomyServicesServer = properties.getTaxonomyServicesServer();
rifServices\src\main\java\org\sahsu\rif\services\system\RIFServiceStartupOptions.java: return taxonomyServicesServer;
rifServices\src\main\java\org\sahsu\rif\services\system\RIFServiceStartupProperties.java: return getOptionalRIfServiceProperty("taxonomyServicesServer");
Similar code would need to be added where the RIF calls the statistics service in StatisticsProcessing.java
`to support the ``statisticsServiceServer``` property
String statsServiceUrl = url + "/statistics/service/script";
rifLogger.info(getClass(), "About to call statistics service on " + statsServiceUrl);
and:
// Make sure Jersey converts our native bean-style object to JSON.
ClientConfig clientConfig = new DefaultClientConfig();
clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, true);
Client client = Client.create(clientConfig);
WebResource resource = client.resource(statsServiceUrl);
ClientResponse response = resource.accept(MediaType.APPLICATION_JSON)
.type(MediaType.APPLICATION_JSON)
.post(ClientResponse.class, parameters);
rifLogger.info(getClass(), "Statistics service called: " + response.toString());
and also RunStudyThread.java
where the base URL is set
try {
statisticsProcessing.performStep(connection, studySubmission, studyID, url);
String statusMessage
= RIFServiceMessages.getMessage(
"studyState.studyResultsComputed.description");
updateStudyStatusState(statusMessage);
}
Statistics Service does not support TLS connections from the rifServices middleware. Code from the Taxonomy services needs to be integrated to allow for specification of the network location of the statistics service server: