uk.org.ogsadai.service.resource.config
Class FileBasedDSRComponentFactory

java.lang.Object
  |
  +--uk.org.ogsadai.service.resource.config.FileBasedDSRComponentFactory
All Implemented Interfaces:
DSRComponentFactory

public class FileBasedDSRComponentFactory
extends java.lang.Object
implements DSRComponentFactory

Creates the components required to build a data service resource by reading configuration details from files.

Author:
OGSA-DAI team

Field Summary
protected  java.lang.String ACTIVITY_CONFIG_FILENAME
          Name of activity configuration file
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
protected  java.io.File mResourceConfigDir
          Configuration directory for this resource
protected  java.lang.Object mResourceId
          ID of the data service resource
protected  java.lang.String SESSION_CONFIG_FILENAME
          Name of session configuration file
 
Constructor Summary
FileBasedDSRComponentFactory(java.lang.Object id, java.io.File topLevelConfigDir)
          Creates a data service resource component factory that will read configuration files correspoding to the specified resource ID.
 
Method Summary
 ActivitiesConfig getActivityConfiguration()
          Gets the activities configuration details for the data service resource.
 DataResourceAccessor getDataResourceAccessor()
          Gets the data resource accessor for the data service resource.
 SessionComponentFactory getSessionComponentFactory()
          Gets the sessions component factory that can be used to create the session componets to be used with the data service resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

ACTIVITY_CONFIG_FILENAME

protected final java.lang.String ACTIVITY_CONFIG_FILENAME
Name of activity configuration file

See Also:
Constant Field Values

SESSION_CONFIG_FILENAME

protected final java.lang.String SESSION_CONFIG_FILENAME
Name of session configuration file

See Also:
Constant Field Values

mResourceId

protected final java.lang.Object mResourceId
ID of the data service resource


mResourceConfigDir

protected final java.io.File mResourceConfigDir
Configuration directory for this resource

Constructor Detail

FileBasedDSRComponentFactory

public FileBasedDSRComponentFactory(java.lang.Object id,
                                    java.io.File topLevelConfigDir)
                             throws DAIDirectoryNotFoundException,
                                    DAIDirectoryNotDirectoryException
Creates a data service resource component factory that will read configuration files correspoding to the specified resource ID. The files to be read will be in a directory with the same name as the resource within the specified top level directory.

Parameters:
id - Name of the data service resource to create the compnents for.
topLevelConfigDir - Top level configuration directory. This directory should contain a sub-directory with the same name as the resource.
Throws:
DAIDirectoryNotFoundException - if either the specifed top level directory or the resource specific sub-directory cannot be found.
DAIDirectoryNotDirectoryException - if either the specifed top level directory or the resource specific sub-directory is not a directory.
java.lang.IllegalArgumentException - if either of the arguments are null.
Method Detail

getActivityConfiguration

public ActivitiesConfig getActivityConfiguration()
                                          throws DAIException
Gets the activities configuration details for the data service resource.

Specified by:
getActivityConfiguration in interface DSRComponentFactory
Returns:
The activity configuration details.
Throws:
DAIException - if there is an error reading the configuration.

getDataResourceAccessor

public DataResourceAccessor getDataResourceAccessor()
                                             throws DAIException
Gets the data resource accessor for the data service resource.

Specified by:
getDataResourceAccessor in interface DSRComponentFactory
Returns:
The data resource accessor.
Throws:
DAIException - If there is an error creating the activity configuration.

getSessionComponentFactory

public SessionComponentFactory getSessionComponentFactory()
                                                   throws DAIException
Gets the sessions component factory that can be used to create the session componets to be used with the data service resource.

Specified by:
getSessionComponentFactory in interface DSRComponentFactory
Returns:
The session component factory.
Throws:
DAIException - If there is an error creating the session coordinator.