public interface ConfigurationService
The interface of the Configuration service that handles the configuration of the local PEtALS container.
During the execution of methods loadConfiguration(Properties, Topology)
or updateTopology(Topology)
, the other methods are blocked until the end of the configuration and topology loading.
Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_LOGGER_NAME |
static String |
FRACTAL_SRV_ITF_NAME
Name of the server interface of the Fractal component
|
static String |
JAAS_PROPS_FILE |
static String |
MASTER |
static String |
PEER |
static String |
PROPERTY_REGISTRY_MODE |
static String |
SLAVE |
static String |
STANDALONE |
Modifier and Type | Method and Description |
---|---|
void |
addContainerConfiguration(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration addedContainer)
Registers a new container configuration within the local configuration.
|
void |
deregisterContainerConfigurationListener(ContainerConfigurationListener listener)
Deregister a listener on events about remote container configuration of the domain of the current container.
|
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() |
DomainConfiguration |
getDomainConfiguration()
Get the domain configuration the local container belongs to.
|
org.ow2.petals.topology.generated.Topology |
getLocalTopology() |
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). |
boolean |
isSecurityTopologyPassphraseOk(String securityPassPhrase)
Validate the given security topology pass-phrase against the one configured at the current container.
|
void |
loadConfiguration(Properties serverLocalProperties,
org.ow2.petals.topology.generated.Topology topology)
Create the container configuration based on the local topology and server configuration properties.
|
void |
persistTopology(org.ow2.petals.topology.generated.Topology topology)
Persists the given topology in the working area.
|
void |
reconfigureDomain(DomainConfiguration newDomainConfiguration)
Reconfigure the current container and domain with the given domain configuration.
|
void |
registerContainerConfigurationListener(ContainerConfigurationListener listener)
Register a listener on events about remote container configuration of the domain of the current container.
|
void |
removeContainerConfiguration(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration removedContainer)
Unregisters the container within the local configuration.
|
void |
updateTopology(org.ow2.petals.topology.generated.Topology topology)
Update the container configuration according to a topology definition.
|
static final String COMPONENT_LOGGER_NAME
static final String JAAS_PROPS_FILE
static final String PROPERTY_REGISTRY_MODE
static final String STANDALONE
static final String PEER
static final String MASTER
static final String SLAVE
static final String FRACTAL_SRV_ITF_NAME
org.ow2.petals.clientserverapi.configuration.ContainerConfiguration getContainerConfiguration()
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.
Properties getServerProperties()
server.properties
' or equivalent),
including only properties configured (ie. set to a non null
value).null
.Set<org.ow2.petals.clientserverapi.configuration.ContainerConfiguration> getContainersConfiguration()
getContainerConfiguration()
DomainConfiguration getDomainConfiguration()
org.ow2.petals.topology.generated.Topology getLocalTopology()
org.ow2.petals.clientserverapi.configuration.ContainerConfiguration getContainerConfiguration(String containerName)
containerName
- the name of the container to get configuration from. If null, returns the local container
configuration.containerName
, or null
if
not found.void addContainerConfiguration(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration addedContainer) throws InvalidContainerConfigurationProvidedException, ContainerAlreadyExistException, DomainUnknownException
addedContainer
- the container to registerInvalidContainerConfigurationProvidedException
- The container configuration provided (addedContainer
) is invalid.ContainerAlreadyExistException
- The container to add already existsDomainUnknownException
- The domain set in the container configuration is unknown, ie. the container is a member of a unknown
domain.void removeContainerConfiguration(org.ow2.petals.clientserverapi.configuration.ContainerConfiguration removedContainer) throws ContainerDoesNotExistException, InvalidContainerConfigurationProvidedException
Unregisters the container within the local configuration.
The name of the container to remove MUST be defined in removedContainer
otherwise the
exception ContainerDoesNotExistException
will be thrown.
removedContainer
- The container to removeContainerDoesNotExistException
- The container to remove does not existInvalidContainerConfigurationProvidedException
- The container configuration provided (removedContainer
) is invalid.void loadConfiguration(Properties serverLocalProperties, org.ow2.petals.topology.generated.Topology topology) throws MissingServerPropertyException, ConfigurationException
Create the container configuration based on the local topology and server configuration properties. Basic consistency is controlled between the 2 configurations.
Required directories are created when loading the configuration: working area directory.
Note 1: If present into the server configuration properties, the parameter
is ignored, the topology is provided through the parameter 'topology
'.
Note 2: MUST be invoked just after having starting the Configuration service and before any other component starts.
Note 2: If a topology definition exists in the working area, the topology definition '
topology
' is replaced by this persisted topology definition. The persisted topology aims to
persisted topology changes that can not be stored in the topology definition reference because we are not able to
manage all URL scheme.
serverLocalProperties
- The local properties of the current container (ie: the content of 'server.properties' or equivalent).
Can be null
.topology
- The topology configuration. Can not be null
.MissingServerPropertyException
- A server property is missing.ConfigurationException
- Configuration consistency errorvoid updateTopology(org.ow2.petals.topology.generated.Topology topology) throws ConfigurationException
Update the container configuration according to a topology definition. Basic consistency is controlled between the existing topology and the new one.
topology
- The new topology to apply. Can not be null
.ConfigurationException
- Configuration consistency errorvoid reconfigureDomain(DomainConfiguration newDomainConfiguration)
Reconfigure the current container and domain with the given domain configuration.
No checks is done before to reconfigure
newDomainConfiguration
- The new domain configuration to apply to the current domain: must have a domain name set!boolean isSecurityTopologyPassphraseOk(String securityPassPhrase)
securityPassPhrase
- The security topology pass-phrase to check.true
if the security topology pass-phrase is not null, non-empty and validated,
false
otherwise.void registerContainerConfigurationListener(ContainerConfigurationListener listener)
listener
- The listener to registervoid deregisterContainerConfigurationListener(ContainerConfigurationListener listener)
listener
- The listener to deregistervoid persistTopology(org.ow2.petals.topology.generated.Topology topology) throws ConfigurationException
Persists the given topology in the working area.
A such topology will be loaded before to check if a dynamic topology exists in the registry. See
loadConfiguration(Properties, Topology)
.
topology
- The topology to persistConfigurationException
- An error occurs persisting the topology definition.Copyright © 2005-2016 Linagora. All Rights Reserved.