org.fcrepo.server.storage
Interface DOManager

All Superinterfaces:
RepositoryReader
All Known Implementing Classes:
DefaultDOManager, GSearchDOManager, RebuildDOManager

public interface DOManager
extends RepositoryReader

A RepositoryReader that provides facilities for creating and modifying objects within the repository, as well as a query facility.

Author:
Chris Wilper

Method Summary
 FieldSearchResult findObjects(Context context, String[] resultFields, int maxResults, FieldSearchQuery query)
           
 DOWriter getIngestWriter(boolean cachedObjectRequired, Context context, InputStream in, String format, String encoding, String pid)
          Creates a copy of the digital object given by the InputStream, with either a new PID or the PID indicated by the InputStream.
 String[] getNextPID(int numPIDs, String namespace)
           
 String getRepositoryHash()
          Get a "hash" of the repository.
 DOWriter getWriter(boolean cachedObjectRequired, Context context, String pid)
          Gets a DOWriter for an existing digital object.
 String lookupDeploymentForCModel(String cModelPid, String sDefPid)
           
 boolean objectExists(String pid)
           
 void releaseWriter(DOWriter writer)
          Relinquishes control of a DOWriter back to the DOManager.
 void reservePIDs(String[] pidList)
          Reserve a series of PIDs so that they are never used for subsequent PID generations.
 FieldSearchResult resumeFindObjects(Context context, String sessionToken)
           
 
Methods inherited from interface org.fcrepo.server.storage.RepositoryReader
getReader, getServiceDefinitionReader, getServiceDeploymentReader, listObjectPIDs
 

Method Detail

releaseWriter

void releaseWriter(DOWriter writer)
                   throws ServerException
Relinquishes control of a DOWriter back to the DOManager.

When a DOManager provides a DOWriter, it creates a session lock. This is used to guarantee that there will never be concurrent changes to the same object. To release the session lock, a DOWriter user calls this method.

Parameters:
writer - an instance of a digital object writer.
Throws:
ServerException - if an error occurs in obtaining a writer.

getWriter

DOWriter getWriter(boolean cachedObjectRequired,
                   Context context,
                   String pid)
                   throws ServerException
Gets a DOWriter for an existing digital object.

Parameters:
context - The context of this request.
pid - The PID of the object.
Returns:
A writer, or null if the pid didn't point to an accessible object.
Throws:
ServerException - If anything went wrong.

getIngestWriter

DOWriter getIngestWriter(boolean cachedObjectRequired,
                         Context context,
                         InputStream in,
                         String format,
                         String encoding,
                         String pid)
                         throws ServerException
Creates a copy of the digital object given by the InputStream, with either a new PID or the PID indicated by the InputStream.

Parameters:
context - The context of this request.
in - A serialization of the digital object.
format - The format of the serialization.
encoding - The character encoding.
pid - Whether a new PID should be generated or the one indicated by the InputStream should be used. If set to "new", a new pid will be generated.
Returns:
a writer.
Throws:
ServerException - If anything went wrong.

objectExists

boolean objectExists(String pid)
                     throws StorageDeviceException
Throws:
StorageDeviceException

findObjects

FieldSearchResult findObjects(Context context,
                              String[] resultFields,
                              int maxResults,
                              FieldSearchQuery query)
                              throws ServerException
Throws:
ServerException

resumeFindObjects

FieldSearchResult resumeFindObjects(Context context,
                                    String sessionToken)
                                    throws ServerException
Throws:
ServerException

getNextPID

String[] getNextPID(int numPIDs,
                    String namespace)
                    throws ServerException
Throws:
ServerException

lookupDeploymentForCModel

String lookupDeploymentForCModel(String cModelPid,
                                 String sDefPid)

reservePIDs

void reservePIDs(String[] pidList)
                 throws ServerException
Reserve a series of PIDs so that they are never used for subsequent PID generations.

Throws:
ServerException

getRepositoryHash

String getRepositoryHash()
                         throws ServerException
Get a "hash" of the repository. This value can be compared to a previous value to determine whether the content of the repository has changed. It is not necessary for this value to precisely reflect the state of the repository, but if the repository hasn't changed, subsequent calls should return the same value.

Throws:
ServerException


Copyright © 2012 DuraSpace. All Rights Reserved.