DOPs Framework 1.0 alpha

net.dops_framework.core
Interface DOStorage


public interface DOStorage

An abstraction over a digital object repository (as far as storage is concerned). DOPs implementation uses this interface to interact with the underlying storage layer in order to provide repository-independent digital object type-conformance.

Version:
$Id: DOStorage.java,v 1.2 2007/03/07 14:37:09 saiko Exp $
Author:
Kostas Saidis (saikos [at] gmail [dot] com)

Method Summary
 String addNewDO(String dopId)
          Adds / ingests a new (empty) digital object.
 boolean attributeExists(String doId, String attrId)
          Returns true if the given attribute exists in the underlying stored digital object.
 String getDOPId(String doId)
          Returns the DOP identifier of the given digital object.
 long getStreamLength(String doId, String streamId)
          Returns the length of the given digital object's stream in bytes.
 String getStreamMIMEType(String doId, String streamId)
          Returns the MIME type of the given digital object's stream.
 String getStreamURL(String doId, String streamId)
          Returns the URL of the given digital object's stream.
 MultilingualValue[] loadMetadataSet(String doId, String mdSetId)
          Loads the values of the fields contained in the given digital object's metadata set.
 String[] loadRelationMembers(String doId, String relId)
          Loads the members of the given digital object's relation context.
 InputStream loadStreamContent(String doId, String streamId)
          Returns an InputStream to the content of the given digital object's stream.
 void saveMetadataSet(String doId, String mdSetId, MultilingualValue[] fieldValues)
          Stores the supplied field values to the given digital object's metadata set.
 void saveRelationMembers(String doId, String relId, String[] ids)
          Stores the members of the given digital object's relation context.
 void saveStreamContent(String doId, String streamId, InputStream is, String mimeType)
          Stores the contents of the supplied InputStream to the given object's stream attribute.
 void saveStreamURL(String doId, String streamId, String url)
          Stores the given URL to the given object's stream attribute.
 

Method Detail

attributeExists

boolean attributeExists(String doId,
                        String attrId)
                        throws DOStorageException
Returns true if the given attribute exists in the underlying stored digital object.

Parameters:
doId - the digital object identifier
attrId - the attribute's identifier
Throws:
DOStorageException

loadMetadataSet

MultilingualValue[] loadMetadataSet(String doId,
                                    String mdSetId)
                                    throws DOStorageException
Loads the values of the fields contained in the given digital object's metadata set.

Parameters:
doId - the digital object identifier
mdSetId - the metadata set identifier
Throws:
DOStorageException - if an underlying storage error occurs
See Also:
MultilingualValue

saveMetadataSet

void saveMetadataSet(String doId,
                     String mdSetId,
                     MultilingualValue[] fieldValues)
                     throws DOStorageException
Stores the supplied field values to the given digital object's metadata set.

Parameters:
doId - the digital object identifier
mdSetId - the metadata set identifier
fieldValues - the values of the metadata fields
Throws:
DOStorageException - if an underlying storage error occurs
See Also:
MultilingualValue

saveStreamContent

void saveStreamContent(String doId,
                       String streamId,
                       InputStream is,
                       String mimeType)
                       throws DOStorageException
Stores the contents of the supplied InputStream to the given object's stream attribute.

Parameters:
doId - the digital object identifier
streamId - the stream identifier
is - the input stream containing the actual digital content
mimeType - the MIME type of digital content
Throws:
DOStorageException - if an underlying storage error occurs

saveStreamURL

void saveStreamURL(String doId,
                   String streamId,
                   String url)
                   throws DOStorageException
Stores the given URL to the given object's stream attribute.

Parameters:
doId - the digital object identifier
streamId - the stream identifier
url - a String representation of the URL
Throws:
DOStorageException - if an underlying storage error occurs

addNewDO

String addNewDO(String dopId)
                throws DOStorageException
Adds / ingests a new (empty) digital object. The new object will be assigned to the supplied prototype.

Parameters:
dopId - the DOP identifier expressing the type of the newly created digital object
Throws:
DOStorageException - if an underlying storage error occurs

getDOPId

String getDOPId(String doId)
                throws DOStorageException
Returns the DOP identifier of the given digital object.

Parameters:
doId - the digital object identifier
Throws:
DOStorageException - if an underlying storage error occurs

loadRelationMembers

String[] loadRelationMembers(String doId,
                             String relId)
                             throws DOStorageException
Loads the members of the given digital object's relation context.

Parameters:
doId - the digital object identifier
relId - the relation context identifier
Throws:
DOStorageException - if an underlying storage error occurs

saveRelationMembers

void saveRelationMembers(String doId,
                         String relId,
                         String[] ids)
                         throws DOStorageException
Stores the members of the given digital object's relation context.

Parameters:
doId - the digital object identifier
relId - the relation context identifier
ids - a String array containing the identifiers of the member objects
Throws:
DOStorageException - if an underlying storage error occurs

loadStreamContent

InputStream loadStreamContent(String doId,
                              String streamId)
                              throws DOStorageException
Returns an InputStream to the content of the given digital object's stream.

Parameters:
doId - the digital object identifier
streamId - the stream identifier
Throws:
DOStorageException - if an underlying storage error occurs

getStreamURL

String getStreamURL(String doId,
                    String streamId)
                    throws DOStorageException
Returns the URL of the given digital object's stream.

Parameters:
doId - the digital object identifier
streamId - the stream identifier
Throws:
DOStorageException - if an underlying storage error occurs

getStreamMIMEType

String getStreamMIMEType(String doId,
                         String streamId)
                         throws DOStorageException
Returns the MIME type of the given digital object's stream.

Parameters:
doId - the digital object identifier
streamId - the stream identifier
Throws:
DOStorageException - if an underlying storage error occurs

getStreamLength

long getStreamLength(String doId,
                     String streamId)
                     throws DOStorageException
Returns the length of the given digital object's stream in bytes.

Parameters:
doId - the digital object identifier
streamId - the stream identifier
Throws:
DOStorageException - if an underlying storage error occurs

Copyright (c) 2005-2007, Kostas Saidis.
Consult the license for terms and conditions of use.