fedora.server.storage
Interface DOManager

All Superinterfaces:
RepositoryReader
All Known Implementing Classes:
DefaultDOManager

public interface DOManager
extends RepositoryReader

Title: DOManager.java

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

Version:
$Id: DOManager.java,v 1.36 2005/04/25 19:29:54 wdn5e Exp $
Author:
cwilper@cs.cornell.edu

Method Summary
 FieldSearchResult findObjects(Context context, java.lang.String[] resultFields, int maxResults, FieldSearchQuery query)
           
 DOWriter getIngestWriter(boolean cachedObjectRequired, Context context, java.io.InputStream in, java.lang.String format, java.lang.String encoding, boolean newPid)
          Creates a copy of the digital object given by the InputStream, with either a new PID or the PID indicated by the InputStream.
 java.lang.String[] getNextPID(int numPIDs, java.lang.String namespace)
           
 DOWriter getWriter(boolean cachedObjectRequired, Context context, java.lang.String pid)
          Gets a DOWriter for an existing digital object.
 void releaseWriter(DOWriter writer)
          Relinquishes control of a DOWriter back to the DOManager.
 FieldSearchResult resumeFindObjects(Context context, java.lang.String sessionToken)
           
 
Methods inherited from interface fedora.server.storage.RepositoryReader
getBDefReader, getBMechReader, getReader, listObjectPIDs
 

Method Detail

releaseWriter

public 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

public DOWriter getWriter(boolean cachedObjectRequired,
                          Context context,
                          java.lang.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

public DOWriter getIngestWriter(boolean cachedObjectRequired,
                                Context context,
                                java.io.InputStream in,
                                java.lang.String format,
                                java.lang.String encoding,
                                boolean newPid)
                         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.
newPid - Whether a new PID should be generated or the one indicated by the InputStream should be used.
Returns:
a writer.
Throws:
ServerException - If anything went wrong.

findObjects

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

resumeFindObjects

public FieldSearchResult resumeFindObjects(Context context,
                                           java.lang.String sessionToken)
                                    throws ServerException
Throws:
ServerException

getNextPID

public java.lang.String[] getNextPID(int numPIDs,
                                     java.lang.String namespace)
                              throws ServerException
Throws:
ServerException