Class HandlePlugin

  • All Implemented Interfaces:
    net.handle.hdllib.HandleStorage

    public class HandlePlugin
    extends Object
    implements net.handle.hdllib.HandleStorage
    Extension to the CNRI Handle Server that translates requests to resolve handles into DSpace API calls. The implementation simply stubs out most of the methods, and delegates the rest to the HandleService. This only provides some of the functionality (namely, the resolving of handles to URLs) of the CNRI HandleStorage interface.

    This class is intended to be embedded in the CNRI Handle Server. It conforms to the HandleStorage interface that was delivered with Handle Server version 6.2.0.

    Version:
    $Revision$
    Author:
    Peter Breton
    • Constructor Summary

      Constructors 
      Constructor Description
      HandlePlugin()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkpointDatabase()
      HandleStorage interface method - not implemented.
      void createHandle​(byte[] theHandle, net.handle.hdllib.HandleValue[] values)
      HandleStorage interface method - not implemented.
      void deleteAllRecords()
      HandleStorage interface method - not implemented.
      boolean deleteHandle​(byte[] theHandle)
      HandleStorage interface method - not implemented.
      Enumeration getHandlesForNA​(byte[] theNAHandle)
      Return all handles in local storage which start with the naming authority handle.
      byte[][] getRawHandleValues​(byte[] theHandle, int[] indexList, byte[][] typeList)
      Return the raw values for this handle.
      boolean haveNA​(byte[] theHandle)
      Return true if we have this handle in storage.
      void init​(net.cnri.util.StreamTable st)
      HandleStorage interface init method.
      void scanHandles​(net.handle.hdllib.ScanCallback callback)
      HandleStorage interface method - not implemented.
      void scanNAs​(net.handle.hdllib.ScanCallback callback)
      HandleStorage interface method - not implemented.
      void setHaveNA​(byte[] theHandle, boolean haveit)
      HandleStorage interface method - not implemented.
      void shutdown()
      HandleStorage interface shutdown() method.
      void updateValue​(byte[] theHandle, net.handle.hdllib.HandleValue[] values)
      HandleStorage interface method - not implemented.
      • Methods inherited from interface net.handle.hdllib.HandleStorage

        createOrUpdateRecord, exists, scanHandlesFrom, scanNAsFrom, supportsDumpResumption
    • Constructor Detail

      • HandlePlugin

        public HandlePlugin()
    • Method Detail

      • init

        public void init​(net.cnri.util.StreamTable st)
                  throws Exception
        HandleStorage interface init method.

        For DSpace, we have to startup the DSpace Kernel when HandlePlugin initializes, as the HandlePlugin relies on HandleService (and other services) which are loaded by the Kernel.

        Specified by:
        init in interface net.handle.hdllib.HandleStorage
        Parameters:
        st - StreamTable
        Throws:
        Exception - if DSpace Kernel fails to startup
      • setHaveNA

        public void setHaveNA​(byte[] theHandle,
                              boolean haveit)
                       throws net.handle.hdllib.HandleException
        HandleStorage interface method - not implemented.
        Specified by:
        setHaveNA in interface net.handle.hdllib.HandleStorage
        Throws:
        net.handle.hdllib.HandleException
      • createHandle

        public void createHandle​(byte[] theHandle,
                                 net.handle.hdllib.HandleValue[] values)
                          throws net.handle.hdllib.HandleException
        HandleStorage interface method - not implemented.
        Specified by:
        createHandle in interface net.handle.hdllib.HandleStorage
        Throws:
        net.handle.hdllib.HandleException
      • deleteHandle

        public boolean deleteHandle​(byte[] theHandle)
                             throws net.handle.hdllib.HandleException
        HandleStorage interface method - not implemented.
        Specified by:
        deleteHandle in interface net.handle.hdllib.HandleStorage
        Throws:
        net.handle.hdllib.HandleException
      • updateValue

        public void updateValue​(byte[] theHandle,
                                net.handle.hdllib.HandleValue[] values)
                         throws net.handle.hdllib.HandleException
        HandleStorage interface method - not implemented.
        Specified by:
        updateValue in interface net.handle.hdllib.HandleStorage
        Throws:
        net.handle.hdllib.HandleException
      • deleteAllRecords

        public void deleteAllRecords()
                              throws net.handle.hdllib.HandleException
        HandleStorage interface method - not implemented.
        Specified by:
        deleteAllRecords in interface net.handle.hdllib.HandleStorage
        Throws:
        net.handle.hdllib.HandleException
      • checkpointDatabase

        public void checkpointDatabase()
                                throws net.handle.hdllib.HandleException
        HandleStorage interface method - not implemented.
        Specified by:
        checkpointDatabase in interface net.handle.hdllib.HandleStorage
        Throws:
        net.handle.hdllib.HandleException
      • shutdown

        public void shutdown()
        HandleStorage interface shutdown() method.

        For DSpace, we need to destroy the kernel created in init().

        Specified by:
        shutdown in interface net.handle.hdllib.HandleStorage
      • scanHandles

        public void scanHandles​(net.handle.hdllib.ScanCallback callback)
                         throws net.handle.hdllib.HandleException
        HandleStorage interface method - not implemented.
        Specified by:
        scanHandles in interface net.handle.hdllib.HandleStorage
        Throws:
        net.handle.hdllib.HandleException
      • scanNAs

        public void scanNAs​(net.handle.hdllib.ScanCallback callback)
                     throws net.handle.hdllib.HandleException
        HandleStorage interface method - not implemented.
        Specified by:
        scanNAs in interface net.handle.hdllib.HandleStorage
        Throws:
        net.handle.hdllib.HandleException
      • getRawHandleValues

        public byte[][] getRawHandleValues​(byte[] theHandle,
                                           int[] indexList,
                                           byte[][] typeList)
                                    throws net.handle.hdllib.HandleException
        Return the raw values for this handle. This implementation returns a single URL value.
        Specified by:
        getRawHandleValues in interface net.handle.hdllib.HandleStorage
        Parameters:
        theHandle - byte array representation of handle
        indexList - ignored
        typeList - ignored
        Returns:
        A byte array with the raw data for this handle. Currently, this consists of a single URL value.
        Throws:
        net.handle.hdllib.HandleException - If an error occurs while calling the Handle API.
      • haveNA

        public boolean haveNA​(byte[] theHandle)
                       throws net.handle.hdllib.HandleException
        Return true if we have this handle in storage.
        Specified by:
        haveNA in interface net.handle.hdllib.HandleStorage
        Parameters:
        theHandle - byte array representation of handle
        Returns:
        True if we have this handle in storage
        Throws:
        net.handle.hdllib.HandleException - If an error occurs while calling the Handle API.
      • getHandlesForNA

        public Enumeration getHandlesForNA​(byte[] theNAHandle)
                                    throws net.handle.hdllib.HandleException
        Return all handles in local storage which start with the naming authority handle.
        Specified by:
        getHandlesForNA in interface net.handle.hdllib.HandleStorage
        Parameters:
        theNAHandle - byte array representation of naming authority handle
        Returns:
        All handles in local storage which start with the naming authority handle.
        Throws:
        net.handle.hdllib.HandleException - If an error occurs while calling the Handle API.