Class ApprovalServiceProviderImplementation
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.file.implementation.ApprovalServiceProviderImplementation
-
- All Implemented Interfaces:
ApprovalServiceProvider
public class ApprovalServiceProviderImplementation extends java.lang.Object implements ApprovalServiceProvider
Implementation ofApprovalServiceProviderfor the storage back end.
-
-
Constructor Summary
Constructors Constructor Description ApprovalServiceProviderImplementation()
-
Method Summary
Modifier and Type Method Description voidaccept(java.lang.String ticket, int reviewerID)Accept aPublicReferenceand publish to public.voidacceptTicketByUser(java.lang.String ticket, int reviewerHashCode)Accept an open ticket by the user who requested the data publication to get a final persistent IDvoidapprove(PublicReference reference, javax.mail.internet.InternetAddress emailNotificationAddress)Initialize a request to approve aPublicReference.voidcheckOpenReviews(java.util.Map<PublicReference,java.util.List<ReviewStatus>> results)java.util.Map<PublicReference,java.util.List<ReviewStatus>>getAllOpenReviews()Load all openPublicReferences that are not yet accepted or rejected.java.lang.StringgetNewURL(PublicReference reference)PublicReferencegetPublicReferenceByInternalId(java.lang.String internalId)Get aPublicReferenceobject by the internalUUIDfor generating HTML templatevoidreject(java.lang.String ticket, int reviewerID)Reject aPublicReference.voidrejectTicketByUser(java.lang.String ticket, int reviewerHashCode)Reject an open ticket by the user who requested to discard the process and not getting a persistent IDjava.lang.StringstorePersistentID(PublicReference reference, java.lang.String doi, int year)Store the generatedDataCiteReferencein to the eDAL system.
-
-
-
Method Detail
-
accept
public void accept(java.lang.String ticket, int reviewerID) throws EdalApprovalExceptionAccept aPublicReferenceand publish to public.- Specified by:
acceptin interfaceApprovalServiceProvider- Parameters:
ticket- the ticket number to identify the approvedPublicReference.reviewerID- the ID to identify the reviewer.- Throws:
EdalApprovalException- if unable to accept the ticket.
-
acceptTicketByUser
public void acceptTicketByUser(java.lang.String ticket, int reviewerHashCode) throws EdalApprovalExceptionDescription copied from interface:ApprovalServiceProviderAccept an open ticket by the user who requested the data publication to get a final persistent ID- Specified by:
acceptTicketByUserin interfaceApprovalServiceProvider- Parameters:
ticket- the ticket of the open requestreviewerHashCode- the id of the reviewer- Throws:
EdalApprovalException- if unable to accept the request
-
approve
public void approve(PublicReference reference, javax.mail.internet.InternetAddress emailNotificationAddress) throws EdalApprovalException
Initialize a request to approve aPublicReference.- Specified by:
approvein interfaceApprovalServiceProvider- Parameters:
reference- thePublicReferenceto approve.emailNotificationAddress- the eMail address of the requesting user- Throws:
EdalApprovalException- if unable to initialize the approval request.
-
checkOpenReviews
public void checkOpenReviews(java.util.Map<PublicReference,java.util.List<ReviewStatus>> results) throws EdalApprovalException
- Specified by:
checkOpenReviewsin interfaceApprovalServiceProvider- Parameters:
results- aMapwith all openPublicReferences and theirReviewStatus.- Throws:
EdalApprovalException- if unable to check open review processes.
-
getAllOpenReviews
public java.util.Map<PublicReference,java.util.List<ReviewStatus>> getAllOpenReviews()
Load all openPublicReferences that are not yet accepted or rejected.- Specified by:
getAllOpenReviewsin interfaceApprovalServiceProvider- Returns:
- a
Mapwith all openPublicReferences and the correspondingListwith theReviewStatus.
-
getNewURL
public java.lang.String getNewURL(PublicReference reference) throws EdalApprovalException
Description copied from interface:ApprovalServiceProvider- Specified by:
getNewURLin interfaceApprovalServiceProvider- Parameters:
reference- thePublicReferenceto get aURL- Returns:
- a new URL as
String - Throws:
EdalApprovalException- if unable to get aURL
-
getPublicReferenceByInternalId
public PublicReference getPublicReferenceByInternalId(java.lang.String internalId) throws EdalException
Description copied from interface:ApprovalServiceProviderGet aPublicReferenceobject by the internalUUIDfor generating HTML template- Specified by:
getPublicReferenceByInternalIdin interfaceApprovalServiceProvider- Parameters:
internalId- asString- Returns:
- the corresponding
PublicReference - Throws:
EdalException- if unable getPublicReference
-
reject
public void reject(java.lang.String ticket, int reviewerID) throws EdalApprovalExceptionReject aPublicReference.- Specified by:
rejectin interfaceApprovalServiceProvider- Parameters:
ticket- the ticket number to identify the rejectedPublicReference.reviewerID- the ID to identify the reviewer.- Throws:
EdalApprovalException- if unable to reject the ticket.
-
rejectTicketByUser
public void rejectTicketByUser(java.lang.String ticket, int reviewerHashCode) throws EdalApprovalExceptionDescription copied from interface:ApprovalServiceProviderReject an open ticket by the user who requested to discard the process and not getting a persistent ID- Specified by:
rejectTicketByUserin interfaceApprovalServiceProvider- Parameters:
ticket- the ticket of the open requestreviewerHashCode- the id of the reviewer- Throws:
EdalApprovalException- if unable to accept the request
-
storePersistentID
public java.lang.String storePersistentID(PublicReference reference, java.lang.String doi, int year) throws EdalApprovalException
Description copied from interface:ApprovalServiceProviderStore the generatedDataCiteReferencein to the eDAL system.- Specified by:
storePersistentIDin interfaceApprovalServiceProvider- Parameters:
reference- the correspondingPublicReferencedoi- the ID asStringyear- the year of the ID- Returns:
- the final ID as
String - Throws:
EdalApprovalException- if unable to store the ID
-
-