org.ow2.petals.communication.topology
Class TopologyServiceImpl

java.lang.Object
  extended by org.ow2.petals.communication.topology.TopologyServiceImpl
All Implemented Interfaces:
TopologyService

public class TopologyServiceImpl
extends java.lang.Object
implements TopologyService

The default implementation of the topology service.

Author:
chamerling - eBM WebSourcing

Field Summary
protected  org.ow2.petals.util.LoggingUtil log
          Logger wrapper.
 
Constructor Summary
TopologyServiceImpl()
           
 
Method Summary
 void addContainerConfiguration(ContainerConfiguration addedContainer)
          Add the given container to the topology
 void addSubdomainConfiguration(SubDomainConfiguration addedSubdomain)
          Add a subdomain to the local topology.
 ContainerConfiguration getContainerConfiguration(java.lang.String containerName)
          Get the container configuration of the given container name.
 java.util.Set<ContainerConfiguration> getContainersConfiguration(ContainerConfiguration.ContainerState state)
          Get all the containers where the state is the same than the given one.
 java.util.Set<ContainerConfiguration> getContainersConfigurationsForLocalSubdomain()
          
 DomainConfiguration getDomainConfiguration()
          Get the domain configuration.
 java.util.Set<SubDomainConfiguration> getSubDomainsConfiguration()
          Get all the sub-domain configurations.
 boolean hasValidLocalContainerDynamicTopologyConfiguration()
          
 boolean isContainerStarted(java.lang.String containerName)
          Test if the container is started.
 void registerLocalContainerOnMaster()
           
 void removeContainerConfiguration(ContainerConfiguration removedContainer)
          Remove container configuration.
 void removeSubdomainConfiguration(java.lang.String removedSubdomain)
          Remove subdomain configuration.
 void setContainerState(java.lang.String containerName, ContainerConfiguration.ContainerState state)
          Set the given state to the give container.
protected  void start()
           
protected  void stop()
           
 void updateTopology()
          Update the local view of the topology.
 void validateDynamicTopology()
          Validate the dynamic topology.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.ow2.petals.util.LoggingUtil log
Logger wrapper.

Constructor Detail

TopologyServiceImpl

public TopologyServiceImpl()
Method Detail

addContainerConfiguration

public void addContainerConfiguration(ContainerConfiguration addedContainer)
                               throws org.ow2.petals.kernel.api.server.PetalsException
Add the given container to the topology

Specified by:
addContainerConfiguration in interface TopologyService
Parameters:
addedContainer - the container to add to the current topology
Throws:
org.ow2.petals.kernel.api.server.PetalsException - Failed to add the container to the current topology

addSubdomainConfiguration

public void addSubdomainConfiguration(SubDomainConfiguration addedSubdomain)
                               throws org.ow2.petals.kernel.api.server.PetalsException
Add a subdomain to the local topology.

Specified by:
addSubdomainConfiguration in interface TopologyService
Throws:
org.ow2.petals.kernel.api.server.PetalsException

getContainerConfiguration

public ContainerConfiguration getContainerConfiguration(java.lang.String containerName)
Get the container configuration of the given container name.

Specified by:
getContainerConfiguration in interface TopologyService
Parameters:
containerName - The name of the targeted container
Returns:
The container configuration

getContainersConfiguration

public java.util.Set<ContainerConfiguration> getContainersConfiguration(ContainerConfiguration.ContainerState state)
Get all the containers where the state is the same than the given one. If the state is null, get all the containers...

Specified by:
getContainersConfiguration in interface TopologyService
Returns:

getContainersConfigurationsForLocalSubdomain

public java.util.Set<ContainerConfiguration> getContainersConfigurationsForLocalSubdomain()

Specified by:
getContainersConfigurationsForLocalSubdomain in interface TopologyService

getDomainConfiguration

public DomainConfiguration getDomainConfiguration()
Get the domain configuration.

Specified by:
getDomainConfiguration in interface TopologyService
Returns:
the domain configuration

getSubDomainsConfiguration

public java.util.Set<SubDomainConfiguration> getSubDomainsConfiguration()
Get all the sub-domain configurations.

Specified by:
getSubDomainsConfiguration in interface TopologyService
Returns:
a set of ContainerConfiguration

hasValidLocalContainerDynamicTopologyConfiguration

public boolean hasValidLocalContainerDynamicTopologyConfiguration()

Specified by:
hasValidLocalContainerDynamicTopologyConfiguration in interface TopologyService

isContainerStarted

public boolean isContainerStarted(java.lang.String containerName)
Test if the container is started.

Specified by:
isContainerStarted in interface TopologyService
Returns:

registerLocalContainerOnMaster

public void registerLocalContainerOnMaster()
                                    throws org.ow2.petals.kernel.api.server.PetalsException
Specified by:
registerLocalContainerOnMaster in interface TopologyService
Throws:
org.ow2.petals.kernel.api.server.PetalsException

removeContainerConfiguration

public void removeContainerConfiguration(ContainerConfiguration removedContainer)
                                  throws ConfigurationException
Description copied from interface: TopologyService
Remove container configuration.

Specified by:
removeContainerConfiguration in interface TopologyService
Throws:
ConfigurationException

removeSubdomainConfiguration

public void removeSubdomainConfiguration(java.lang.String removedSubdomain)
                                  throws ConfigurationException
Description copied from interface: TopologyService
Remove subdomain configuration.

Specified by:
removeSubdomainConfiguration in interface TopologyService
Throws:
ConfigurationException

setContainerState

public void setContainerState(java.lang.String containerName,
                              ContainerConfiguration.ContainerState state)
Set the given state to the give container.

Specified by:
setContainerState in interface TopologyService
state - The ontainerConfiguration.ContainerState

updateTopology

public void updateTopology()
                    throws org.ow2.petals.kernel.api.server.PetalsException
Update the local view of the topology.

Specified by:
updateTopology in interface TopologyService
Throws:
org.ow2.petals.kernel.api.server.PetalsException

validateDynamicTopology

public void validateDynamicTopology()
                             throws ConfigurationException
Validate the dynamic topology.

Specified by:
validateDynamicTopology in interface TopologyService
Throws:
ConfigurationException

start

protected void start()

stop

protected void stop()


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.