uk.org.ogsadai.dataresource
Interface PersistInFiles

All Known Implementing Classes:
DemoFactoryDataResourceAccessor, DemoInstanceDataResourceAccessor, DemoTransientFactoryDataResourceAccessor, FilesDataResourceAccessor, JDBCDataResourceAccessor, SQLMultipleDataResourceAccessor, TemperatureDataResourceAccessor, TestDataResourceAccessor, XMLDBDataResourceAccessor

public interface PersistInFiles

Plug-in interface for data resource accessors whose configuration is to be read from a set of configutation files.

Author:
OGSA-DAI team

Method Summary
 void restoreFromConfig(java.io.File directory)
          Configures the data resource accessor by reading any relevant configuration files in the given directory.
 

Method Detail

restoreFromConfig

public void restoreFromConfig(java.io.File directory)
                       throws DataResourceAccessorConfigException,
                              DataResourceAccessorMetaDataException,
                              DataResourceAccessorSetupException,
                              java.lang.IllegalArgumentException
Configures the data resource accessor by reading any relevant configuration files in the given directory.

If a data service resource is being constructed by reading from a configuration file this method will be called once immediately after the setName method is called. The data resource accessor should read its configuration from the files in the given directory of the data service resource which uses it.

Data resource accessors are free to add, amend or delete files in the given directory at any time throughout their lifetime. The exception to this rule is the dataResourceClassConfig.xml file which must be left unaltered since this specifies the data resource accessor class name.

Parameters:
directory - Directory containing the data service resource configuration files. This includes the data resource accessor configuration files.
Throws:
DataResourceAccessorConfigException - if an error occurs reading the configuration files.
DataResourceAccessorMetaDataException - if an error occurs when constructing data resource accessor meta data properties.
DataResourceAccessorSetupException - if an error occurs when setting up the data resource accessor after having read the configuration files.
java.lang.IllegalArgumentException - if the directory argument is null or is not a directory.