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 ofApprovalServiceProvider
for the storage back end.
-
-
Constructor Summary
Constructors Constructor Description ApprovalServiceProviderImplementation()
-
Method Summary
Modifier and Type Method Description void
accept(java.lang.String ticket, int reviewerID)
Accept aPublicReference
and publish to public.void
acceptTicketByUser(java.lang.String ticket, int reviewerHashCode)
Accept an open ticket by the user who requested the data publication to get a final persistent IDvoid
approve(PublicReference reference, javax.mail.internet.InternetAddress emailNotificationAddress)
Initialize a request to approve aPublicReference
.void
checkOpenReviews(java.util.Map<PublicReference,java.util.List<ReviewStatus>> results)
java.util.Map<PublicReference,java.util.List<ReviewStatus>>
getAllOpenReviews()
Load all openPublicReference
s that are not yet accepted or rejected.java.lang.String
getNewURL(PublicReference reference)
PublicReference
getPublicReferenceByInternalId(java.lang.String internalId)
Get aPublicReference
object by the internalUUID
for generating HTML templatevoid
reject(java.lang.String ticket, int reviewerID)
Reject aPublicReference
.void
rejectTicketByUser(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.String
storePersistentID(PublicReference reference, java.lang.String doi, int year)
Store the generatedDataCiteReference
in to the eDAL system.
-
-
-
Method Detail
-
accept
public void accept(java.lang.String ticket, int reviewerID) throws EdalApprovalException
Accept aPublicReference
and publish to public.- Specified by:
accept
in 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 EdalApprovalException
Description copied from interface:ApprovalServiceProvider
Accept an open ticket by the user who requested the data publication to get a final persistent ID- Specified by:
acceptTicketByUser
in 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:
approve
in interfaceApprovalServiceProvider
- Parameters:
reference
- thePublicReference
to 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:
checkOpenReviews
in interfaceApprovalServiceProvider
- Parameters:
results
- aMap
with all openPublicReference
s and theirReviewStatus
.- Throws:
EdalApprovalException
- if unable to check open review processes.
-
getAllOpenReviews
public java.util.Map<PublicReference,java.util.List<ReviewStatus>> getAllOpenReviews()
Load all openPublicReference
s that are not yet accepted or rejected.- Specified by:
getAllOpenReviews
in interfaceApprovalServiceProvider
- Returns:
- a
Map
with all openPublicReference
s and the correspondingList
with theReviewStatus
.
-
getNewURL
public java.lang.String getNewURL(PublicReference reference) throws EdalApprovalException
Description copied from interface:ApprovalServiceProvider
- Specified by:
getNewURL
in interfaceApprovalServiceProvider
- Parameters:
reference
- thePublicReference
to 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:ApprovalServiceProvider
Get aPublicReference
object by the internalUUID
for generating HTML template- Specified by:
getPublicReferenceByInternalId
in interfaceApprovalServiceProvider
- Parameters:
internalId
- asString
- Returns:
- the corresponding
PublicReference
- Throws:
EdalException
- if unable getPublicReference
-
reject
public void reject(java.lang.String ticket, int reviewerID) throws EdalApprovalException
Reject aPublicReference
.- Specified by:
reject
in 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 EdalApprovalException
Description copied from interface:ApprovalServiceProvider
Reject an open ticket by the user who requested to discard the process and not getting a persistent ID- Specified by:
rejectTicketByUser
in 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:ApprovalServiceProvider
Store the generatedDataCiteReference
in to the eDAL system.- Specified by:
storePersistentID
in interfaceApprovalServiceProvider
- Parameters:
reference
- the correspondingPublicReference
doi
- the ID asString
year
- the year of the ID- Returns:
- the final ID as
String
- Throws:
EdalApprovalException
- if unable to store the ID
-
-