Skip to content

Commit f8dc759

Browse files
Rename method 'getEMLMetadataDocFromHashStore' to 'getObjectFromHashStore'
1 parent e6550c6 commit f8dc759

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package edu.ucsb.nceas.mdqengine.scheduler;
22

3-
import com.hp.hpl.jena.tdb.store.Hash;
43
import edu.ucsb.nceas.mdqengine.MDQconfig;
54
import edu.ucsb.nceas.mdqengine.DataONE;
65
import edu.ucsb.nceas.mdqengine.exception.MetadigStoreException;
@@ -657,7 +656,7 @@ public void submitReportRequest(MultipartCNode cnNode, MultipartMNode mnNode, Bo
657656
// Retrieve the EML metadata document for the given pid
658657
if (hashStore != null) {
659658
try {
660-
objectIS = getEMLMetadataDocFromHashStore(pid, hashStore);
659+
objectIS = getObjectFromHashStore(pid, hashStore);
661660
} catch (Exception e) {
662661
// Attempt to retrieve object stream from the API as a backup
663662
objectIS = getEMLMetadataDocFromMnOrCn(pid, cnNode, mnNode, isCN, session, objectIS);
@@ -696,13 +695,13 @@ public void submitReportRequest(MultipartCNode cnNode, MultipartMNode mnNode, Bo
696695
}
697696

698697
/**
699-
* Returns an input stream to an eml metadata document for a given pid through a hashstore
698+
* Returns an input stream to a data object for a given pid through a hashstore
700699
*
701700
* @param pid Persistent identifier
702701
* @param hashStore HashStore to check
703702
* @return Input stream to eml metadata doc
704703
*/
705-
public InputStream getEMLMetadataDocFromHashStore(
704+
public InputStream getObjectFromHashStore(
706705
Identifier pid, HashStore hashStore) {
707706
InputStream objectIS = null;
708707
try {

src/test/java/edu/ucsb/nceas/mdqengine/scheduler/RequestReportJobTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,22 @@ public void testGetSystemMetadataFromHashStore_nullHashStore() throws Exception
209209
* Confirm that an input stream to a data object is returned. No exception should be thrown.
210210
*/
211211
@Test
212-
public void testGetEMLMetadataDocFromHashStore() {
212+
public void testGetObjectFromHashStore() {
213213
RequestReportJob job = new RequestReportJob();
214214
Identifier pid = new Identifier();
215215
pid.setValue(testPid);
216216

217217
InputStream objectIS =
218-
job.getEMLMetadataDocFromHashStore(pid, hashStore);
218+
job.getObjectFromHashStore(pid, hashStore);
219219
assertInstanceOf(InputStream.class, objectIS, "This should be an InputStream");
220220
}
221221

222222
/**
223-
* Confirm that when a NotAuthorized is thrown after calling the MN API to retrieve an eml
224-
* metadata document, this test method does not bubble up the exception and simply returns
223+
* Confirm that when a NotAuthorized is thrown after calling the MN API to retrieve a data
224+
* object, this test method does not bubble up the exception and simply returns
225225
*/
226226
@Test
227-
public void testGetEMLMetadataDocFromHashStore_NotAuthorized() throws Exception {
227+
public void testGetObjectFromHashStore_NotAuthorized() throws Exception {
228228
RequestReportJob job = new RequestReportJob();
229229
MultipartMNode mnNode = mock(MultipartMNode.class);
230230
Session session = mock(Session.class);
@@ -234,7 +234,7 @@ public void testGetEMLMetadataDocFromHashStore_NotAuthorized() throws Exception
234234
when(mnNode.get(session, pid)).thenThrow(
235235
new NotAuthorized("8000", "User is not authorized"));
236236

237-
job.getEMLMetadataDocFromHashStore(pid, hashStore);
237+
job.getObjectFromHashStore(pid, hashStore);
238238
}
239239

240240
/**

0 commit comments

Comments
 (0)