Skip to content

Commit 070a5ed

Browse files
Clean-up code and javadocs in 'RequestReportJob' class
1 parent 422db04 commit 070a5ed

File tree

1 file changed

+26
-35
lines changed

1 file changed

+26
-35
lines changed

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

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -687,13 +687,11 @@ public void submitReportRequest(MultipartCNode cnNode, MultipartMNode mnNode, Bo
687687
}
688688

689689
/**
690-
* Returns an input stream to an eml metadata document for a given pid. First, we try to open
691-
* a stream to the eml metadata doc directly through the given hashstore (quickest). If we
692-
* are unable to, then we will try to retrieve a stream to the eml metadata doc through the
693-
* given MN or CN API.
690+
* Returns an input stream to an eml metadata document for a given pid through a hashstore
694691
*
695-
* @param pid Persistent identifier
692+
* @param pid Persistent identifier
696693
* @param hashStore HashStore to check
694+
* @return Input stream to eml metadata doc
697695
*/
698696
public InputStream getEMLMetadataDocFromHashStore(
699697
Identifier pid, HashStore hashStore) {
@@ -713,20 +711,20 @@ public InputStream getEMLMetadataDocFromHashStore(
713711
/**
714712
* Returns an input stream to an eml metadata document for a given pid from the MN or CN
715713
*
716-
* @param pid Persistent identifier
717-
* @param cnNode Coordinating Node
718-
* @param mnNode Member Node
719-
* @param isCN Boolean to check whether we should check the CN or MN
720-
* @param session User session to check for credentials to access the CN or MN
714+
* @param pid Persistent identifier
715+
* @param cnNode Coordinating Node
716+
* @param mnNode Member Node
717+
* @param isCN Boolean to check whether we should check the CN or MN
718+
* @param session User session to check for credentials to access the CN or MN
721719
* @param objectIS Inputstream to set
722-
* @return
723-
* @throws InvalidToken If the token used to access the MN or CN is invalid
724-
* @throws ServiceFailure Unexpected issue when accessing via the MN or CN
725-
* @throws NotFound When the sysmeta is not found when accessing via the MN or CN
726-
* @throws NotImplemented If the method to retrieve the eml metadata doc through the MN or CN is
727-
* not implemented
728-
* @throws InsufficientResources An unexpected issue with insufficient resources when
729-
* retrieving the eml metadata doc through the MN or CN
720+
* @return Input stream to eml metadata doc
721+
* @throws InvalidToken If the token used to access the MN or CN is invalid
722+
* @throws ServiceFailure Unexpected issue when accessing via the MN or CN
723+
* @throws NotFound When the sysmeta is not found when accessing via the MN or CN
724+
* @throws NotImplemented If the method to retrieve the eml metadata doc through the MN
725+
* or CN is not implemented
726+
* @throws InsufficientResources An unexpected issue with insufficient resources when retrieving
727+
* the eml metadata doc through the MN or CN
730728
*/
731729
public InputStream getEMLMetadataDocFromMnOrCn(
732730
Identifier pid, MultipartCNode cnNode, MultipartMNode mnNode, Boolean isCN, Session session,
@@ -754,18 +752,11 @@ public InputStream getEMLMetadataDocFromMnOrCn(
754752
/**
755753
* Returns a system metadata object for a given pid through a hashstore.
756754
*
757-
* @param pid Persistent identifier
755+
* @param pid Persistent identifier
758756
* @param hashStore HashStore to check
759757
* @return System metadata object
760-
* @throws InvalidToken If the token used to access the MN or CN is invalid
761-
* @throws ServiceFailure Unexpected issue when accessing via the MN or CN
762-
* @throws NotFound When the sysmeta is not found when accessing via the MN or CN
763-
* @throws NotImplemented If the method to retrieve the sysmeta through the MN or CN is not
764-
* implemented
765758
*/
766-
public SystemMetadata getSystemMetadataFromHashStore(
767-
Identifier pid, HashStore hashStore)
768-
throws InvalidToken, ServiceFailure, NotFound, NotImplemented {
759+
public SystemMetadata getSystemMetadataFromHashStore(Identifier pid, HashStore hashStore) {
769760
SystemMetadata sysmeta = null;
770761
try {
771762
// First, try the quickest path to retrieve sysmeta object via hashstore
@@ -785,16 +776,16 @@ public SystemMetadata getSystemMetadataFromHashStore(
785776
/**
786777
* Returns a system metadata object for a given pid from the MN or CN
787778
*
788-
* @param pid Persistent identifier
789-
* @param cnNode Coordinating Node
790-
* @param mnNode Member Node
791-
* @param isCN Boolean to check whether we should check the CN or MN
779+
* @param pid Persistent identifier
780+
* @param cnNode Coordinating Node
781+
* @param mnNode Member Node
782+
* @param isCN Boolean to check whether we should check the CN or MN
792783
* @param session User session to check for credentials to access the CN or MN
793784
* @param sysmeta Sysmeta object to set
794785
* @return System metadata object
795-
* @throws InvalidToken If the token used to access the MN or CN is invalid
786+
* @throws InvalidToken If the token used to access the MN or CN is invalid
796787
* @throws ServiceFailure Unexpected issue when accessing via the MN or CN
797-
* @throws NotFound When the sysmeta is not found when accessing via the MN or CN
788+
* @throws NotFound When the sysmeta is not found when accessing via the MN or CN
798789
* @throws NotImplemented If the method to retrieve the sysmeta through the MN or CN is not
799790
*/
800791
public SystemMetadata getSystemMetadataFromMnOrCn(
@@ -812,8 +803,8 @@ public SystemMetadata getSystemMetadataFromMnOrCn(
812803
+ ", unable to retrieve stream to system metadata");
813804
} catch (Exception e) {
814805
// Raise unexpected exception
815-
log.error("Unexpected exception while retrieving system metadata object: "
816-
+ e.getMessage());
806+
log.error(
807+
"Unexpected exception while retrieving system metadata object: " + e.getMessage());
817808
throw (e);
818809
}
819810
return sysmeta;

0 commit comments

Comments
 (0)