public class HandleManager extends 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 String |
createHandle(Context context,
DSpaceObject dso)
Creates a new handle in the database.
|
static String |
createHandle(Context context,
DSpaceObject dso,
String suppliedHandle)
Creates a handle entry, but with a handle supplied by the caller (new
Handle not generated)
|
static String |
findHandle(Context context,
DSpaceObject dso)
Return the handle for an Object, or null if the Object has no handle.
|
static String |
getCanonicalForm(String handle)
Transforms handle into the canonical form hdl:handle.
|
static String |
getPrefix()
Get the configured Handle prefix string, or a default
|
static DSpaceObject |
resolveToObject(Context context,
String handle)
Return the object which handle maps to, or null.
|
static String |
resolveToURL(Context context,
String handle)
Return the local URL for handle, or null if handle cannot be found.
|
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 String resolveToURL(Context context, String handle) throws SQLException
context - DSpace contexthandle - The handleSQLException - If a database error occurspublic static String getCanonicalForm(String handle)
handle - The handlepublic static String createHandle(Context context, DSpaceObject dso) throws SQLException
context - DSpace contextdso - The DSpaceObject to create a handle forSQLException - If a database error occurspublic static String createHandle(Context context, DSpaceObject dso, String suppliedHandle) throws SQLException, IllegalStateException
context - DSpace contextdso - DSpaceObjectsuppliedHandle - existing handle valueIllegalStateException - if specified handle is already in use by another objectSQLExceptionpublic static void unbindHandle(Context context, DSpaceObject dso) throws SQLException
context - DSpace contextdso - DSpaceObject whose Handle to unbind.SQLExceptionpublic static DSpaceObject resolveToObject(Context context, String handle) throws IllegalStateException, SQLException
context - DSpace contexthandle - The handle to resolveIllegalStateException - If handle was found but is not bound to an objectSQLException - If a database error occurspublic static String findHandle(Context context, DSpaceObject dso) throws SQLException
context - DSpace contextdso - The object to obtain a handle forSQLException - If a database error occurspublic static String getPrefix()
Copyright © 2015 DuraSpace. All Rights Reserved.