public class ReserveIdentifierService
extends org.dataone.cn.ldap.LDAPService
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
ReserveIdentifierService() |
| Modifier and Type | Method and Description |
|---|---|
void |
expireEntries(int numberOfDays)
Searches for all reservedIdentifiers and removes those which are older than
the numberOfDays specified
|
org.dataone.service.types.v1.Identifier |
generateIdentifier(org.dataone.service.types.v1.Session session,
String scheme,
String fragment)
Generate a unique identifier and reserve it for use by Subject in the Session.
|
boolean |
hasReservation(org.dataone.service.types.v1.Session session,
org.dataone.service.types.v1.Subject subject,
org.dataone.service.types.v1.Identifier pid)
determines whether or not the subject or one of its equivalent identities
has a reservation on the identifier.
|
boolean |
removeReservation(org.dataone.service.types.v1.Session session,
org.dataone.service.types.v1.Identifier pid) |
org.dataone.service.types.v1.Identifier |
reserveIdentifier(org.dataone.service.types.v1.Session session,
org.dataone.service.types.v1.Identifier pid)
Reserves the given Identifier for the Subject in the Session
Checks ownership of the pid by the subject if it already exists
TODO: update created date in cases where we are "re-reserving"?
|
static void |
schedule(ReserveIdentifierService service)
Initializes the timer to run expiration checking every hour
for the given service.
|
public org.dataone.service.types.v1.Identifier reserveIdentifier(org.dataone.service.types.v1.Session session,
org.dataone.service.types.v1.Identifier pid)
throws org.dataone.service.exceptions.IdentifierNotUnique,
org.dataone.service.exceptions.NotAuthorized,
org.dataone.service.exceptions.ServiceFailure
session - pid - org.dataone.service.exceptions.IdentifierNotUniqueorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.ServiceFailurepublic org.dataone.service.types.v1.Identifier generateIdentifier(org.dataone.service.types.v1.Session session,
String scheme,
String fragment)
throws org.dataone.service.exceptions.InvalidRequest,
org.dataone.service.exceptions.ServiceFailure,
org.dataone.service.exceptions.NotAuthorized
session - the Session identifying the callerscheme - the name of the identifier scheme to be used in generating IDsfragment - a string fragment that should be included in the identifier (optional)org.dataone.service.exceptions.InvalidRequest - if the scheme is not supported, or no scheme is providedorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.ServiceFailurepublic boolean removeReservation(org.dataone.service.types.v1.Session session,
org.dataone.service.types.v1.Identifier pid)
throws org.dataone.service.exceptions.NotAuthorized,
org.dataone.service.exceptions.NotFound,
org.dataone.service.exceptions.IdentifierNotUnique,
org.dataone.service.exceptions.InvalidToken,
org.dataone.service.exceptions.ServiceFailure,
org.dataone.service.exceptions.NotImplemented,
org.dataone.service.exceptions.InvalidRequest
session - pid - org.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.NotFoundorg.dataone.service.exceptions.IdentifierNotUniqueorg.dataone.service.exceptions.InvalidRequestorg.dataone.service.exceptions.NotImplementedorg.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.InvalidTokenpublic boolean hasReservation(org.dataone.service.types.v1.Session session,
org.dataone.service.types.v1.Subject subject,
org.dataone.service.types.v1.Identifier pid)
throws org.dataone.service.exceptions.NotFound,
org.dataone.service.exceptions.NotAuthorized,
org.dataone.service.exceptions.InvalidRequest,
org.dataone.service.exceptions.ServiceFailure
session - subject - id - - a pid or sidorg.dataone.service.exceptions.NotFound - - if a reservation is not found at all for that pidorg.dataone.service.exceptions.NotAuthorized - - if a reservation exists on the pid that is not owned by the subject.org.dataone.service.exceptions.InvalidRequest - - if subject or pid is nullorg.dataone.service.exceptions.ServiceFailurepublic void expireEntries(int numberOfDays)
throws NamingException,
org.dataone.service.exceptions.ServiceFailure
numberOfDays - NamingExceptionorg.dataone.service.exceptions.ServiceFailurepublic static void schedule(ReserveIdentifierService service)
service - the service instance that will be used to expire the entriesCopyright © 2019. All rights reserved.