fedora.server.storage
Class DefaultExternalContentManager

java.lang.Object
  extended by fedora.server.Parameterized
      extended by fedora.server.Pluggable
          extended by fedora.server.Module
              extended by fedora.server.storage.DefaultExternalContentManager
All Implemented Interfaces:
Constants, ExternalContentManager

public class DefaultExternalContentManager
extends Module
implements ExternalContentManager

Title: DefaultExternalContentManager.java

Description: Provides a mechanism to obtain external HTTP-accessible content.

Version:
$Id: DefaultExternalContentManager.java 6338 2007-12-05 19:29:11Z rwayland3 $
Author:
rlw@virginia.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
DefaultExternalContentManager(java.util.Map moduleParameters, Server server, java.lang.String role)
           Creates a new DefaultExternalContentManager.
 
Method Summary
 MIMETypedStream getExternalContent(java.lang.String url, Context context)
          A method that reads the contents of the specified URL and returns the result as a MIMETypedStream
 void initModule()
          Initializes the Module based on configuration parameters.
 
Methods inherited from class fedora.server.Module
getRole, getServer, postInitModule, 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

DefaultExternalContentManager

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

Creates a new DefaultExternalContentManager.

Parameters:
moduleParameters - The name/value pair map of module parameters.
server - The server instance.
role - The module role name.
Throws:
ModuleInitializationException - If initialization values are invalid or initialization fails for some other reason.
Method Detail

initModule

public void initModule()
                throws ModuleInitializationException
Initializes the Module based on configuration parameters. The implementation of this method is dependent on the schema used to define the parameter names for the role of fedora.server.storage.DefaultExternalContentManager.

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

getExternalContent

public MIMETypedStream getExternalContent(java.lang.String url,
                                          Context context)
                                   throws GeneralException,
                                          HttpServiceNotFoundException
A method that reads the contents of the specified URL and returns the result as a MIMETypedStream

Specified by:
getExternalContent in interface ExternalContentManager
Parameters:
url - The URL of the external content.
Returns:
A MIME-typed stream.
Throws:
HttpServiceNotFoundException - If the URL connection could not be established.
GeneralException