|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.lib.management.domain.DomainMonitor
public class DomainMonitor
A DomainMonitor instance is created for each Master Server in the domain. It manages the servers and the clusters in the domain.
Constructor Summary | |
---|---|
DomainMonitor(String domain,
String serverName)
Constructor |
Method Summary | |
---|---|
void |
addAuthenticationInformation(String name,
String username,
String password)
Adds authentication information for a given server or the domain. |
String |
createCluster(String name)
Create a logical cluster. |
void |
deployOnTarget(String target,
String fileName)
Deploy a module on a target which may be a server or a cluster |
void |
discoveryNotification(DiscoveryEvent event)
Handle notifications from Discovery Service. |
void |
discoveryNotificationForClusterd(DiscoveryEvent event)
Handles Notifications from Discovery Service for clusterd daemons |
BaseCluster |
findCluster(String name)
Get a Cluster by its name. |
ClusterDaemonProxy |
findClusterDaemonProxy(String name)
Get a ClusterDaemon by its name |
ServerProxy |
findServerProxy(String name)
Get a ServerProxy by its name. |
void |
forgetAllDeploy()
Forget all deploy information |
AuthenticationInformation |
getAuthenticationInformation(String name)
Gets the authentication information for a given server or cluster daemon name defined in the domain.xml file. |
Collection<ClusterDaemonProxy> |
getClusterDaemonList()
|
String[] |
getClusterDaemons()
|
String |
getClusterdaemonState(String clusterdaemonName)
Return the state of a cluster daemon in the domain. |
String[] |
getClusters()
MBean method. |
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 domain. |
MBeanServerConnection |
getConnection(String serverName)
Return a JMX connection to a given server in the domain. |
String[] |
getDeployServers(String filename)
Get the list of server where a file is being deployed |
String |
getDeployState(String filename,
String servername)
Get the current state (string form) of deployment operation |
String |
getDescription()
|
String |
getDomainName()
|
String |
getErrorMessage(String filename,
String servername)
Get the error message associated to the error state |
static DomainMonitor |
getInstance()
Singleton: Each server (master or slave) must have 1 unique DomainMonitor object. |
JmxService |
getJmxService()
|
Collection |
getLogicalClusterList()
Get the list of logical clusters. |
int |
getMonitoringPeriod()
|
String[] |
getProxys()
MBean method To be replaced by J2EEDomain.getServers() |
String |
getServerClusterdaemon(String serverName)
Return the cluster daemon name of a server in the domain. |
Collection |
getServerList()
Get the list of ServerProxy. |
String[] |
getServerNames()
|
String[] |
getServerNames(String clusterName)
|
String[] |
getServers(boolean started)
|
String[] |
getServersInCluster(String clusterName)
|
String[] |
getServersNotInCluster(String clusterName)
|
String |
getServerState(String serverName)
Return the state of a server in the domain. |
Collection |
getTotalClusterList()
|
void |
haltServer(String serverName)
Halt a managed JOnAS Server |
boolean |
isCluster(String clusterName)
Check if a cluster exists. |
boolean |
isMaster()
|
void |
notifyServerProxyRunning(ServerProxy sp)
Notify to all the cluster factories that a server started in the domain |
void |
readDomainConfig()
|
void |
refreshStates()
Try to refresh the server states TODO notify thread only. |
void |
registerClusterDaemonProxy(String cdName,
String serverName,
Collection urls)
Register a cluster daemon proxy in the domain. |
boolean |
registerDeployAction(DeployAction action)
Register a DeployAction |
void |
removeAuthenticationInformation(String name)
Removes authentication information for a given server or the domain. |
void |
setJmxService(JmxService jmxService)
|
void |
setMaster()
|
void |
setMonitoringPeriod(int sec)
|
boolean |
startRemoteTarget(String target)
Start a server or a cluster |
void |
startServer(String serverName)
Start a managed JOnAS Server |
boolean |
stopRemoteTarget(String target)
Stop a server or a cluster |
void |
stopServer(String serverName)
Stop a managed JOnAS Server |
void |
unDeployOnTarget(String target,
String fileName)
Undeploy a module on a target which may be a server or a cluster |
boolean |
uploadDeployFileOn(String target,
String filename)
Upload and deploy a module on a target. |
void |
uploadDeployOnTarget(String target,
String fileName,
boolean replaceExisting)
Upload a module on a target which may be a server or a cluster |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DomainMonitor(String domain, String serverName)
Method Detail |
---|
public static DomainMonitor getInstance()
public void setMaster()
public boolean isMaster()
public void readDomainConfig()
public String getDescription()
public String getDomainName()
public void setMonitoringPeriod(int sec)
public int getMonitoringPeriod()
public BaseCluster findCluster(String name)
name
- The name of the cluster
public ServerProxy findServerProxy(String name)
name
- The name of the server
public ClusterDaemonProxy findClusterDaemonProxy(String name)
name
- The name of the clusterdaemon
public void registerClusterDaemonProxy(String cdName, String serverName, Collection urls) throws MalformedObjectNameException
cdName
- the cluster daemon's nameserverName
- name of the current jonas server (master instance)urls
- connection urls for the cluster daemon
MalformedObjectNameException
- can't create ObjectName for the
ClusterDaemon's MBeanpublic AuthenticationInformation getAuthenticationInformation(String name)
name
- Name of the server, null to get default.
public void addAuthenticationInformation(String name, String username, String password) throws UnsupportedEncodingException
name
- Name of the server, null to change default.username
- User name to use when connecting.password
- Password to use when connecting. Must be passed in clear
format, will be encoded by this method. throws
UnsupportedEncodingException If encoding the password fails.
UnsupportedEncodingException
public void removeAuthenticationInformation(String name)
name
- Name of the server, null to change domain's default.public Collection getServerList()
public Collection<ClusterDaemonProxy> getClusterDaemonList()
public Collection getTotalClusterList()
public Collection getLogicalClusterList()
public String[] getProxys()
public String[] getClusters()
public void discoveryNotification(DiscoveryEvent event)
event
- received DiscoveryEvent.public void discoveryNotificationForClusterd(DiscoveryEvent event)
event
- public void notifyServerProxyRunning(ServerProxy sp)
sp
- the server's proxypublic boolean registerDeployAction(DeployAction action)
public String[] getDeployServers(String filename)
filename
- file to deploy
public String getDeployState(String filename, String servername)
filename
- file to deployservername
- server where deployment is done
public String getErrorMessage(String filename, String servername)
filename
- file to deployservername
- server where deployment is done
public void forgetAllDeploy()
public void refreshStates()
public MBeanServerConnection getConnection(String serverName)
serverName
- the name of the server
public String[] getServers(boolean started)
started
- if true, return only the servers which are in RUNNING
state anyway, don't pat attention to the servers state
public String[] getServerNames()
public String[] getServerNames(String clusterName)
clusterName
- the cluster name
public String getServerState(String serverName)
serverName
- the server name
public String getClusterState(String clusterName)
clusterName
- the cluster name
public String getClusterdaemonState(String clusterdaemonName)
clusterdaemonName
- the cluster daemon name
public String getClusterType(String clusterName)
clusterName
- the cluster name
public String[] getClusterDaemons()
public String createCluster(String name)
name
- the name of the cluster
public void startServer(String serverName)
serverName
- name of the serverpublic void haltServer(String serverName)
serverName
- name of the serverpublic void stopServer(String serverName)
serverName
- name of the serverpublic void deployOnTarget(String target, String fileName)
target
- target namefileName
- file containing the modulepublic void uploadDeployOnTarget(String target, String fileName, boolean replaceExisting)
target
- target namefileName
- file containing the modulereplaceExisting
- true if the file can replace an existing one (same
name)public void unDeployOnTarget(String target, String fileName)
target
- target namefileName
- file containing the modulepublic boolean stopRemoteTarget(String target) throws JMException
target
- the name of the target to be stoped
JMException
- problem when trying to stoppublic boolean startRemoteTarget(String target) throws JMException
target
- the name of the target to be started
JMException
- problem when trying to startpublic boolean uploadDeployFileOn(String target, String filename)
target
- the target namefilename
- the file containing the module
public boolean isCluster(String clusterName)
clusterName
- the name of the cluster to check
public String[] getServersNotInCluster(String clusterName)
clusterName
- Name of the cluster
public String[] getServersInCluster(String clusterName)
clusterName
- Name of the cluster
public String getServerClusterdaemon(String serverName)
serverName
- the server name
public void setJmxService(JmxService jmxService)
jmxService
- the jmxService to setpublic JmxService getJmxService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |