org.dspace.handle
Class HandleManager

java.lang.Object
  extended by org.dspace.handle.HandleManager

public class HandleManager
extends Object

Interface to the CNRI Handle System .

Currently, this class simply maps handles to local facilities; handles which are owned by other sites (including other DSpaces) are treated as non-existent.

Version:
$Revision: 3762 $
Author:
Peter Breton

Method Summary
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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

resolveToURL

public static String resolveToURL(Context context,
                                  String handle)
                           throws SQLException
Return the local URL for handle, or null if handle cannot be found. The returned URL is a (non-handle-based) location where a dissemination of the object referred to by handle can be obtained.

Parameters:
context - DSpace context
handle - The handle
Returns:
The local URL
Throws:
SQLException - If a database error occurs

getCanonicalForm

public static String getCanonicalForm(String handle)
Transforms handle into the canonical form hdl:handle. No attempt is made to verify that handle is in fact valid.

Parameters:
handle - The handle
Returns:
The canonical form

createHandle

public static String createHandle(Context context,
                                  DSpaceObject dso)
                           throws SQLException
Creates a new handle in the database.

Parameters:
context - DSpace context
dso - The DSpaceObject to create a handle for
Returns:
The newly created handle
Throws:
SQLException - If a database error occurs

createHandle

public static String createHandle(Context context,
                                  DSpaceObject dso,
                                  String suppliedHandle)
                           throws SQLException
Creates a handle entry, but with a handle supplied by the caller (new Handle not generated)

Parameters:
context - DSpace context
dso - DSpaceObject
suppliedHandle - existing handle value
Returns:
the Handle
Throws:
SQLException

resolveToObject

public static DSpaceObject resolveToObject(Context context,
                                           String handle)
                                    throws SQLException
Return the object which handle maps to, or null. This is the object itself, not a URL which points to it.

Parameters:
context - DSpace context
handle - The handle to resolve
Returns:
The object which handle maps to, or null if handle is not mapped to any object.
Throws:
SQLException - If a database error occurs

findHandle

public static String findHandle(Context context,
                                DSpaceObject dso)
                         throws SQLException
Return the handle for an Object, or null if the Object has no handle.

Parameters:
context - DSpace context
dso - The object to obtain a handle for
Returns:
The handle for object, or null if the object has no handle.
Throws:
SQLException - If a database error occurs


Copyright © 2010 DuraSpace. All Rights Reserved.