net.cnri.dobj
Class DOMetadata

java.lang.Object
  extended by net.cnri.dobj.DOMetadata

public class DOMetadata
extends java.lang.Object

Storage class for metadata about a digital object.


Constructor Summary
DOMetadata()
           
 
Method Summary
 void clearTags()
          Removes all tags from the metadata
 long getDateCreated()
          Returns the date that the DO was most recently created.
 long getDateDeleted()
          Returns the date that the DO was most recently deleted.
 java.lang.String getObjectID()
          Returns the identifier for the object to which this metadata applies.
 java.lang.String getTag(java.lang.String tagName, java.lang.String defaultValue)
          Returns the value of the given tag.
 java.util.Iterator getTagNames()
          Returns an iterator containing the names of all tags associated with this object.
 boolean objectExists()
          Returns true if the object exists
 void resetFields()
          Resets the contents of the metadata
 void setDateCreated(long newDateCreated)
          Stores the date that the DO was most recently created.
 void setDateDeleted(long newDateDeleted)
          Stores the date that the DO was most recently deleted.
 void setObjectID(java.lang.String newObjectID)
          Sets the identifier for the object to which this metadata applies.
 void setTag(java.lang.String tagName, java.lang.String tagValue)
          Stores the given key-value pair as a tag along with this object.
 java.lang.String toString()
           
 void updateModification(long timestamp)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DOMetadata

public DOMetadata()
Method Detail

resetFields

public void resetFields()
Resets the contents of the metadata


getObjectID

public java.lang.String getObjectID()
Returns the identifier for the object to which this metadata applies.


setObjectID

public void setObjectID(java.lang.String newObjectID)
Sets the identifier for the object to which this metadata applies.


getTag

public java.lang.String getTag(java.lang.String tagName,
                               java.lang.String defaultValue)
Returns the value of the given tag. If the tag is not associated with a value in this object, return the given defaultValue.


setTag

public void setTag(java.lang.String tagName,
                   java.lang.String tagValue)
Stores the given key-value pair as a tag along with this object. Providing a null tagValue will remove any value that already exists with the given tagName.


getTagNames

public java.util.Iterator getTagNames()
Returns an iterator containing the names of all tags associated with this object.


clearTags

public void clearTags()
Removes all tags from the metadata


objectExists

public boolean objectExists()
Returns true if the object exists


setDateCreated

public void setDateCreated(long newDateCreated)
Stores the date that the DO was most recently created.


getDateCreated

public long getDateCreated()
Returns the date that the DO was most recently created.


setDateDeleted

public void setDateDeleted(long newDateDeleted)
Stores the date that the DO was most recently deleted.


getDateDeleted

public long getDateDeleted()
Returns the date that the DO was most recently deleted.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

updateModification

public void updateModification(long timestamp)