@Component public class VersionedHandleIdentifierProvider extends IdentifierProvider
configurationService, parentService| Constructor and Description |
|---|
VersionedHandleIdentifierProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected static java.lang.String |
createId(int id)
Create a new handle id.
|
protected java.lang.String |
createNewIdentifier(Context context,
DSpaceObject dso,
java.lang.String handleId) |
protected VersionImpl |
createVersion(Context c,
VersionHistory vh,
Item item,
java.lang.String summary,
java.util.Date date,
int versionNumber) |
void |
delete(Context context,
DSpaceObject dso)
Unbind this type of identifier(s) from an object.
|
void |
delete(Context context,
DSpaceObject dso,
java.lang.String identifier)
Unbind the given identifier from an object.
|
protected static TableRow |
findHandleInternal(Context context,
java.lang.String handle)
Find the database row corresponding to handle.
|
protected java.lang.String |
getCanonical(Item item) |
protected java.lang.String |
getCanonical(java.lang.String identifier) |
protected static java.lang.String |
getCanonicalForm(java.lang.String handle) |
protected static TableRow |
getHandleInternal(Context context,
int type,
int id)
Return the handle for an Object, or null if the Object has no handle.
|
protected int |
getNextVersionNumer(Version latest) |
static java.lang.String |
getPrefix()
Get the configured Handle prefix string, or a default
|
java.lang.String |
lookup(Context context,
DSpaceObject dso)
Return the identifier for a DSpaceObject.
|
protected java.lang.String |
makeIdentifierBasedOnHistory(Context context,
DSpaceObject dso,
java.lang.String handleId,
VersionHistory history) |
java.lang.String |
mint(Context context,
DSpaceObject dso)
Creates a new handle in the database.
|
protected void |
modifyHandleMetadata(Item item,
java.lang.String handle) |
protected java.lang.String |
modifyHandleRecord(Context context,
DSpaceObject dso,
TableRow handle,
java.lang.String handleId) |
protected void |
populateHandleMetadata(Item item) |
java.lang.String |
register(Context context,
DSpaceObject dso)
Create and apply an identifier to a DSpaceObject.
|
void |
register(Context context,
DSpaceObject dso,
java.lang.String identifier)
Create a specific identifier and apply it to an object.
|
void |
reserve(Context context,
DSpaceObject dso,
java.lang.String identifier)
Set an object's identifier.
|
DSpaceObject |
resolve(Context context,
java.lang.String identifier,
java.lang.String... attributes)
Find the object named by a given identifier.
|
static java.lang.String |
retrieveHandleOutOfUrl(java.lang.String url) |
protected VersionHistory |
retrieveVersionHistory(Context c,
Item item) |
void |
setVersionDAO(VersionDAO versionDAO) |
void |
setVersionHistoryDAO(VersionHistoryDAO versionHistoryDAO) |
boolean |
supports(java.lang.Class<? extends Identifier> identifier)
Can this provider provide identifiers of a given type?
|
boolean |
supports(java.lang.String identifier)
Can this provider provide identifiers of a given type?
|
setConfigurationService, setParentServicepublic boolean supports(java.lang.Class<? extends Identifier> identifier)
IdentifierProvidersupports in class IdentifierProvideridentifier - requested type.public boolean supports(java.lang.String identifier)
IdentifierProvidersupports in class IdentifierProvideridentifier - requested type.public java.lang.String register(Context context, DSpaceObject dso)
IdentifierProviderregister in class IdentifierProviderdso - object to be named.item if it has one, else a new identifier.public void register(Context context, DSpaceObject dso, java.lang.String identifier)
IdentifierProviderregister in class IdentifierProviderdso - to be identified.identifier - to be created.public void reserve(Context context, DSpaceObject dso, java.lang.String identifier)
IdentifierProviderreserve in class IdentifierProviderdso - object to be identified.identifier - to be set on the object.public java.lang.String mint(Context context, DSpaceObject dso)
mint in class IdentifierProvidercontext - DSpace contextdso - The DSpaceObject to create a handle forpublic DSpaceObject resolve(Context context, java.lang.String identifier, java.lang.String... attributes)
IdentifierProviderresolve in class IdentifierProvideridentifier - to be resolved.attributes - additional information for resolving identifier.public java.lang.String lookup(Context context, DSpaceObject dso) throws IdentifierNotFoundException, IdentifierNotResolvableException
IdentifierProviderlookup in class IdentifierProviderdso - The object to be looked up.object.IdentifierNotFoundExceptionIdentifierNotResolvableExceptionpublic void delete(Context context, DSpaceObject dso, java.lang.String identifier) throws IdentifierException
IdentifierProviderdelete in class IdentifierProviderdso - object to be de-identified.identifier - to be removed.IdentifierExceptionpublic void delete(Context context, DSpaceObject dso) throws IdentifierException
IdentifierProviderdelete in class IdentifierProviderdso - object to lose its identity.IdentifierExceptionpublic static java.lang.String retrieveHandleOutOfUrl(java.lang.String url)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static java.lang.String getPrefix()
protected static java.lang.String getCanonicalForm(java.lang.String handle)
protected java.lang.String createNewIdentifier(Context context, DSpaceObject dso, java.lang.String handleId) throws java.sql.SQLException
java.sql.SQLExceptionprotected java.lang.String makeIdentifierBasedOnHistory(Context context, DSpaceObject dso, java.lang.String handleId, VersionHistory history) throws AuthorizeException, java.sql.SQLException
AuthorizeExceptionjava.sql.SQLExceptionprotected java.lang.String modifyHandleRecord(Context context, DSpaceObject dso, TableRow handle, java.lang.String handleId) throws java.sql.SQLException
java.sql.SQLExceptionprotected java.lang.String getCanonical(Item item)
protected java.lang.String getCanonical(java.lang.String identifier)
protected static TableRow findHandleInternal(Context context, java.lang.String handle) throws java.sql.SQLException
context - DSpace contexthandle - The handle to resolvejava.sql.SQLException - If a database error occursprotected static TableRow getHandleInternal(Context context, int type, int id) throws java.sql.SQLException
context - DSpace contexttype - The type of objectid - The id of objectjava.sql.SQLException - If a database error occursprotected static java.lang.String createId(int id)
throws java.sql.SQLException
java.sql.SQLException - If a database error occursprotected VersionHistory retrieveVersionHistory(Context c, Item item)
protected void populateHandleMetadata(Item item) throws java.sql.SQLException, java.io.IOException, AuthorizeException
java.sql.SQLExceptionjava.io.IOExceptionAuthorizeExceptionprotected void modifyHandleMetadata(Item item, java.lang.String handle) throws java.sql.SQLException, java.io.IOException, AuthorizeException
java.sql.SQLExceptionjava.io.IOExceptionAuthorizeExceptionprotected VersionImpl createVersion(Context c, VersionHistory vh, Item item, java.lang.String summary, java.util.Date date, int versionNumber)
protected int getNextVersionNumer(Version latest)
public void setVersionDAO(VersionDAO versionDAO)
public void setVersionHistoryDAO(VersionHistoryDAO versionHistoryDAO)
Copyright © 2013 DuraSpace. All Rights Reserved.