fedora.server.access
Class DynamicAccessModule

java.lang.Object
  extended by fedora.server.Parameterized
      extended by fedora.server.Pluggable
          extended by fedora.server.Module
              extended by fedora.server.access.DynamicAccessModule
All Implemented Interfaces:
Constants, Access

public class DynamicAccessModule
extends Module
implements Access

Title: DynamicAccessModule.java

Description: Module Wrapper for DynamicAccessImpl.java. The Dynamic Access module will associate dynamic disseminators with the a digital object. It will look to the Fedora repository configuration file to obtain a list of dynamic disseminators. Currently, the system supports two types of dynamic disseminators: - Default (BDefPID=fedora-system:3 and BMechPID=fedora-system:4) - Bootstrap (BDefPID=fedora-system:1 and BMechPID=fedora-system:2). The Default disseminator that is associated with every object in the repository. The Default Disseminator endows the objects with a set of basic generic behaviors that enable a simplistic view of the object contents (the Item Index) and a list of all disseminations available on the object (the Dissemination Index). The Bootstrap disseminator is associated with every behavior definition and behavior mechanism object. It defines methods to get the special metadata datastreams out of them, and some other methods. (NOTE: The Bootstrap Disseminator functionality is NOT YET IMPLEMENTED.

Version:
$Id: DynamicAccessModule.java 5218 2006-11-20 05:10:11Z cwilper $
Author:
payette@cs.cornell.edu

Nested Class Summary
 
Nested classes/interfaces inherited from interface fedora.common.Constants
Constants.FedoraHome
 
Field Summary
 
Fields inherited from interface fedora.common.Constants
ACTION, BDEF, BMECH, DATASTREAM, DC, DISSEMINATOR, ENVIRONMENT, FEDORA, FEDORA_HOME, FEDORA_SYSTEM_DEF_PID, FEDORA_SYSTEM_DEF_URI, HTTP_REQUEST, MODEL, OBJECT, RDF, RECOVERY, RELS_EXT, RESOURCE, SUBJECT, TUCANA, VIEW, XSD
 
Constructor Summary
DynamicAccessModule(java.util.Map moduleParameters, Server server, java.lang.String role)
          Creates and initializes the Dynmamic Access Module.
 
Method Summary
 RepositoryInfo describeRepository(Context context)
          Gets information that describes the repository.
 FieldSearchResult findObjects(Context context, java.lang.String[] resultFields, int maxResults, FieldSearchQuery query)
          Lists the specified fields of each object matching the given criteria.
 java.lang.String[] getBehaviorDefinitions(Context context, java.lang.String PID, java.util.Date asOfDateTime)
          Get a list of behavior definition identifiers for dynamic disseminators associated with the digital object.
 MethodDef[] getBehaviorMethods(Context context, java.lang.String PID, java.lang.String bDefPID, java.util.Date asOfDateTime)
          Get the behavior method defintions for a given dynamic disseminator that is associated with the digital object.
 MIMETypedStream getBehaviorMethodsXML(Context context, java.lang.String PID, java.lang.String bDefPID, java.util.Date asOfDateTime)
          Get an XML encoding of the behavior defintions for a given dynamic disseminator that is associated with the digital object.
 MIMETypedStream getDatastreamDissemination(Context context, java.lang.String PID, java.lang.String dsID, java.util.Date asOfDateTime)
           
 MIMETypedStream getDissemination(Context context, java.lang.String PID, java.lang.String bDefPID, java.lang.String methodName, Property[] userParms, java.util.Date asOfDateTime)
          Perform a dissemination for a behavior method that belongs to a dynamic disseminator that is associate with the digital object.
 java.lang.String[] getObjectHistory(Context context, java.lang.String PID)
          Gets the change history of an object by returning a list of timestamps that correspond to modification dates of components.
 ObjectProfile getObjectProfile(Context context, java.lang.String PID, java.util.Date asOfDateTime)
          Get the profile information for the digital object.
protected  boolean isDynamicBehaviorDefinition(Context context, java.lang.String PID, java.lang.String bDefPID)
           
 DatastreamDef[] listDatastreams(Context context, java.lang.String PID, java.util.Date asOfDateTime)
           
 ObjectMethodsDef[] listMethods(Context context, java.lang.String PID, java.util.Date asOfDateTime)
          Get the definitions for all dynamic disseminations on the object.
 void postInitModule()
          Second stage of Module initialization.
 FieldSearchResult resumeFindObjects(Context context, java.lang.String sessionToken)
          Resumes an in-progress listing of object fields.
 
Methods inherited from class fedora.server.Module
getRole, getServer, initModule, shutdownModule
 
Methods inherited from class fedora.server.Pluggable
getHelp, getOptionalParameters, getParameterHelp, getRequiredModuleRoles, getRequiredParameters
 
Methods inherited from class fedora.server.Parameterized
getParameter, getParameter, getParameters, parameterNames, setParameter, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicAccessModule

public DynamicAccessModule(java.util.Map moduleParameters,
                           Server server,
                           java.lang.String role)
                    throws ModuleInitializationException

Creates and initializes the Dynmamic Access Module. When the server is starting up, this is invoked as part of the initialization process.

Parameters:
moduleParameters - A pre-loaded Map of name-value pairs comprising the intended configuration of this Module.
server - The Server instance.
role - The role this module fulfills, a java class name.
Throws:
ModuleInitializationException - If initilization values are invalid or initialization fails for some other reason.
Method Detail

postInitModule

public void postInitModule()
                    throws ModuleInitializationException
Description copied from class: Module
Second stage of Module initialization. This is guaranteed to run after all Module's initModule() methods have run.

Overrides:
postInitModule in class Module
Throws:
ModuleInitializationException - If initialization values are invalid or initialization fails for some other reason.

getBehaviorDefinitions

public java.lang.String[] getBehaviorDefinitions(Context context,
                                                 java.lang.String PID,
                                                 java.util.Date asOfDateTime)
                                          throws ServerException
Get a list of behavior definition identifiers for dynamic disseminators associated with the digital object.

Parameters:
context -
PID - identifier of digital object being reflected upon
asOfDateTime -
Returns:
an array of behavior definition PIDs
Throws:
ServerException

getBehaviorMethods

public MethodDef[] getBehaviorMethods(Context context,
                                      java.lang.String PID,
                                      java.lang.String bDefPID,
                                      java.util.Date asOfDateTime)
                               throws ServerException
Get the behavior method defintions for a given dynamic disseminator that is associated with the digital object. The dynamic disseminator is identified by the bDefPID.

Parameters:
context -
PID - identifier of digital object being reflected upon
bDefPID - identifier of dynamic behavior definition
asOfDateTime -
Returns:
an array of method definitions
Throws:
ServerException

getBehaviorMethodsXML

public MIMETypedStream getBehaviorMethodsXML(Context context,
                                             java.lang.String PID,
                                             java.lang.String bDefPID,
                                             java.util.Date asOfDateTime)
                                      throws ServerException
Get an XML encoding of the behavior defintions for a given dynamic disseminator that is associated with the digital object. The dynamic disseminator is identified by the bDefPID.

Parameters:
context -
PID - identifier of digital object being reflected upon
bDefPID - identifier of dynamic behavior definition
asOfDateTime -
Returns:
MIME-typed stream containing XML-encoded method definitions
Throws:
ServerException

getDatastreamDissemination

public MIMETypedStream getDatastreamDissemination(Context context,
                                                  java.lang.String PID,
                                                  java.lang.String dsID,
                                                  java.util.Date asOfDateTime)
                                           throws ServerException
Specified by:
getDatastreamDissemination in interface Access
Throws:
ServerException

getDissemination

public MIMETypedStream getDissemination(Context context,
                                        java.lang.String PID,
                                        java.lang.String bDefPID,
                                        java.lang.String methodName,
                                        Property[] userParms,
                                        java.util.Date asOfDateTime)
                                 throws ServerException
Perform a dissemination for a behavior method that belongs to a dynamic disseminator that is associate with the digital object. The method belongs to the dynamic behavior definition and is implemented by a dynamic behavior mechanism (which is an internal service in the repository access subsystem).

Specified by:
getDissemination in interface Access
Parameters:
context -
PID - identifier of the digital object being disseminated
bDefPID - identifier of dynamic behavior definition
methodName -
userParms -
asOfDateTime -
Returns:
a MIME-typed stream containing the dissemination result
Throws:
ServerException

listMethods

public ObjectMethodsDef[] listMethods(Context context,
                                      java.lang.String PID,
                                      java.util.Date asOfDateTime)
                               throws ServerException
Get the definitions for all dynamic disseminations on the object. This will return the method definitions for all methods for all of the dynamic disseminators associated with the object.

Specified by:
listMethods in interface Access
Parameters:
context -
PID - identifier of digital object being reflected upon
asOfDateTime -
Returns:
an array of object method definitions
Throws:
ServerException

getObjectProfile

public ObjectProfile getObjectProfile(Context context,
                                      java.lang.String PID,
                                      java.util.Date asOfDateTime)
                               throws ServerException
Get the profile information for the digital object. This contain key metadata and URLs for the Dissemination Index and Item Index of the object.

Specified by:
getObjectProfile in interface Access
Parameters:
context -
PID - identifier of digital object being reflected upon
asOfDateTime -
Returns:
an object profile data structure
Throws:
ServerException

findObjects

public FieldSearchResult findObjects(Context context,
                                     java.lang.String[] resultFields,
                                     int maxResults,
                                     FieldSearchQuery query)
                              throws ServerException
Description copied from interface: Access

Lists the specified fields of each object matching the given criteria.

Specified by:
findObjects in interface Access
Parameters:
context - the context of this request
resultFields - the names of the fields to return
maxResults - the maximum number of results to return at a time
query - the query
Returns:
the specified fields of each object matching the given criteria.
Throws:
ServerException - If any type of error occurred fulfilling the request.

resumeFindObjects

public FieldSearchResult resumeFindObjects(Context context,
                                           java.lang.String sessionToken)
                                    throws ServerException
Description copied from interface: Access

Resumes an in-progress listing of object fields.

Specified by:
resumeFindObjects in interface Access
Parameters:
context - the context of this request
sessionToken - the token of the session in which the remaining results can be obtained
Returns:
the remaining specified fields of each object matching the given criteria.
Throws:
ServerException - If any type of error occurred fulfilling the request.

describeRepository

public RepositoryInfo describeRepository(Context context)
                                  throws ServerException
Description copied from interface: Access

Gets information that describes the repository.

Specified by:
describeRepository in interface Access
Parameters:
context - the context of this request
Returns:
information that describes the repository.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getObjectHistory

public java.lang.String[] getObjectHistory(Context context,
                                           java.lang.String PID)
                                    throws ServerException
Description copied from interface: Access

Gets the change history of an object by returning a list of timestamps that correspond to modification dates of components. This currently includes changes to datastreams and disseminators.

Specified by:
getObjectHistory in interface Access
Parameters:
context - The context of this request.
PID - The persistent identifier of the digitla object.
Returns:
An Array containing the list of timestamps indicating when changes were made to the object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

isDynamicBehaviorDefinition

protected boolean isDynamicBehaviorDefinition(Context context,
                                              java.lang.String PID,
                                              java.lang.String bDefPID)
                                       throws ServerException
Throws:
ServerException

listDatastreams

public DatastreamDef[] listDatastreams(Context context,
                                       java.lang.String PID,
                                       java.util.Date asOfDateTime)
                                throws ServerException
Specified by:
listDatastreams in interface Access
Throws:
ServerException