net.cnri.do_api
Class DigitalObject

java.lang.Object
  extended by net.cnri.do_api.DigitalObject
Direct Known Subclasses:
Repository

public class DigitalObject
extends java.lang.Object

This is a high level interface to an arbitrary digital object.


Method Summary
 void deleteAttribute(java.lang.String attributeName)
          Delete the given attributeName for this object.
 void deleteAttributes(java.lang.String[] atts)
          Atomically delete more than one attribute
 void deleteDataElement(java.lang.String elementID)
           
 void deleteObject()
          Deletes this digital object
 java.lang.String getAttribute(java.lang.String attributeName, java.lang.String defaultValue)
          Associates the given attributeValue with the given attributeName for this object.
 HeaderSet getAttributes()
          Return all attributes
 DataElement getDataElement(java.lang.String elementID)
          Return a reference to the given data element within this object
 java.util.Date getDateCreated()
          Return the date that this object was created
 java.util.Date getDateLastModified()
          Return the date that this object was last modified
 java.lang.String getID()
           
 java.lang.String getObjectID()
          Returns the identifier for this digital object
 Repository getRepository()
          Return the repository server through which this object is accessed
 long getSize()
          Gets the size in bytes of the data element, not including attributes
 java.lang.String[] listAttributes()
          Return the list of attribute names for this object
 java.lang.String[] listDataElements()
          List the elements in this digital object
 StreamPair performOperation(java.lang.String operationID, HeaderSet parameters)
          Invoke a low-level operation on this object, returning the input and output streams for the operation in a StreamPair.
 void refresh()
          Refresh information about Data Elements or Attributes.
 void setAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Associates the given attributeValue with the given attributeName for this object.
 void setAttributes(HeaderSet atts)
          Atomically set more than one attribute
 java.lang.String toString()
          Returns a nicely formatted label for this object
 boolean verifyDataElement(java.lang.String elementID)
          Verifies whether or not the data element with the given name exists within this object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getRepository

public Repository getRepository()
Return the repository server through which this object is accessed


getObjectID

public java.lang.String getObjectID()
Returns the identifier for this digital object


getID

public java.lang.String getID()

verifyDataElement

public boolean verifyDataElement(java.lang.String elementID)
                          throws DOException,
                                 java.io.IOException
Verifies whether or not the data element with the given name exists within this object

Throws:
DOException
java.io.IOException

deleteDataElement

public void deleteDataElement(java.lang.String elementID)
                       throws DOException,
                              java.io.IOException
Throws:
DOException
java.io.IOException

deleteObject

public void deleteObject()
                  throws DOException,
                         java.io.IOException
Deletes this digital object

Throws:
DOException
java.io.IOException

toString

public java.lang.String toString()
Returns a nicely formatted label for this object

Overrides:
toString in class java.lang.Object

listDataElements

public java.lang.String[] listDataElements()
                                    throws DOException,
                                           java.io.IOException
List the elements in this digital object

Throws:
DOException
java.io.IOException

getDataElement

public DataElement getDataElement(java.lang.String elementID)
                           throws DOException,
                                  java.io.IOException
Return a reference to the given data element within this object

Throws:
DOException
java.io.IOException

performOperation

public StreamPair performOperation(java.lang.String operationID,
                                   HeaderSet parameters)
                            throws DOException,
                                   java.io.IOException
Invoke a low-level operation on this object, returning the input and output streams for the operation in a StreamPair. The caller must be careful to close both streams of the StreamPair when they are no longer used. For some operations the caller should close the output stream before any input will be received.

Throws:
DOException
java.io.IOException

refresh

public void refresh()
Refresh information about Data Elements or Attributes. Called automatically by methods that are known to change the object, but this is needed if changes are made outside the object. Also potentially needed after use of the generic "performOperation".


getDateCreated

public java.util.Date getDateCreated()
                              throws DOException,
                                     java.io.IOException
Return the date that this object was created

Throws:
DOException
java.io.IOException

getDateLastModified

public java.util.Date getDateLastModified()
                                   throws DOException,
                                          java.io.IOException
Return the date that this object was last modified

Throws:
DOException
java.io.IOException

getSize

public long getSize()
             throws DOException,
                    java.io.IOException
Gets the size in bytes of the data element, not including attributes

Throws:
DOException
java.io.IOException

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.String attributeValue)
                  throws DOException,
                         java.io.IOException
Associates the given attributeValue with the given attributeName for this object.

Throws:
DOException
java.io.IOException

setAttributes

public void setAttributes(HeaderSet atts)
                   throws DOException,
                          java.io.IOException
Atomically set more than one attribute

Throws:
DOException
java.io.IOException

deleteAttribute

public void deleteAttribute(java.lang.String attributeName)
                     throws DOException,
                            java.io.IOException
Delete the given attributeName for this object.

Throws:
DOException
java.io.IOException

deleteAttributes

public void deleteAttributes(java.lang.String[] atts)
                      throws DOException,
                             java.io.IOException
Atomically delete more than one attribute

Throws:
DOException
java.io.IOException

getAttribute

public java.lang.String getAttribute(java.lang.String attributeName,
                                     java.lang.String defaultValue)
                              throws DOException,
                                     java.io.IOException
Associates the given attributeValue with the given attributeName for this object.

Throws:
DOException
java.io.IOException

getAttributes

public HeaderSet getAttributes()
                        throws DOException,
                               java.io.IOException
Return all attributes

Throws:
DOException
java.io.IOException

listAttributes

public java.lang.String[] listAttributes()
                                  throws DOException,
                                         java.io.IOException
Return the list of attribute names for this object

Throws:
DOException
java.io.IOException