net.cnri.do_api
Class Repository

java.lang.Object
  extended by net.cnri.do_api.DigitalObject
      extended by net.cnri.do_api.Repository

public class Repository
extends DigitalObject

This object provides high level access to a digital object repository.


Field Summary
static java.lang.String SERIALIZED_ENCODING
           
 
Constructor Summary
Repository(DOAuthentication auth, java.lang.String repoID)
          Constructor for a repository that interfaces an object that provides an interface to the with the given authentication information
Repository(java.lang.String repoID, net.cnri.dobj.DOClientConnection conn)
          Construct a Repository instance which can be used to talk over existing connections to DO servers.
 
Method Summary
 java.lang.String copyObjectFrom(Repository source, java.lang.String objectID)
          Create a new object on this repository with the given identifier and return the ID of the new object.
 DigitalObject createDigitalObject(java.lang.String objectID)
          Create a new digital object in this repository and return an interface to that object.
 void deleteDigitalObject(java.lang.String objectID)
          Deletes a specified digital object from the repository
 net.cnri.dobj.DOClientConnection getConnection()
          Internal method to return the underlying connection that is used to communicate with this Repository.
 DigitalObject getDigitalObject(java.lang.String objectID)
          If the specified digital object exists in the repository, this method will return an instance of the DigitalObject class corresponding to that object.
 java.util.Iterator listObjects()
          Return an iterator of object IDs that are contained in this repository.
 void setUseEncryption(boolean encrypt)
          Sets whether or not the connection to this repository will be encrypted.
 java.lang.String toString()
          Returns a nicely formatted label for this object
 boolean verifyDigitalObject(java.lang.String objectID)
          Verifies that the specified digital object exists in the current repository
 
Methods inherited from class net.cnri.do_api.DigitalObject
deleteDataElement, getAttribute, getDataElement, getDateCreated, getDateLastModified, getID, getRepository, listAttributes, listDataElements, performOperation, setAttribute, verifyDataElement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SERIALIZED_ENCODING

public static final java.lang.String SERIALIZED_ENCODING
See Also:
Constant Field Values
Constructor Detail

Repository

public Repository(DOAuthentication auth,
                  java.lang.String repoID)
           throws java.lang.Exception
Constructor for a repository that interfaces an object that provides an interface to the with the given authentication information

Throws:
java.lang.Exception

Repository

public Repository(java.lang.String repoID,
                  net.cnri.dobj.DOClientConnection conn)
Construct a Repository instance which can be used to talk over existing connections to DO servers.

Method Detail

toString

public java.lang.String toString()
Description copied from class: DigitalObject
Returns a nicely formatted label for this object

Overrides:
toString in class DigitalObject

setUseEncryption

public void setUseEncryption(boolean encrypt)
Sets whether or not the connection to this repository will be encrypted. This has no effect on the current connection if the authentication handshake has already taken occurred.


getConnection

public net.cnri.dobj.DOClientConnection getConnection()
                                               throws DOException
Internal method to return the underlying connection that is used to communicate with this Repository.

Throws:
DOException

verifyDigitalObject

public boolean verifyDigitalObject(java.lang.String objectID)
                            throws DOException,
                                   java.io.IOException
Verifies that the specified digital object exists in the current repository

Throws:
DOException
java.io.IOException

createDigitalObject

public DigitalObject createDigitalObject(java.lang.String objectID)
                                  throws DOException
Create a new digital object in this repository and return an interface to that object. The objectID parameter indicates the identifier for the object. If the given objectID is null then the repository should choose a unique identifier and create the object. If an objectID is provided then the client should have permission to register that identifier in the handle system - otherwise the object will be created but will not be referenceable from outside of the repository.

Throws:
DOException

deleteDigitalObject

public void deleteDigitalObject(java.lang.String objectID)
                         throws DOException,
                                java.io.IOException
Deletes a specified digital object from the repository

Throws:
DOException
java.io.IOException

getDigitalObject

public DigitalObject getDigitalObject(java.lang.String objectID)
                               throws DOException,
                                      java.io.IOException
If the specified digital object exists in the repository, this method will return an instance of the DigitalObject class corresponding to that object.

Throws:
DOException
java.io.IOException

listObjects

public java.util.Iterator listObjects()
                               throws DOException,
                                      java.io.IOException
Return an iterator of object IDs that are contained in this repository.

Throws:
DOException
java.io.IOException

copyObjectFrom

public java.lang.String copyObjectFrom(Repository source,
                                       java.lang.String objectID)
                                throws DOException
Create a new object on this repository with the given identifier and return the ID of the new object. The object is copied from the given source repository into this repository.

Throws:
DOException