public final class ConcreteStorageProxy extends java.lang.Object implements StorageProxy
Constructor and Description |
---|
ConcreteStorageProxy(Storage storage,
java.lang.String repositoryID,
java.lang.String objectID,
HeaderSet txnMetadata)
Construct a storage accessor/proxy object that uses the given
storage mechanism and restricts access to the given objectID based
on the permissions granted to the given callerIDs.
|
Modifier and Type | Method and Description |
---|---|
void |
appendDataElement(java.lang.String elementID,
java.io.InputStream input)
Appends the bytes from the given input stream to the given data element
for the object.
|
java.lang.String |
createObject(java.lang.String newObjectID)
Creates a new digital object with the given ID, if one does not already exist.
|
java.lang.String |
createObject(java.lang.String newObjectID,
java.lang.String newObjectName)
Creates a new digital object with the given ID, if one does not already exist.
|
void |
deleteAttributes(java.lang.String[] attributeKeys)
Remove the attributes with the given keys from the object.
|
boolean |
deleteDataElement(java.lang.String elementID)
Deletes the specified data element from the current object.
|
void |
deleteElementAttributes(java.lang.String elementID,
java.lang.String[] attributeKeys)
Remove the attributes with the given keys from the element.
|
void |
deleteObject()
Deletes the digital object along with all data elements or files that are associated
with it.
|
void |
deserializeObject(java.lang.String format,
java.io.InputStream in)
Reset the object's state and re-initialize it with the data in the
given InputStream in the given format.
|
boolean |
doesDataElementExist(java.lang.String elementID)
Returns true if the given data element exists
|
boolean |
doesObjectExist()
Returns true if the given digital object exists.
|
HeaderSet |
getAttributes(HeaderSet container)
Get all of the key-value attributes that are associated with the object.
|
java.io.InputStream |
getDataElement(java.lang.String elementID)
Returns the identified data element for this object.
|
HeaderSet |
getElementAttributes(java.lang.String elementID,
HeaderSet container)
Get all of the key-value attributes that are associated with the given
element in the object.
|
java.io.File |
getFileForDataElement(java.lang.String elementID)
Returns the File in which the given data element is stored, if any.
|
StorageProxy |
getObjectAccessor(java.lang.String objectID)
Returns a StorageProxy for a different object in this Repository.
|
java.lang.String |
getObjectID()
Get the object identifier of the given object.
|
java.lang.String |
getRepoID()
Get the repository identifier of the repository for the given object.
|
java.util.Enumeration |
listDataElements()
Returns a list of the data elements associated with the current object.
|
java.util.Enumeration |
listObjects()
Returns an Enumeration of all of the objects in the repository.
|
void |
serializeObject(java.lang.String format,
java.io.OutputStream out)
Serialize the entire object using the given format to the given stream
|
void |
setAttributes(HeaderSet attributes)
Set the given key-value attributes in the object, replacing any existing
attributes that have the same keys.
|
void |
setElementAttributes(java.lang.String elementID,
HeaderSet attributes)
Set the given key-value attributes for the given element in the object,
replacing any existing attributes that have the same keys.
|
void |
storeDataElement(java.lang.String elementID,
java.io.InputStream input)
Stores the bytes from the given input stream into the given data element
for the object.
|
public ConcreteStorageProxy(Storage storage, java.lang.String repositoryID, java.lang.String objectID, HeaderSet txnMetadata)
public java.lang.String getObjectID()
getObjectID
in interface StorageProxy
public java.lang.String getRepoID()
getRepoID
in interface StorageProxy
public StorageProxy getObjectAccessor(java.lang.String objectID)
getObjectAccessor
in interface StorageProxy
public boolean doesObjectExist() throws DOException
doesObjectExist
in interface StorageProxy
DOException
public boolean doesDataElementExist(java.lang.String elementID) throws DOException
doesDataElementExist
in interface StorageProxy
DOException
public java.io.File getFileForDataElement(java.lang.String elementID) throws DOException
getFileForDataElement
in interface StorageProxy
DOException
public java.lang.String createObject(java.lang.String newObjectID) throws DOException
createObject
in interface StorageProxy
DOException
public void deleteObject() throws DOException
deleteObject
in interface StorageProxy
DOException
public java.lang.String createObject(java.lang.String newObjectID, java.lang.String newObjectName) throws DOException
createObject
in interface StorageProxy
DOException
public java.util.Enumeration listObjects() throws DOException
listObjects
in interface StorageProxy
DOException
public java.util.Enumeration listDataElements() throws DOException
listDataElements
in interface StorageProxy
DOException
public java.io.InputStream getDataElement(java.lang.String elementID) throws DOException
getDataElement
in interface StorageProxy
DOException
public void storeDataElement(java.lang.String elementID, java.io.InputStream input) throws java.lang.Exception
storeDataElement
in interface StorageProxy
java.lang.Exception
public void appendDataElement(java.lang.String elementID, java.io.InputStream input) throws java.lang.Exception
appendDataElement
in interface StorageProxy
java.lang.Exception
public boolean deleteDataElement(java.lang.String elementID) throws DOException
deleteDataElement
in interface StorageProxy
DOException
public HeaderSet getAttributes(HeaderSet container) throws DOException
getAttributes
in interface StorageProxy
DOException
public HeaderSet getElementAttributes(java.lang.String elementID, HeaderSet container) throws DOException
getElementAttributes
in interface StorageProxy
DOException
public void setAttributes(HeaderSet attributes) throws DOException
setAttributes
in interface StorageProxy
DOException
public void setElementAttributes(java.lang.String elementID, HeaderSet attributes) throws DOException
setElementAttributes
in interface StorageProxy
DOException
public void deleteAttributes(java.lang.String[] attributeKeys) throws DOException
deleteAttributes
in interface StorageProxy
DOException
public void deleteElementAttributes(java.lang.String elementID, java.lang.String[] attributeKeys) throws DOException
deleteElementAttributes
in interface StorageProxy
DOException
public void serializeObject(java.lang.String format, java.io.OutputStream out) throws DOException
serializeObject
in interface StorageProxy
DOException
public void deserializeObject(java.lang.String format, java.io.InputStream in) throws DOException
deserializeObject
in interface StorageProxy
DOException