org.ow2.jonas.lib.management.extensions.domain
Class DomainManagement

java.lang.Object
  extended by org.ow2.jonas.lib.management.extensions.base.BaseManagement
      extended by org.ow2.jonas.lib.management.extensions.domain.DomainManagement
All Implemented Interfaces:
IBaseManagement, IDomain

public class DomainManagement
extends BaseManagement
implements IDomain

Implements domain management functions.

Author:
Adriana Danes, Oualaa Hani

Field Summary
protected static org.objectweb.util.monolog.api.Logger logger
          logger for traces.
 
Fields inherited from class org.ow2.jonas.lib.management.extensions.base.BaseManagement
s_Synchro
 
Constructor Summary
DomainManagement()
          Constructor.
 
Method Summary
 void addCluster(String clusterName)
          Add a new cluster in the domain.
 void addServer(String serverName, String connector, String userName, String password, String clusterDaemon)
          Add a new server in the domain.
 String[] getClusterDaemonNames()
           
 String[] getclusterDaemons()
          Return the clusterDaemons in the domain.
 String getClusterdaemonState(String clusterDaemonName)
          Return the state of a cluster daemon in the domain.
 String[] getClusters()
          Return the clusters in the domain.
 String[] getClustersNames()
           
 String getClusterState(String clusterName)
          Return the state of a cluster in the domain.
 String getClusterType(String clusterName)
          Return the type of a cluster in the current domain.
static DomainManagement getInstance()
          Gets singleton instance.
 String getServerClusterdaemon(String serverName)
          Return the clusterDaemon of a server in the domain.
 String getServerHost()
           
 String[] getServerNames()
           
 String[] getServerNames(String clusterName)
           
 String getServerPort()
           
 String[] getServersNotInCluster(String clusterName)
          Get the name of the servers in the domain except the ones that are belonging to this cluster.
 String getServerState(String serverName)
          Return the state of a server in the domain
 boolean isMaster()
          Return True if the current server is a master.
 boolean isMaster(String pServer)
          Return True if the managed server is a master.
 void removeServers(String[] serversToRemove)
          Remove a list of servers from the domain.
 void startServer(String serverName, boolean standby)
          Start the server.
 void stopServer(String serverName, boolean standby)
          Stop the server.
 
Methods inherited from class org.ow2.jonas.lib.management.extensions.base.BaseManagement
addRealmItem, getAttribute, getAttributes, getDomainName, getIntegerAttribute, getKeyValue, getKeyValues, getListMbean, getRealmItems, getRealmItems, getServerConnection, getServerConnection, getServerName, getStringAttribute, getTomcatRealm, getTomcatRealmItems, invoke, isRegistered, setAttribute, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.jonas.management.extensions.domain.api.IDomain
getDomainName, getServerName
 
Methods inherited from interface org.ow2.jonas.management.extensions.base.api.IBaseManagement
getAttribute, getAttributes, getIntegerAttribute, getKeyValue, getKeyValues, getListMbean, getRealmItems, getRealmItems, getServerConnection, getServerConnection, getStringAttribute, getTomcatRealm, getTomcatRealmItems, invoke, isRegistered, setAttribute, setAttribute
 

Field Detail

logger

protected static org.objectweb.util.monolog.api.Logger logger
logger for traces.

Constructor Detail

DomainManagement

public DomainManagement()
Constructor.

Method Detail

getInstance

public static DomainManagement getInstance()
Gets singleton instance.

Returns:
singleton instance of domain management.

getServerHost

public String getServerHost()
Specified by:
getServerHost in interface IDomain
Returns:
the current server's host.

getServerPort

public String getServerPort()
Specified by:
getServerPort in interface IDomain
Returns:
the current server's port if the web service activated.

isMaster

public boolean isMaster(String pServer)
Return True if the managed server is a master.

Specified by:
isMaster in interface IDomain
Parameters:
pServer - managed server name
Returns:
the "master" attribute of the corresponding J2EEDomain MBean

isMaster

public boolean isMaster()
Return True if the current server is a master.

Specified by:
isMaster in interface IDomain
Returns:
the "master" attribute of the current J2EEDomain MBean

getServerNames

public String[] getServerNames()
Specified by:
getServerNames in interface IDomain
Returns:
the names of servers in the domain.

getClustersNames

public String[] getClustersNames()
Specified by:
getClustersNames in interface IDomain
Returns:
the names of clusters in the domain.

getClusterDaemonNames

public String[] getClusterDaemonNames()
Specified by:
getClusterDaemonNames in interface IDomain
Returns:
the names of clustersDaemons in the domain.

getClusters

public String[] getClusters()
Return the clusters in the domain. A cluster in the domain has associated a cluster MBean having in its ObjectName a key property 'type' with values in {LogicalCluster, TomcatCluster, JkCluster, EjbHa}. Remove from the clusters list the LogicalCluster which represents the domain.

Specified by:
getClusters in interface IDomain
Returns:
the OBJECT_NAMES of the Cluster MBeans.

getclusterDaemons

public String[] getclusterDaemons()
Return the clusterDaemons in the domain. A clusterDaemon in the domain has associated a cluster daemon MBean having in its ObjectName a key property 'type' with value equal to 'ClusterDaemon'.

Specified by:
getclusterDaemons in interface IDomain
Returns:
the OBJECT_NAMES of the Cluster Daemon MBeans.

addServer

public void addServer(String serverName,
                      String connector,
                      String userName,
                      String password,
                      String clusterDaemon)
Add a new server in the domain. Use LogicalCluster MBean corresponding to the domain.

Specified by:
addServer in interface IDomain
Parameters:
serverName - the server's name.
connector - the server's connector it can be JRMP, IRMI or IIOP.
userName - the user of the new server.
password - the password of the new server.
clusterDaemon - the name of clusterDaemon if this server is controlled by a clusterDaemon.

removeServers

public void removeServers(String[] serversToRemove)
Remove a list of servers from the domain.

Specified by:
removeServers in interface IDomain
Parameters:
serversToRemove - the list of servers to remove.

addCluster

public void addCluster(String clusterName)
Add a new cluster in the domain.

Specified by:
addCluster in interface IDomain
Parameters:
clusterName - the new cluster's name.

getServerState

public String getServerState(String serverName)
Return the state of a server in the domain

Specified by:
getServerState in interface IDomain
Parameters:
serverName - the server's name
Returns:
the state of a server in the domain

getServerClusterdaemon

public String getServerClusterdaemon(String serverName)
Return the clusterDaemon of a server in the domain.

Specified by:
getServerClusterdaemon in interface IDomain
Parameters:
serverName - the server's name
Returns:
the name of the server's cluster daemon

startServer

public void startServer(String serverName,
                        boolean standby)
Start the server.

Specified by:
startServer in interface IDomain
Parameters:
serverName - the name of the server to start
standby - true to enter standby mode.

stopServer

public void stopServer(String serverName,
                       boolean standby)
Stop the server.

Specified by:
stopServer in interface IDomain
Parameters:
serverName - the name of the server to stop
standby - true to enter standby mode.

getClusterState

public String getClusterState(String clusterName)
Return the state of a cluster in the domain.

Specified by:
getClusterState in interface IDomain
Parameters:
clusterName - the cluster's name
Returns:
the state of a cluster in the domain

getClusterType

public String getClusterType(String clusterName)
Return the type of a cluster in the current domain.

Specified by:
getClusterType in interface IDomain
Parameters:
clusterName - the cluster's name
Returns:
the result of the getClusterType operation

getServerNames

public String[] getServerNames(String clusterName)
Specified by:
getServerNames in interface IDomain
Parameters:
clusterName - the cluster name
Returns:
the server names that are belonging to a cluster

getClusterdaemonState

public String getClusterdaemonState(String clusterDaemonName)
Return the state of a cluster daemon in the domain.

Specified by:
getClusterdaemonState in interface IDomain
Parameters:
clusterDaemonName - the cluster daemon's name
Returns:
the state of a cluster daemon in the domain

getServersNotInCluster

public String[] getServersNotInCluster(String clusterName)
Get the name of the servers in the domain except the ones that are belonging to this cluster.

Specified by:
getServersNotInCluster in interface IDomain
Parameters:
clusterName - the cluster name
Returns:
name of the servers that can be attached to the cluster


Copyright © 2010 OW2 Consortium. All Rights Reserved.