org.apache.geronimo.kernel.config
Interface ConfigurationStore

All Known Implementing Classes:
MavenConfigStore, NullConfigurationStore, RepositoryConfigurationStore

public interface ConfigurationStore

Interface to a store for Configurations.


Method Summary
 boolean containsConfiguration(Artifact configId)
          Determines if the store contains a configuration with the specified ID.
 File createNewConfigurationDir(Artifact configId)
          Creates an empty directory for a new configuration with the specified configId
 void exportConfiguration(Artifact configId, OutputStream output)
          Exports a configuration as a ZIP file.
 AbstractName getAbstractName()
          Return the object name for the store.
 String getObjectName()
          Return the object name for the store.
 void install(ConfigurationData configurationData)
          Move the unpacked configuration directory into this store
 boolean isInPlaceConfiguration(Artifact configId)
          Determines if the identified configuration is an in-place one.
 List listConfigurations()
          Return the configurations in the store
 ConfigurationData loadConfiguration(Artifact configId)
          Loads the specified configuration into the kernel
 Set resolve(Artifact configId, String moduleName, String path)
          Locate the physical locations which match the supplied path in the given artifact/module.
 void uninstall(Artifact configId)
          Removes a configuration from the store
 

Method Detail

isInPlaceConfiguration

boolean isInPlaceConfiguration(Artifact configId)
                               throws NoSuchConfigException,
                                      IOException
Determines if the identified configuration is an in-place one. This means that the configuration store only stores some meta-data and the actual content of the configuration is rooted somewhere else.

Parameters:
configId - the unique ID of the configuration, which must be fully resolved (isResolved() == true)
Returns:
true if the identified configuration is an in-place one.
Throws:
NoSuchConfigException - if the configuration is not contained in the store
IOException - If the store cannot be read.

install

void install(ConfigurationData configurationData)
             throws IOException,
                    InvalidConfigException
Move the unpacked configuration directory into this store

Parameters:
configurationData - the configuration data
Throws:
IOException - if the direcotyr could not be moved into the store
InvalidConfigException - if there is a configuration problem within the source direcotry

uninstall

void uninstall(Artifact configId)
               throws NoSuchConfigException,
                      IOException
Removes a configuration from the store

Parameters:
configId - the id of the configuration to remove, which must be fully resolved (isResolved() == true)
Throws:
NoSuchConfigException - if the configuration is not contained in the store
IOException - if a problem occurs during the removal

loadConfiguration

ConfigurationData loadConfiguration(Artifact configId)
                                    throws NoSuchConfigException,
                                           IOException,
                                           InvalidConfigException
Loads the specified configuration into the kernel

Parameters:
configId - the id of the configuration to load, which must be fully resolved (isResolved() == true)
Returns:
the the configuration object
Throws:
NoSuchConfigException - if the configuration is not contained in the kernel
IOException - if a problem occurs loading the configuration from the store
InvalidConfigException - if the configuration is corrupt

containsConfiguration

boolean containsConfiguration(Artifact configId)
Determines if the store contains a configuration with the specified ID. The configuration need not be loaded or running, this just checks whether the configuration store has the data for it.

Parameters:
configId - the unique ID of the configuration, which must be fully resolved (isResolved() == true)
Returns:
true if the store contains the configuration

getObjectName

String getObjectName()
Return the object name for the store.

Returns:
the object name for the store

getAbstractName

AbstractName getAbstractName()
Return the object name for the store.

Returns:
the object name for the store

listConfigurations

List listConfigurations()
Return the configurations in the store

Returns:
a List (with entries of type ConfigurationInfo) of all the configurations contained in this configuration store

createNewConfigurationDir

File createNewConfigurationDir(Artifact configId)
                               throws ConfigurationAlreadyExistsException
Creates an empty directory for a new configuration with the specified configId

Parameters:
configId - the unique ID of the configuration, which must be fully resolved (isResolved() == true)
Returns:
the location of the new directory
Throws:
ConfigurationAlreadyExistsException - if the configuration already exists in this store

resolve

Set resolve(Artifact configId,
            String moduleName,
            String path)
            throws NoSuchConfigException,
                   MalformedURLException
Locate the physical locations which match the supplied path in the given artifact/module. The path may be an Ant-style pattern.

Parameters:
configId - the artifact to search, which must be fully resolved (isResolved() == true)
moduleName - the module name or null to search in the top-level artifact location
path - the pattern to search for within the artifact/module, which may also be null to identify the artifact or module base path
Returns:
a Set (with entries of type URL) of the matching locations
Throws:
NoSuchConfigException
MalformedURLException

exportConfiguration

void exportConfiguration(Artifact configId,
                         OutputStream output)
                         throws IOException,
                                NoSuchConfigException
Exports a configuration as a ZIP file.

Parameters:
configId - The unique ID of the configuration to export, which must be fully resolved (isResolved() == true)
output - The stream to write the ZIP content to
Throws:
IOException
NoSuchConfigException


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.