Skip to content

Commit b38aa3d

Browse files
Clean up code related to changes to 'submitReportRequest'
1 parent 4b25fe4 commit b38aa3d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/main/java/edu/ucsb/nceas/mdqengine/scheduler/RequestReportJob.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -629,33 +629,32 @@ public void submitReportRequest(MultipartCNode cnNode, MultipartMNode mnNode, Bo
629629
// TODO: Junit tests
630630
// Retrieve the system metadata
631631
sysmeta = getSystemMetadataFromHashStoreOrNode(pid, hashStore, cnNode, mnNode, isCN, session);
632-
633632
// Retrieve the EML metadata document for the given pid
634633
objectIS = getEMLMetadataDocInputStream(pid, hashStore, cnNode, mnNode, isCN, session);
635634

636-
// quality suite service url, i.e.
635+
// Quality suite service url, i.e.
637636
// "http://docke-ucsb-1.dataone.org:30433/quality/suites/knb.suite.1/run
638637
qualityServiceUrl = qualityServiceUrl + "/suites/" + suiteId + "/run";
639638
HttpPost post = new HttpPost(qualityServiceUrl);
640639

641-
// add document
640+
// Add document
642641
SimpleMultipartEntity entity = new SimpleMultipartEntity();
643642
entity.addFilePart("document", objectIS);
644643

645644
ByteArrayOutputStream baos = new ByteArrayOutputStream();
646645
TypeMarshaller.marshalTypeToOutputStream(sysmeta, baos);
647646
entity.addFilePart("systemMetadata", new ByteArrayInputStream(baos.toByteArray()));
648647

649-
// make sure we get XML back
648+
// Make sure we get XML back
650649
post.addHeader("Accept", "application/xml");
651650

652-
// send to service
651+
// Send to service
653652
log.trace("submitting: " + qualityServiceUrl);
654653
post.setEntity((HttpEntity) entity);
655654
CloseableHttpClient client = HttpClients.createDefault();
656655
CloseableHttpResponse response = client.execute(post);
657656

658-
// retrieve results
657+
// Retrieve results
659658
HttpEntity responseEntity = response.getEntity();
660659
if (responseEntity != null) {
661660
runResultIS = responseEntity.getContent();
@@ -672,7 +671,7 @@ public void submitReportRequest(MultipartCNode cnNode, MultipartMNode mnNode, Bo
672671
* keys to retrieve a hashstore
673672
*/
674673
private static HashStore getHashStoreFromMetadigProps() throws IOException {
675-
// Get hashstore with props from a config file to directly access sysmeta and eml metadata
674+
// Get hashstore with props from a config (metadig.properties) file
676675
Map<String, Object> storeConfig = getStorePropsFromMetadigProps();
677676
String storePath = (String) storeConfig.get("store_path");
678677
String storeDepth = (String) storeConfig.get("store_depth");
@@ -810,6 +809,7 @@ private SystemMetadata getSystemMetadataFromHashStoreOrNode(
810809
* store_width, store_algorithm and store_metadata_namespace
811810
*/
812811
private static Map<String, Object> getStorePropsFromMetadigProps() {
812+
// In the metadig.properties file, hashstore properties are keys that begin with 'store.'
813813
String prefix = "store.";
814814
Map<String, Object> storeConfig = new HashMap<>();
815815
try {
@@ -826,7 +826,8 @@ private static Map<String, Object> getStorePropsFromMetadigProps() {
826826
}
827827

828828
} catch (ConfigurationException ce) {
829-
throw new RuntimeException("Error reading metadig configuration, ConfigurationException: " + ce);
829+
throw new RuntimeException(
830+
"Error reading metadig configuration, ConfigurationException: " + ce);
830831
} catch (IOException io) {
831832
throw new RuntimeException("Error reading metadig configuration, IOException: " + io);
832833
}

0 commit comments

Comments
 (0)