eu.planets_project.ifr.core.storage.api
Class DigitalObjectManagerBase

java.lang.Object
  extended by eu.planets_project.ifr.core.storage.api.DigitalObjectManagerBase
All Implemented Interfaces:
DigitalObjectManager

public abstract class DigitalObjectManagerBase
extends java.lang.Object
implements DigitalObjectManager


Nested Class Summary
 
Nested classes/interfaces inherited from interface eu.planets_project.ifr.core.storage.api.DigitalObjectManager
DigitalObjectManager.DigitalObjectNotFoundException, DigitalObjectManager.DigitalObjectNotRemovedException, DigitalObjectManager.DigitalObjectNotStoredException, DigitalObjectManager.DigitalObjectTooLargeException, DigitalObjectManager.DigitalObjectUpdateException
 
Field Summary
static java.lang.String DESC_KEY
          Public static for the property name used to describe an instance
static java.lang.String NAME_KEY
          Public static for the property name used to name an instance
 
Method Summary
 java.lang.String getDescription()
           
 java.net.URI getId()
          Getter for the URI identifier
 java.lang.String getName()
          Getter for the String name
 java.util.List<java.lang.Class<? extends Query>> getQueryTypes()
           
 boolean isWritable(java.net.URI pdURI)
          Test if Digital Objects can be persisted.
abstract  java.util.List<java.net.URI> list(java.net.URI pdURI)
          Returns the URIs of Digital Objects matching the given parent pdURI.
 java.util.List<java.net.URI> list(java.net.URI pdURI, Query q)
          Execute a more complex query, at some point in the URI tree.
 DigitalObject retrieve(java.net.URI pdURI)
          Retrieve a DigitalObject from the DataRegistry.
 java.net.URI storeAsNew(DigitalObject digitalObject)
          Persist a DigitalObject to the Data Registry as a new object
 java.net.URI storeAsNew(java.net.URI pdURI, DigitalObject digitalObject)
          Persist a DigitalObject to the Data Registry as a new object, associated the suggested URI if possible.
 java.net.URI updateExisting(java.net.URI pdURI, DigitalObject digitalObject)
          Updates an existing object in the repository to contain the given digital object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_KEY

public static final java.lang.String NAME_KEY
Public static for the property name used to name an instance

See Also:
Constant Field Values

DESC_KEY

public static final java.lang.String DESC_KEY
Public static for the property name used to describe an instance

See Also:
Constant Field Values
Method Detail

getQueryTypes

public java.util.List<java.lang.Class<? extends Query>> getQueryTypes()
Specified by:
getQueryTypes in interface DigitalObjectManager
Returns:
An array of the types of query that are supported. If your interface does not support queries, please return null.

isWritable

public boolean isWritable(java.net.URI pdURI)
Description copied from interface: DigitalObjectManager
Test if Digital Objects can be persisted.

Specified by:
isWritable in interface DigitalObjectManager
Parameters:
pdURI - The URI that we wish to write to, or NULL to test if the whole repository is read-only.
Returns:
false if the 'store' method should work for this URI. If the whole DOM is a read-only system, then return false when pdURI == NULL. If some parts are writable, return true when pdURI == NULL.

list

public abstract java.util.List<java.net.URI> list(java.net.URI pdURI)
Description copied from interface: DigitalObjectManager
Returns the URIs of Digital Objects matching the given parent pdURI. If the pdURI points to a 'file' (A Digital Object) then this should return null. If the pdURI points to a 'directory', then this should return a valid List object, with zero or more entries. If the Query has been set, only return matching Digital Objects.

Specified by:
list in interface DigitalObjectManager
Parameters:
pdURI - URI that identifies an Digital Object or folder
Returns:
an array of all child URIs. Empty folders return an empty list, and files return null.

list

public java.util.List<java.net.URI> list(java.net.URI pdURI,
                                         Query q)
                                  throws QueryValidationException
Description copied from interface: DigitalObjectManager
Execute a more complex query, at some point in the URI tree. If the query does not make sense, throw an exception. Ideally, include a message in said exception that can be shown to the user so that they might improve their query.

Specified by:
list in interface DigitalObjectManager
Parameters:
pdURI - The URI in the repository at which the query should be executed. Can be null, meaning at the top-level.
q - The Query to be executed.
Returns:
the List of Digital Object URIs that matched the query
Throws:
QueryValidationException

retrieve

public DigitalObject retrieve(java.net.URI pdURI)
                       throws DigitalObjectManager.DigitalObjectNotFoundException
Description copied from interface: DigitalObjectManager
Retrieve a DigitalObject from the DataRegistry. Implementations of this method are currently expected to set the Title of the DigitalObject to a sensible filename, as this information may be used to write the data to temporary storage systems. TODO Perhaps remove the above, as persisted files should really use the leafname from the URI?

Specified by:
retrieve in interface DigitalObjectManager
Parameters:
pdURI - URI that uniquely identifies the DigitalObject
Returns:
the DigitalObject retrieved from the registry
Throws:
DigitalObjectManager.DigitalObjectNotFoundException - If the digital object with this URI is not found in the repository

storeAsNew

public java.net.URI storeAsNew(DigitalObject digitalObject)
                        throws DigitalObjectManager.DigitalObjectNotStoredException
Description copied from interface: DigitalObjectManager
Persist a DigitalObject to the Data Registry as a new object

Specified by:
storeAsNew in interface DigitalObjectManager
Parameters:
digitalObject - The object to store
Returns:
the pdURI where the object was stored.
Throws:
DigitalObjectManager.DigitalObjectNotStoredException - if the storing somehow failed

storeAsNew

public java.net.URI storeAsNew(java.net.URI pdURI,
                               DigitalObject digitalObject)
                        throws DigitalObjectManager.DigitalObjectNotStoredException
Description copied from interface: DigitalObjectManager
Persist a DigitalObject to the Data Registry as a new object, associated the suggested URI if possible. If a particular implementation does not permit the caller to dictate the store layout, the URI may be overridden. Consequently, the returned URI should be retained as the object reference, not the passed one.

Specified by:
storeAsNew in interface DigitalObjectManager
Parameters:
pdURI - The suggested URI to associate with the stored object.
digitalObject - The object to store.
Returns:
the pdURI A URI associated with the newly-stored object and which could be used to recover it via the .read(URI) method.
Throws:
DigitalObjectManager.DigitalObjectNotStoredException - if the storing somehow failed

updateExisting

public java.net.URI updateExisting(java.net.URI pdURI,
                                   DigitalObject digitalObject)
                            throws DigitalObjectManager.DigitalObjectNotStoredException,
                                   DigitalObjectManager.DigitalObjectNotFoundException
Description copied from interface: DigitalObjectManager
Updates an existing object in the repository to contain the given digital object. The repository might create a new object for the new version. This method returns the uri of the updated object.

Specified by:
updateExisting in interface DigitalObjectManager
Parameters:
pdURI - the object to update
digitalObject - the information to update with
Returns:
the id of the updated object
Throws:
DigitalObjectManager.DigitalObjectNotStoredException - if the storing somehow failed
DigitalObjectManager.DigitalObjectNotFoundException

getName

public java.lang.String getName()
Getter for the String name

Returns:
the name of the DOM

getId

public java.net.URI getId()
Getter for the URI identifier

Returns:
the URI identifier

getDescription

public java.lang.String getDescription()
Returns:
the String description


Copyright © 2007-2010 The Planets Consortium. All Rights Reserved.