public class HandleManager
extends java.lang.Object
Currently, this class simply maps handles to local facilities; handles which are owned by other sites (including other DSpaces) are treated as non-existent.
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
createHandle(Context context,
DSpaceObject dso)
Creates a new handle in the database.
|
static java.lang.String |
createHandle(Context context,
DSpaceObject dso,
java.lang.String suppliedHandle)
Creates a handle entry, but with a handle supplied by the caller (new
Handle not generated)
|
static java.lang.String |
findHandle(Context context,
DSpaceObject dso)
Return the handle for an Object, or null if the Object has no handle.
|
static java.lang.String |
getCanonicalForm(java.lang.String handle)
Transforms handle into the canonical form hdl:handle.
|
static java.util.List<java.lang.String> |
getHandlesForPrefix(Context context,
java.lang.String prefix)
Return all the handles which start with prefix.
|
static java.lang.String |
getPrefix()
Get the configured Handle prefix string, or a default
|
static DSpaceObject |
resolveToObject(Context context,
java.lang.String handle)
Return the object which handle maps to, or null.
|
static java.lang.String |
resolveToURL(Context context,
java.lang.String handle)
Return the local URL for handle, or null if handle cannot be found.
|
static java.lang.String |
resolveUrlToHandle(Context context,
java.lang.String url)
Try to detect a handle in a URL.
|
static void |
unbindHandle(Context context,
DSpaceObject dso)
Removes binding of Handle to a DSpace object, while leaving the
Handle in the table so it doesn't get reallocated.
|
public static java.lang.String resolveToURL(Context context, java.lang.String handle) throws java.sql.SQLException
context - DSpace contexthandle - The handlejava.sql.SQLException - If a database error occurspublic static java.lang.String resolveUrlToHandle(Context context, java.lang.String url) throws java.sql.SQLException
context - DSpace contexturl - The URLjava.sql.SQLException - If a database error occurspublic static java.lang.String getCanonicalForm(java.lang.String handle)
handle - The handlepublic static java.lang.String createHandle(Context context, DSpaceObject dso) throws java.sql.SQLException
context - DSpace contextdso - The DSpaceObject to create a handle forjava.sql.SQLException - If a database error occurspublic static java.lang.String createHandle(Context context, DSpaceObject dso, java.lang.String suppliedHandle) throws java.sql.SQLException, java.lang.IllegalStateException
context - DSpace contextdso - DSpaceObjectsuppliedHandle - existing handle valuejava.lang.IllegalStateException - if specified handle is already in use by another objectjava.sql.SQLExceptionpublic static void unbindHandle(Context context, DSpaceObject dso) throws java.sql.SQLException
context - DSpace contextdso - DSpaceObject whose Handle to unbind.java.sql.SQLExceptionpublic static DSpaceObject resolveToObject(Context context, java.lang.String handle) throws java.lang.IllegalStateException, java.sql.SQLException
context - DSpace contexthandle - The handle to resolvejava.lang.IllegalStateException - If handle was found but is not bound to an objectjava.sql.SQLException - If a database error occurspublic static java.lang.String findHandle(Context context, DSpaceObject dso) throws java.sql.SQLException
context - DSpace contextdso - The object to obtain a handle forjava.sql.SQLException - If a database error occurspublic static java.util.List<java.lang.String> getHandlesForPrefix(Context context, java.lang.String prefix) throws java.sql.SQLException
context - DSpace contextprefix - The handle prefixjava.sql.SQLException - If a database error occurspublic static java.lang.String getPrefix()
Copyright © 2013 DuraSpace. All Rights Reserved.