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 object in the DNA system.


Method Summary
 void deleteDataElement(java.lang.String elementID)
           
 java.lang.String getAttribute(java.lang.String attributeName, java.lang.String defaultValue)
          Associates the given attributeValue with the given attributeName for this object.
 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()
          Returns the identifier for this digital object
 Repository getRepository()
          Return the repository server through which this object is accessed
 java.lang.String[] listAttributes()
          Return the list of attribute names for this object
 java.lang.String[] listDataElements()
          List the elements in this digital object
 net.cnri.dobj.StreamPair performOperation(java.lang.String operationID, net.cnri.dobj.HeaderSet parameters)
          Invoke a low-level operation on this object, returning the input and output streams for the operation in a StreamPair.
 void setAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Associates the given attributeValue with the given attributeName for this object.
 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


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

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

getID

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


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

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

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

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

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 net.cnri.dobj.StreamPair performOperation(java.lang.String operationID,
                                                 net.cnri.dobj.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