gov.bnl.gums.configuration
Interface ConfigurationStore

All Known Implementing Classes:
FileConfigurationStore

public interface ConfigurationStore

Encapsulate the logic of retrieving the configuration from where it is stored. This will allow to retrieve the configuration from a File, from a database, or from whenever we will need to.

Author:
Gabriele Carcassi, Jay Packard

Method Summary
 void deleteBackupConfiguration(java.lang.String dateStr)
           
 java.util.Collection getBackupConfigDates()
          Get a list of config files that have been backed up
 boolean isActive()
          Defines whether a configuration can be retrieved from the store.
 boolean isReadOnly()
          Defines whether the configuration can be changed or not.
 Configuration restoreConfiguration(java.lang.String dateStr)
          Restores configuration in memory.
 Configuration retrieveConfiguration()
          Loads the configuration in memory.
 void setConfiguration(Configuration conf, boolean backupCopy)
          Set and store the configuration.
 

Method Detail

deleteBackupConfiguration

void deleteBackupConfiguration(java.lang.String dateStr)

isActive

boolean isActive()
Defines whether a configuration can be retrieved from the store. This should only check whether configuration information is accessible, not if it is inconsistent. For example, it should check whether the configuration file is present, not if contains valid information.

Returns:
true if the store is configured correctly.

isReadOnly

boolean isReadOnly()
Defines whether the configuration can be changed or not.

Returns:
true if storeConfiguration is allowed.

getBackupConfigDates

java.util.Collection getBackupConfigDates()
Get a list of config files that have been backed up

Returns:
collection of date strings.

retrieveConfiguration

Configuration retrieveConfiguration()
                                    throws java.lang.RuntimeException
Loads the configuration in memory. If the configuration cannot be loaded due to an inconsistency in the store, it should throw an exception.

Returns:
A configuration object.
Throws:
java.lang.RuntimeException

restoreConfiguration

Configuration restoreConfiguration(java.lang.String dateStr)
                                   throws java.lang.RuntimeException
Restores configuration in memory. If the configuration cannot be loaded due to an inconsistency in the store, it should throw an exception.

Returns:
A configuration object.
Throws:
java.lang.RuntimeException

setConfiguration

void setConfiguration(Configuration conf,
                      boolean backupCopy)
                      throws java.lang.Exception
Set and store the configuration.

Parameters:
conf -
Throws:
java.lang.Exception


Copyright © 2004-2008. All Rights Reserved.