org.ow2.petals.microkernel.api.configuration
Interface ConfigurationService


public interface ConfigurationService

The interface of the Configuration service that handles the configuration of the local PEtALS container.

Since:
Petals 2.0
Author:
Roland NAUDIN - EBM WebSourcing, Christophe Hamerling - EBM WebSourcing, Charles Casadei - EBM WebSourcing

Field Summary
static String COMPONENT_LOGGER_NAME
           
static String JAAS_PROPS_FILE
           
static String MASTER
           
static String PEER
           
static String PROPERTY_REGISTRY_MODE
           
static String SLAVE
           
static String STANDALONE
           
 
Method Summary
 void addContainerConfiguration(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration addedContainer)
          Registers a new container configuration within the local configuration.
 void addSubdomainConfiguration(SubDomainConfiguration addedSubdomain)
          Registers a new subdomain within the local topology.
 Map<String,String> getAllServerProperties()
           Get the local server properties (ie. content of the file ' server.properties' or equivalent), including properties not configured (ie. set to a null value).
 org.ow2.petals.clientserverapi.configuration.ContainerConfiguration getContainerConfiguration()
          Get the local container configuration.
 org.ow2.petals.clientserverapi.configuration.ContainerConfiguration getContainerConfiguration(String containerName)
          Get the container configuration.
 Set<org.ow2.petals.clientserverapi.configuration.ContainerConfiguration> getContainersConfiguration()
          Get the containers configuration.
 DomainConfiguration getDomainConfiguration()
          Get the domain configuration the local container belongs to.
 Properties getServerProperties()
           Get the local server properties (ie. content of the file ' server.properties' or equivalent), including only properties configured (ie. set to a non null value).
 SubDomainConfiguration getSubDomainConfiguration()
          Get the sub domain configuration the local container belongs to.
 Set<SubDomainConfiguration> getSubDomainsConfiguration()
          Get the subdomains configuration.
 org.ow2.petals.topology.generated.Topology getTopology()
          Get the current topology.
 void loadConfiguration(Properties serverLocalProperties, org.ow2.petals.topology.generated.Topology topology)
           Create the container configuration based on the topology and server configuration properties.
 void removeContainerConfiguration(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration removedContainer)
          Unregisters the subdomain within the local topology.
 void removeSubdomainConfiguration(String removedSubdomain)
          Unregister a subdomain within the local topology.
 void setContainerState(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration.ContainerState state)
          Set the running state of the local container.
 void validateDynamicTopology()
          Validate the dynamic topology
 void verifyContainerTopology(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration newContainerConfiguration, SubDomainConfiguration newSubDomainConfiguration, DomainConfiguration newDomainConfiguration)
          Verify the given containerConfiguration against the topology configuration.
 

Field Detail

COMPONENT_LOGGER_NAME

static final String COMPONENT_LOGGER_NAME
See Also:
Constant Field Values

JAAS_PROPS_FILE

static final String JAAS_PROPS_FILE
See Also:
Constant Field Values

PROPERTY_REGISTRY_MODE

static final String PROPERTY_REGISTRY_MODE
See Also:
Constant Field Values

STANDALONE

static final String STANDALONE
See Also:
Constant Field Values

PEER

static final String PEER
See Also:
Constant Field Values

MASTER

static final String MASTER
See Also:
Constant Field Values

SLAVE

static final String SLAVE
See Also:
Constant Field Values
Method Detail

getContainerConfiguration

org.ow2.petals.clientserverapi.configuration.ContainerConfiguration getContainerConfiguration()
Get the local container configuration.


getAllServerProperties

Map<String,String> getAllServerProperties()

Get the local server properties (ie. content of the file ' server.properties' or equivalent), including properties not configured (ie. set to a null value).

Note: local server properties are provided as a Map instead of Properties to be able to put null values.


getServerProperties

Properties getServerProperties()

Get the local server properties (ie. content of the file ' server.properties' or equivalent), including only properties configured (ie. set to a non null value).


getContainersConfiguration

Set<org.ow2.petals.clientserverapi.configuration.ContainerConfiguration> getContainersConfiguration()
Get the containers configuration. This only returns the container configuration created at startup from local persisted data.

Returns:

getSubDomainsConfiguration

Set<SubDomainConfiguration> getSubDomainsConfiguration()
Get the subdomains configuration. This only returns the subdomain configuration created at startup from the local persisted data.

Returns:

getSubDomainConfiguration

SubDomainConfiguration getSubDomainConfiguration()
Get the sub domain configuration the local container belongs to.

Returns:

getDomainConfiguration

DomainConfiguration getDomainConfiguration()
Get the domain configuration the local container belongs to.

Returns:

getTopology

org.ow2.petals.topology.generated.Topology getTopology()
                                                       throws ConfigurationException
Get the current topology. This is the topology loaded from configuration files.

Returns:
Throws:
ConfigurationException

setContainerState

void setContainerState(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration.ContainerState state)
Set the running state of the local container.

Parameters:
state - ContainerConfiguration.ContainerState

verifyContainerTopology

void verifyContainerTopology(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration newContainerConfiguration,
                             SubDomainConfiguration newSubDomainConfiguration,
                             DomainConfiguration newDomainConfiguration)
                             throws InconsistentConfigurationException
Verify the given containerConfiguration against the topology configuration.

Parameters:
newContainerConfiguration - The new container configuration
newSubDomainConfiguration - The new sub-domain configuration
newDomainConfiguration - The new domain configuration
Throws:
InconsistentConfigurationException - Inconsistency between the topology configuration and the new container configuration

getContainerConfiguration

org.ow2.petals.clientserverapi.configuration.ContainerConfiguration getContainerConfiguration(String containerName)
Get the container configuration.

Parameters:
containerName - the name of the container to get configuration from. If null, returns the local container configuration.
Returns:

addContainerConfiguration

void addContainerConfiguration(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration addedContainer)
                               throws ConfigurationException
Registers a new container configuration within the local configuration.

Parameters:
addedContainer - the container to be registered
Throws:
ConfigurationException

removeContainerConfiguration

void removeContainerConfiguration(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration removedContainer)
                                  throws ConfigurationException
Unregisters the subdomain within the local topology.

Parameters:
removedContainer -
Throws:
ConfigurationException

addSubdomainConfiguration

void addSubdomainConfiguration(SubDomainConfiguration addedSubdomain)
                               throws ConfigurationException
Registers a new subdomain within the local topology.

Parameters:
addedSubdomain -
Throws:
ConfigurationException

removeSubdomainConfiguration

void removeSubdomainConfiguration(String removedSubdomain)
                                  throws ConfigurationException
Unregister a subdomain within the local topology.

Parameters:
removedSubdomain -
Throws:
ConfigurationException

validateDynamicTopology

void validateDynamicTopology()
                             throws ConfigurationException
Validate the dynamic topology

Throws:
ConfigurationException

loadConfiguration

void loadConfiguration(Properties serverLocalProperties,
                       org.ow2.petals.topology.generated.Topology topology)
                       throws ConfigurationException

Create the container configuration based on the topology and server configuration properties. Basic consistency is controlled between the 2 configurations.

Required directories are created when loading the configuration:



Copyright © 2005-2015 Linagora. All Rights Reserved.