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.
|
void |
setBase(String base) |
addCountry, addDc, addOrg, addOrgUnit, checkAttribute, closeContext, constructTree, getAdmin, getAttributeValues, getBase, getContext, getDefaultContext, getEnumerationValueString, getPassword, getSecureContext, getServer, parseAttribute, removeEntry, setAdmin, setPassword, setServer
public void setBase(String base)
setBase
in class org.dataone.cn.ldap.LDAPService
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.IdentifierNotUnique
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.ServiceFailure
public 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.NotAuthorized
org.dataone.service.exceptions.ServiceFailure
public 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.NotAuthorized
org.dataone.service.exceptions.NotFound
org.dataone.service.exceptions.IdentifierNotUnique
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.InvalidToken
public 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.ServiceFailure
public void expireEntries(int numberOfDays) throws NamingException
numberOfDays
- NamingException
public static void schedule(ReserveIdentifierService service)
service
- the service instance that will be used to expire the entriesCopyright © 2015. All rights reserved.