fedora.server.storage.types
Class BasicDigitalObject

java.lang.Object
  extended by fedora.server.storage.types.BasicDigitalObject
All Implemented Interfaces:
DigitalObject

public class BasicDigitalObject
extends java.lang.Object
implements DigitalObject

Title: BasicDigitalObject.java

Description: A basic implementation of DigitalObject that stores things in memory.

Version:
$Id: BasicDigitalObject.java 5339 2006-12-06 21:27:46Z payette $
Author:
cwilper@cs.cornell.edu

Field Summary
 
Fields inherited from interface fedora.server.storage.types.DigitalObject
FEDORA_BDEF_OBJECT, FEDORA_BMECH_OBJECT, FEDORA_OBJECT
 
Constructor Summary
BasicDigitalObject()
           
 
Method Summary
 void addDatastreamVersion(Datastream ds, boolean addNewVersion)
          Adds a datastream to a digital object, respecting the versionable flag of that datastream.
 java.util.Iterator datastreamIdIterator()
          Gets an Iterator over the datastream ids in this object.
 java.util.List<Datastream> datastreams(java.lang.String id)
          Gets a mutable List of that consists of versions of the same datastream that is identified by the requested datastream identifier.
 java.util.Iterator disseminatorIdIterator()
          Gets an Iterator over the disseminator ids in this object.
 java.util.List<Disseminator> disseminators(java.lang.String id)
          Gets a mutable List that consists of versions of the same disseminator which is identified by the requested disseminator identifier.
 java.util.List getAuditRecords()
          Gets this object's mutable List of AuditRecord objects.
 java.lang.String getContentModelId()
          Gets the content model id.
 java.util.Date getCreateDate()
          Gets the date the object was created.
 java.util.Map getExtProperties()
          Gets a Map containing all of the extended properties on the object.
 java.lang.String getExtProperty(java.lang.String propName)
          Gets an extended property value, given the property name.
 int getFedoraObjectType()
           
 java.lang.String getLabel()
          Gets the label.
 java.util.Date getLastModDate()
          Gets the date the object was last modified.
 java.util.Map getNamespaceMapping()
          Gets the preferred namespace uri-to-prefix map for XML renditions of this object.
 java.lang.String getOwnerId()
          Gets the userid of the user who owns the object.
 java.lang.String getPid()
          Gets the pid.
 java.lang.String getState()
          Gets the state.
 boolean isNew()
           
 java.lang.String newAuditRecordID()
          Generate a unique id for an audit record.
 java.lang.String newDatastreamBindingMapID()
          Generate a unique id for a datastreamBindingMap.
 java.lang.String newDatastreamID()
          Generate a unique id for a datastream.
 java.lang.String newDatastreamID(java.lang.String id)
          Generate a unique id for a datastream version.
 java.lang.String newDisseminatorID()
          Generate a unique id for a disseminator.
 java.lang.String newDisseminatorID(java.lang.String id)
          Generate a unique id for a disseminator version.
 void setContentModelId(java.lang.String id)
          Sets the content model id.
 void setCreateDate(java.util.Date createDate)
          Sets the date the object was created.
 void setExtProperty(java.lang.String propName, java.lang.String propValue)
          Sets an extended property on the object.
 void setFedoraObjectType(int t)
           
 void setLabel(java.lang.String label)
          Sets the label.
 void setLastModDate(java.util.Date lastModDate)
          Sets the date the object was last modified.
 void setNamespaceMapping(java.util.Map mapping)
          Sets the preferred namespace uri-to-prefix map for XML renditions of this object.
 void setNew(boolean isNew)
           
 void setOwnerId(java.lang.String owner)
          Sets the owner of the object.
 void setPid(java.lang.String pid)
          Sets the pid.
 void setState(java.lang.String state)
          Sets the state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicDigitalObject

public BasicDigitalObject()
Method Detail

isNew

public boolean isNew()
Specified by:
isNew in interface DigitalObject

setNew

public void setNew(boolean isNew)
Specified by:
setNew in interface DigitalObject

getFedoraObjectType

public int getFedoraObjectType()
Specified by:
getFedoraObjectType in interface DigitalObject

setFedoraObjectType

public void setFedoraObjectType(int t)
Specified by:
setFedoraObjectType in interface DigitalObject

getPid

public java.lang.String getPid()
Description copied from interface: DigitalObject
Gets the pid.

Specified by:
getPid in interface DigitalObject
Returns:
The pid, or null if it hasn't been set.

setPid

public void setPid(java.lang.String pid)
Description copied from interface: DigitalObject
Sets the pid.

Specified by:
setPid in interface DigitalObject
Parameters:
pid - The pid.

getState

public java.lang.String getState()
Description copied from interface: DigitalObject
Gets the state.

Specified by:
getState in interface DigitalObject
Returns:
The state, or null if it hasn't been set.

setState

public void setState(java.lang.String state)
Description copied from interface: DigitalObject
Sets the state.

Specified by:
setState in interface DigitalObject
Parameters:
state - The state.

getOwnerId

public java.lang.String getOwnerId()
Description copied from interface: DigitalObject
Gets the userid of the user who owns the object.

Specified by:
getOwnerId in interface DigitalObject
Returns:
The userid

setOwnerId

public void setOwnerId(java.lang.String owner)
Description copied from interface: DigitalObject
Sets the owner of the object.

Specified by:
setOwnerId in interface DigitalObject

getLabel

public java.lang.String getLabel()
Description copied from interface: DigitalObject
Gets the label.

Specified by:
getLabel in interface DigitalObject
Returns:
The label, or null if it hasn't been set.

setLabel

public void setLabel(java.lang.String label)
Description copied from interface: DigitalObject
Sets the label.

Specified by:
setLabel in interface DigitalObject
Parameters:
label - The label.

getContentModelId

public java.lang.String getContentModelId()
Description copied from interface: DigitalObject
Gets the content model id.

Specified by:
getContentModelId in interface DigitalObject
Returns:
The content model id.

setContentModelId

public void setContentModelId(java.lang.String id)
Description copied from interface: DigitalObject
Sets the content model id.

Specified by:
setContentModelId in interface DigitalObject
Parameters:
id - The content model id.

getCreateDate

public java.util.Date getCreateDate()
Description copied from interface: DigitalObject
Gets the date the object was created.

Specified by:
getCreateDate in interface DigitalObject
Returns:
The date, or null if it hasn't been set.

setCreateDate

public void setCreateDate(java.util.Date createDate)
Description copied from interface: DigitalObject
Sets the date the object was created.

Specified by:
setCreateDate in interface DigitalObject
Parameters:
createDate - The date.

getLastModDate

public java.util.Date getLastModDate()
Description copied from interface: DigitalObject
Gets the date the object was last modified.

Specified by:
getLastModDate in interface DigitalObject
Returns:
The date, or null if it hasn't been set.

setLastModDate

public void setLastModDate(java.util.Date lastModDate)
Description copied from interface: DigitalObject
Sets the date the object was last modified.

Specified by:
setLastModDate in interface DigitalObject
Parameters:
lastModDate - The date.

setNamespaceMapping

public void setNamespaceMapping(java.util.Map mapping)
Description copied from interface: DigitalObject
Sets the preferred namespace uri-to-prefix map for XML renditions of this object.

Specified by:
setNamespaceMapping in interface DigitalObject
Parameters:
mapping - The uri-to-prefix mapping.

getNamespaceMapping

public java.util.Map getNamespaceMapping()
Description copied from interface: DigitalObject
Gets the preferred namespace uri-to-prefix map for XML renditions of this object.

Specified by:
getNamespaceMapping in interface DigitalObject
Returns:
The uri-to-prefix mapping.

getAuditRecords

public java.util.List getAuditRecords()
Description copied from interface: DigitalObject
Gets this object's mutable List of AuditRecord objects.

Specified by:
getAuditRecords in interface DigitalObject
Returns:
The List of AuditRecords, possibly of zero size but never null.

datastreamIdIterator

public java.util.Iterator datastreamIdIterator()
Description copied from interface: DigitalObject
Gets an Iterator over the datastream ids in this object.

The Iterator is not tied to the underlying Collection and cannot be used to remove datastreams.

Specified by:
datastreamIdIterator in interface DigitalObject
Returns:
A new Iterator of datastream ids, possibly of zero size but never null.

datastreams

public java.util.List<Datastream> datastreams(java.lang.String id)
Description copied from interface: DigitalObject
Gets a mutable List of that consists of versions of the same datastream that is identified by the requested datastream identifier.

Specified by:
datastreams in interface DigitalObject
Parameters:
id - The datastream id.
Returns:
The list, possibly of zero size but never null.

addDatastreamVersion

public void addDatastreamVersion(Datastream ds,
                                 boolean addNewVersion)
Description copied from interface: DigitalObject
Adds a datastream to a digital object, respecting the versionable flag of that datastream. Appending a new version of the datastream if the datastream is marked as versionable or replacing the existing version(s) of the datastream is it is marked as non-versionable identifier.

Specified by:
addDatastreamVersion in interface DigitalObject
Parameters:
ds - The datastream to add.
addNewVersion - Controls whether to add a new version, or replace existing version.

disseminatorIdIterator

public java.util.Iterator disseminatorIdIterator()
Description copied from interface: DigitalObject
Gets an Iterator over the disseminator ids in this object.

The Iterator is not tied to the underlying Collection and cannot be used to remove datastreams.

Specified by:
disseminatorIdIterator in interface DigitalObject
Returns:
A new Iterator of disseminator ids, possibly of zero size but never null.

disseminators

public java.util.List<Disseminator> disseminators(java.lang.String id)
Description copied from interface: DigitalObject
Gets a mutable List that consists of versions of the same disseminator which is identified by the requested disseminator identifier.

Specified by:
disseminators in interface DigitalObject
Parameters:
id - The disseminator id.
Returns:
The list, possibly of zero size but never null.

newDatastreamID

public java.lang.String newDatastreamID()
Description copied from interface: DigitalObject
Generate a unique id for a datastream.

Specified by:
newDatastreamID in interface DigitalObject

newDatastreamID

public java.lang.String newDatastreamID(java.lang.String id)
Description copied from interface: DigitalObject
Generate a unique id for a datastream version.

Specified by:
newDatastreamID in interface DigitalObject

newDisseminatorID

public java.lang.String newDisseminatorID()
Description copied from interface: DigitalObject
Generate a unique id for a disseminator.

Specified by:
newDisseminatorID in interface DigitalObject

newDisseminatorID

public java.lang.String newDisseminatorID(java.lang.String id)
Description copied from interface: DigitalObject
Generate a unique id for a disseminator version.

Specified by:
newDisseminatorID in interface DigitalObject

newDatastreamBindingMapID

public java.lang.String newDatastreamBindingMapID()
Description copied from interface: DigitalObject
Generate a unique id for a datastreamBindingMap.

Specified by:
newDatastreamBindingMapID in interface DigitalObject

newAuditRecordID

public java.lang.String newAuditRecordID()
Description copied from interface: DigitalObject
Generate a unique id for an audit record.

Specified by:
newAuditRecordID in interface DigitalObject

setExtProperty

public void setExtProperty(java.lang.String propName,
                           java.lang.String propValue)
Sets an extended property on the object.

Specified by:
setExtProperty in interface DigitalObject
Parameters:
propName - The extende property name, either a string, or URI as string.

getExtProperty

public java.lang.String getExtProperty(java.lang.String propName)
Gets an extended property value, given the property name.

Specified by:
getExtProperty in interface DigitalObject
Returns:
The property value.

getExtProperties

public java.util.Map getExtProperties()
Gets a Map containing all of the extended properties on the object. Map key is property name.

Specified by:
getExtProperties in interface DigitalObject
Returns:
The property Map.