org.fcrepo.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:
Chris Wilper

Method Summary
 void addDatastreamVersion(Datastream ds, boolean addNewVersion)
          Adds a datastream to a digital object, respecting the versionable flag of that datastream.
 Iterator<String> datastreamIdIterator()
          Gets an Iterator over the datastream ids in this object.
 Iterable<Datastream> datastreams(String id)
          Gets an interable view that consists of versions of the same datastream that is identified by the requested datastream identifier.
 Iterator<String> disseminatorIdIterator()
          Deprecated. 
 List<Disseminator> disseminators(String id)
          Deprecated. 
 List<AuditRecord> getAuditRecords()
          Gets this object's mutable List of AuditRecord objects.
 List<String> getContentModels()
          Gets a list of the content models of the object.
 Date getCreateDate()
          Gets the date the object was created.
 Map<String,String> getExtProperties()
          Gets a Map containing all of the extended properties on the object.
 String getExtProperty(String propName)
          Gets an extended property value, given the property name.
 String getLabel()
          Gets the label.
 Date getLastModDate()
          Gets the date the object was last modified.
 String getOwnerId()
          Gets the userid of the user who owns the object.
 String getPid()
          Gets the pid.
 Set<RelationshipTuple> getRelationships()
          Get all RELS-EXT and RELS-INT relationships in the object.
 Set<RelationshipTuple> getRelationships(org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object)
          Get all matching RELS-EXT relationships in the object, assumes pid is the subject
 Set<RelationshipTuple> getRelationships(org.jrdf.graph.SubjectNode subject, org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object)
          Get all matching RELS-EXT and RELS-INT relationships in the object.
 String getState()
          Gets the state.
 boolean hasContentModel(org.jrdf.graph.ObjectNode contentModel)
          Determins whether or not the object have the given uri as a content model.
 boolean hasRelationship(org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object)
          Determine if the object contains the given relationship, assumes pid is the subject
 boolean hasRelationship(org.jrdf.graph.SubjectNode subject, org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object)
          Determine if the object contains the given relationship.
 boolean isNew()
           
 String newAuditRecordID()
          Generate a unique id for an audit record.
 String newDatastreamID()
          Generate a unique id for a datastream.
 String newDatastreamID(String dsID)
          Generate a unique id for a datastream version.
 void removeDatastreamVersion(Datastream ds)
          Removes a datastream from a digital object.
 void setCreateDate(Date createDate)
          Sets the date the object was created.
 void setExtProperty(String propName, String propValue)
          Sets an extended property on the object.
 void setLabel(String label)
          Sets the label.
 void setLastModDate(Date lastModDate)
          Sets the date the object was last modified.
 void setNew(boolean isNew)
           
 void setOwnerId(String owner)
          Sets the owner of the object.
 void setPid(String pid)
          Sets the pid.
 void setState(String state)
          Sets the state.
 

Method Detail

isNew

boolean isNew()

setNew

void setNew(boolean isNew)

getPid

String getPid()
Gets the pid.

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

setPid

void setPid(String pid)
Sets the pid.

Parameters:
pid - The pid.

getState

String getState()
Gets the state.

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

setState

void setState(String state)
Sets the state.

Parameters:
state - The state.

getOwnerId

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

Returns:
The userid

setOwnerId

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

Parameters:
user - The userid.

getLabel

String getLabel()
Gets the label.

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

setLabel

void setLabel(String label)
Sets the label.

Parameters:
label - The label.

getCreateDate

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

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

setCreateDate

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

Parameters:
createDate - The date.

getLastModDate

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

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

setLastModDate

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

Parameters:
lastModDate - The date.

getAuditRecords

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

Iterator<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

Iterable<Datastream> datastreams(String id)
Gets an interable view that consists of versions of the same datastream that is identified by the requested datastream identifier.

Datastreams within any iterators produced here are references to the actual datastreams in this DigitalObject, so modifying their contents is a persistent change. However, remove() is disabled, so to remove a datastream from the object, use removeDatastreamVersion(Datastream)

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.

removeDatastreamVersion

void removeDatastreamVersion(Datastream ds)
Removes a datastream from a digital object.

Parameters:
ds - Datastream to remove.

disseminatorIdIterator

@Deprecated
Iterator<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
List<Disseminator> disseminators(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

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


newDatastreamID

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


newAuditRecordID

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


setExtProperty

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

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

getExtProperty

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

Returns:
The property value.

getExtProperties

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

Returns:
The property Map.

hasRelationship

boolean hasRelationship(org.jrdf.graph.SubjectNode subject,
                        org.jrdf.graph.PredicateNode predicate,
                        org.jrdf.graph.ObjectNode object)
Determine if the object contains the given relationship.

Returns results that are accurate for the current state of the object at the time of invocation. Thus, if there is some change to the object that changes the set of relationships contained within, the next call to hasRelationship will reflect those changes.

Parameters:
subject - Subject of the relationship, or null if unspecified (will match any).
predicate - Predicate of the relationship, or null if unspecified (will match any).
object - Object (target) of the relationship, or null if unspecified (will match any).
Returns:
true if the object

hasRelationship

boolean hasRelationship(org.jrdf.graph.PredicateNode predicate,
                        org.jrdf.graph.ObjectNode object)
Determine if the object contains the given relationship, assumes pid is the subject

Returns results that are accurate for the current state of the object at the time of invocation. Thus, if there is some change to the object that changes the set of relationships contained within, the next call to hasRelationship will reflect those changes.

Parameters:
predicate - Predicate of the relationship, or null if unspecified (will match any).
object - Object (target) of the relationship, or null if unspecified (will match any).
Returns:
true if the object

getRelationships

Set<RelationshipTuple> getRelationships()
Get all RELS-EXT and RELS-INT relationships in the object.

Returns results that are accurate for the current state of the object at the time of invocation. Thus, if there is some change to the object that changes the set of relationships contained within, the next call to getRelationships will reflect those changes.

Returns:
All matching relationships in the object

getRelationships

Set<RelationshipTuple> getRelationships(org.jrdf.graph.SubjectNode subject,
                                        org.jrdf.graph.PredicateNode predicate,
                                        org.jrdf.graph.ObjectNode object)
Get all matching RELS-EXT and RELS-INT relationships in the object.

Returns results that are accurate for the current state of the object at the time of invocation. Thus, if there is some change to the object that changes the set of relationships contained within, the next call to getRelationships will reflect those changes.

Parameters:
subject - Subject of the relationship, or null if unspecified (will match any).
predicate - Predicate of the relationship, or null if unspecified (will match any).
object - Object (target) of the relationship, or null if unspecified (will match any).
Returns:
All RELS-EXT and RELS-INT relationships in the object

getRelationships

Set<RelationshipTuple> getRelationships(org.jrdf.graph.PredicateNode predicate,
                                        org.jrdf.graph.ObjectNode object)
Get all matching RELS-EXT relationships in the object, assumes pid is the subject

Returns results that are accurate for the current state of the object at the time of invocation. Thus, if there is some change to the object that changes the set of relationships contained within, the next call to getRelationships will reflect those changes.

Parameters:
predicate - Predicate of the relationship, or null if unspecified (will match any).
object - Object (target) of the relationship, or null if unspecified (will match any).
Returns:
All RELS-EXT and RELS-INT relationships in the object

getContentModels

List<String> getContentModels()
Gets a list of the content models of the object. The strings will be of the format "info:fedora/PID"

Returns:
the content models of the object

hasContentModel

boolean hasContentModel(org.jrdf.graph.ObjectNode contentModel)
Determins whether or not the object have the given uri as a content model.

Parameters:
contentModel - The object node of the content model
Returns:
true if the object have the content model.


Copyright © 2011 DuraSpace. All Rights Reserved.