fedora.server.storage.types
Interface DigitalObject

All Known Implementing Classes:
BasicDigitalObject

public interface DigitalObject

Java representation of a Fedora digital object.

A DigitalObject instance may be used by DOReader and DOWriter instances as temporary storage for an object's attributes and components.

Implementations of this interface are responsible for temporary storage of these items, by whatever mechanism they deem fit. The most obvious implementation would simply store everything in memory.

Implementations of this interface are not responsible for any sort of validation on these items, or serialization/deserialization to/from specific formats.

Author:
cwilper@cs.cornell.edu

Field Summary
static int FEDORA_BDEF_OBJECT
           
static int FEDORA_BMECH_OBJECT
           
static int FEDORA_CONTENT_MODEL_OBJECT
           
static int FEDORA_OBJECT
           
 
Method Summary
 void addDatastreamVersion(Datastream ds, boolean addNewVersion)
          Adds a datastream to a digital object, respecting the versionable flag of that datastream.
 void addFedoraObjectType(int type)
           
 java.util.Iterator<java.lang.String> 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<java.lang.String> disseminatorIdIterator()
          Deprecated. 
 java.util.List<Disseminator> disseminators(java.lang.String id)
          Deprecated. 
 java.util.List<AuditRecord> getAuditRecords()
          Gets this object's mutable List of AuditRecord objects.
 java.lang.String getContentModelId()
          Deprecated. As of Fedora 3.0, content model is no longer an object-level property and should be asserted in RELS-EXT instead.
 java.util.Date getCreateDate()
          Gets the date the object was created.
 java.util.Map<java.lang.String,java.lang.String> 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.
 java.lang.String getFedoraObjectTypes()
           
 java.lang.String getLabel()
          Gets the label.
 java.util.Date getLastModDate()
          Gets the date the object was last modified.
 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 isFedoraObjectType(int type)
           
 boolean isNew()
           
 java.lang.String newAuditRecordID()
          Generate a unique id for an audit record.
 java.lang.String newDatastreamID()
          Generate a unique id for a datastream.
 java.lang.String newDatastreamID(java.lang.String dsID)
          Generate a unique id for a datastream version.
 void removeFedoraObjectType(int type)
           
 void setContentModelId(java.lang.String id)
          Deprecated. As of Fedora 3.0, content model is no longer an object-level property and should be asserted in RELS-EXT instead.
 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 setLabel(java.lang.String label)
          Sets the label.
 void setLastModDate(java.util.Date lastModDate)
          Sets the date the object was last modified.
 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.
 

Field Detail

FEDORA_OBJECT

static final int FEDORA_OBJECT
See Also:
Constant Field Values

FEDORA_BDEF_OBJECT

static final int FEDORA_BDEF_OBJECT
See Also:
Constant Field Values

FEDORA_BMECH_OBJECT

static final int FEDORA_BMECH_OBJECT
See Also:
Constant Field Values

FEDORA_CONTENT_MODEL_OBJECT

static final int FEDORA_CONTENT_MODEL_OBJECT
See Also:
Constant Field Values
Method Detail

getFedoraObjectTypes

java.lang.String getFedoraObjectTypes()

isFedoraObjectType

boolean isFedoraObjectType(int type)

addFedoraObjectType

void addFedoraObjectType(int type)

removeFedoraObjectType

void removeFedoraObjectType(int type)

isNew

boolean isNew()

setNew

void setNew(boolean isNew)

getPid

java.lang.String getPid()
Gets the pid.

Returns:
The pid, or null if it hasn't been set.

setPid

void setPid(java.lang.String pid)
Sets the pid.

Parameters:
pid - The pid.

getState

java.lang.String getState()
Gets the state.

Returns:
The state, or null if it hasn't been set.

setState

void setState(java.lang.String state)
Sets the state.

Parameters:
state - The state.

getOwnerId

java.lang.String getOwnerId()
Gets the userid of the user who owns the object.

Returns:
The userid

setOwnerId

void setOwnerId(java.lang.String owner)
Sets the owner of the object.

Parameters:
user - The userid.

getLabel

java.lang.String getLabel()
Gets the label.

Returns:
The label, or null if it hasn't been set.

setLabel

void setLabel(java.lang.String label)
Sets the label.

Parameters:
label - The label.

getContentModelId

@Deprecated
java.lang.String getContentModelId()
Deprecated. As of Fedora 3.0, content model is no longer an object-level property and should be asserted in RELS-EXT instead.

Gets the content model id.

Returns:
The content model id.
See Also:
fedora.common.Constants.MODEL.HAS_CONTENT_MODEL

setContentModelId

@Deprecated
void setContentModelId(java.lang.String id)
Deprecated. As of Fedora 3.0, content model is no longer an object-level property and should be asserted in RELS-EXT instead.

Sets the content model id.

Parameters:
id - The content model id.
See Also:
fedora.common.Constants.MODEL.HAS_CONTENT_MODEL

getCreateDate

java.util.Date getCreateDate()
Gets the date the object was created.

Returns:
The date, or null if it hasn't been set.

setCreateDate

void setCreateDate(java.util.Date createDate)
Sets the date the object was created.

Parameters:
createDate - The date.

getLastModDate

java.util.Date getLastModDate()
Gets the date the object was last modified.

Returns:
The date, or null if it hasn't been set.

setLastModDate

void setLastModDate(java.util.Date lastModDate)
Sets the date the object was last modified.

Parameters:
lastModDate - The date.

getAuditRecords

java.util.List<AuditRecord> getAuditRecords()
Gets this object's mutable List of AuditRecord objects.

Returns:
The List of AuditRecords, possibly of zero size but never null.

datastreamIdIterator

java.util.Iterator<java.lang.String> datastreamIdIterator()
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.

Returns:
A new Iterator of datastream ids, possibly of zero size but never null.

datastreams

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.

Parameters:
id - The datastream id.
Returns:
The list, possibly of zero size but never null.

addDatastreamVersion

void addDatastreamVersion(Datastream ds,
                          boolean addNewVersion)
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.

Parameters:
ds - The datastream to add.
addNewVersion - Controls whether to add a new version, or replace existing version.

disseminatorIdIterator

@Deprecated
java.util.Iterator<java.lang.String> disseminatorIdIterator()
Deprecated. 

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.

Returns:
A new Iterator of disseminator ids, possibly of zero size but never null.

disseminators

@Deprecated
java.util.List<Disseminator> disseminators(java.lang.String id)
Deprecated. 

Gets a mutable List that consists of versions of the same disseminator which is identified by the requested disseminator identifier.

Parameters:
id - The disseminator id.
Returns:
The list, possibly of zero size but never null.

newDatastreamID

java.lang.String newDatastreamID()
Generate a unique id for a datastream.


newDatastreamID

java.lang.String newDatastreamID(java.lang.String dsID)
Generate a unique id for a datastream version.


newAuditRecordID

java.lang.String newAuditRecordID()
Generate a unique id for an audit record.


setExtProperty

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

Parameters:
propName - The property name, either a string, or URI as string.

getExtProperty

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

Returns:
The property value.

getExtProperties

java.util.Map<java.lang.String,java.lang.String> getExtProperties()
Gets a Map containing all of the extended properties on the object. Map key is property name.

Returns:
The property Map.