Joram ${version}

org.objectweb.joram.client.jms.admin
Class PlatformAdmin

java.lang.Object
  extended byorg.objectweb.joram.client.jms.admin.PlatformAdmin
All Implemented Interfaces:
PlatformAdminMBean

public class PlatformAdmin
extends java.lang.Object
implements PlatformAdminMBean


Constructor Summary
PlatformAdmin()
           
PlatformAdmin(java.lang.String hostName, int port, java.lang.String name, java.lang.String password, int cnxTimer)
           
PlatformAdmin(java.lang.String hostName, int port, java.lang.String name, java.lang.String password, int cnxTimer, java.lang.String reliableClass)
           
PlatformAdmin(java.lang.String name, java.lang.String password)
           
PlatformAdmin(javax.jms.TopicConnectionFactory cnxFact, java.lang.String name, java.lang.String password)
           
 
Method Summary
 void addDomain(java.lang.String domainName, int sid, int port)
          Adds a domain to the platform.
 void addServer(int sid, java.lang.String hostName, java.lang.String domainName, int port, java.lang.String serverName)
          Adds a server to the platform.
 void collocatedConnect(java.lang.String name, java.lang.String password)
          Opens a connection with the collocated JORAM server.
 void connect(java.lang.String hostName, int port, java.lang.String name, java.lang.String password, int cnxTimer, java.lang.String reliableClass)
          Opens a TCP connection with the Joram server running on a given host and listening to a given port.
 void connect(java.lang.String name, java.lang.String password, int cnxTimer)
          Opens a TCP connection with the Joram server running on the default "locahost" host and listening to the default 16010 port.
 void connect(javax.jms.TopicConnectionFactory cnxFact, java.lang.String name, java.lang.String password)
          Opens a connection dedicated to administering with the Joram server which parameters are wrapped by a given TopicConnectionFactory.
 void disconnect()
          Closes the administration connection.
 void exit()
          Closes the administration connection and unregister the MBean.
 java.lang.String getConfiguration()
          Returns the current servers configuration (a3servers.xml).
 int getDefaultThreshold()
          Returns the default threshold value for the local server, -1 if not set.
 int getDefaultThreshold(int serverId)
          Returns the default threshold value for a given server, -1 if not set.
 java.lang.String[] getDomainNames(int serverId)
          Returns the list of the domain names that contains the specified server.
 java.lang.String getLocalHost()
          Returns the host name of the server the module is connected to.
 int getLocalPort()
          Returns the port number of the server the module is connected to.
 int getLocalServerId()
          Returns the identifier of the server the module is connected to.
 java.util.List getServersIds()
          Returns the list of the platform's servers' identifiers.
 java.util.List getServersIds(java.lang.String domainName)
          Returns the list of the servers' identifiers that belong to the specified domain
 void removeDomain(java.lang.String domainName)
          Removes a domain from the platform.
 void removeServer(int sid)
          Removes a server from the platform.
 void setDefaultThreshold(int threshold)
          Sets a given value as the default threshold for the local server (-1 for unsetting previous value).
 void setDefaultThreshold(int serverId, int threshold)
          Sets a given value as the default threshold for a given server (-1 for unsetting previous value).
 void stopServer()
          Stops the platform local server.
 void stopServer(int serverId)
          Stops a given server of the platform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlatformAdmin

public PlatformAdmin()
              throws java.net.ConnectException,
                     AdminException

PlatformAdmin

public PlatformAdmin(java.lang.String hostName,
                     int port,
                     java.lang.String name,
                     java.lang.String password,
                     int cnxTimer,
                     java.lang.String reliableClass)
              throws java.net.UnknownHostException,
                     java.net.ConnectException,
                     AdminException

PlatformAdmin

public PlatformAdmin(java.lang.String hostName,
                     int port,
                     java.lang.String name,
                     java.lang.String password,
                     int cnxTimer)
              throws java.net.UnknownHostException,
                     java.net.ConnectException,
                     AdminException

PlatformAdmin

public PlatformAdmin(java.lang.String name,
                     java.lang.String password)
              throws java.net.ConnectException,
                     AdminException

PlatformAdmin

public PlatformAdmin(javax.jms.TopicConnectionFactory cnxFact,
                     java.lang.String name,
                     java.lang.String password)
              throws java.net.ConnectException,
                     AdminException
Method Detail

connect

public void connect(javax.jms.TopicConnectionFactory cnxFact,
                    java.lang.String name,
                    java.lang.String password)
             throws java.net.ConnectException,
                    AdminException
Opens a connection dedicated to administering with the Joram server which parameters are wrapped by a given TopicConnectionFactory.

Specified by:
connect in interface PlatformAdminMBean
Parameters:
cnxFact - The TopicConnectionFactory to use for connecting.
name - Administrator's name.
password - Administrator's password.
Throws:
java.net.ConnectException - If connecting fails.
AdminException - If the administrator identification is incorrect.

connect

public void connect(java.lang.String hostName,
                    int port,
                    java.lang.String name,
                    java.lang.String password,
                    int cnxTimer,
                    java.lang.String reliableClass)
             throws java.net.UnknownHostException,
                    java.net.ConnectException,
                    AdminException
Opens a TCP connection with the Joram server running on a given host and listening to a given port.

Specified by:
connect in interface PlatformAdminMBean
Parameters:
port - The number of the port the server is listening to.
name - Administrator's name.
password - Administrator's password.
cnxTimer - Timer in seconds during which connecting to the server is attempted.
reliableClass - Reliable class name.
Throws:
java.net.UnknownHostException - If the host is invalid.
java.net.ConnectException - If connecting fails.
AdminException - If the administrator identification is incorrect.

connect

public void connect(java.lang.String name,
                    java.lang.String password,
                    int cnxTimer)
             throws java.net.ConnectException,
                    AdminException
Opens a TCP connection with the Joram server running on the default "locahost" host and listening to the default 16010 port.

Specified by:
connect in interface PlatformAdminMBean
Parameters:
name - Administrator's name.
password - Administrator's password.
cnxTimer - Timer in seconds during which connecting to the server is attempted.
Throws:
java.net.UnknownHostException - Never thrown.
java.net.ConnectException - If connecting fails.
AdminException - If the administrator identification is incorrect.

collocatedConnect

public void collocatedConnect(java.lang.String name,
                              java.lang.String password)
                       throws java.net.ConnectException,
                              AdminException
Opens a connection with the collocated JORAM server.

Specified by:
collocatedConnect in interface PlatformAdminMBean
Parameters:
name - Administrator's name.
password - Administrator's password.
Throws:
java.net.ConnectException - If connecting fails.
AdminException - If the administrator identification is incorrect.

disconnect

public void disconnect()
Closes the administration connection.

Specified by:
disconnect in interface PlatformAdminMBean

exit

public void exit()
Closes the administration connection and unregister the MBean.

Specified by:
exit in interface PlatformAdminMBean

stopServer

public void stopServer(int serverId)
                throws java.net.ConnectException,
                       AdminException
Stops a given server of the platform.

The request fails if the target server does not belong to the platform.

Specified by:
stopServer in interface PlatformAdminMBean
Parameters:
serverId - Identifier of the server to stop.
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

stopServer

public void stopServer()
                throws java.net.ConnectException,
                       AdminException
Stops the platform local server.

Specified by:
stopServer in interface PlatformAdminMBean
Throws:
java.net.ConnectException - If the connection fails.
AdminException - Never thrown.

addServer

public void addServer(int sid,
                      java.lang.String hostName,
                      java.lang.String domainName,
                      int port,
                      java.lang.String serverName)
               throws java.net.ConnectException,
                      AdminException
Adds a server to the platform.

Specified by:
addServer in interface PlatformAdminMBean
Parameters:
hostName - Address of the host where the added server is started
domainName - Name of the domain where the server is added
port - Listening port of the server in the specified domain
serverName - Name of the added server
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

removeServer

public void removeServer(int sid)
                  throws java.net.ConnectException,
                         AdminException
Removes a server from the platform.

Specified by:
removeServer in interface PlatformAdminMBean
Parameters:
sid - Id of the removed server
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

addDomain

public void addDomain(java.lang.String domainName,
                      int sid,
                      int port)
               throws java.net.ConnectException,
                      AdminException
Adds a domain to the platform.

Specified by:
addDomain in interface PlatformAdminMBean
Parameters:
domainName - Name of the added domain
sid - Id of the router server that gives access to the added domain
port - Listening port in the added domain of the router server
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

removeDomain

public void removeDomain(java.lang.String domainName)
                  throws java.net.ConnectException,
                         AdminException
Removes a domain from the platform.

Specified by:
removeDomain in interface PlatformAdminMBean
Parameters:
domainName - Name of the added domain
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

getConfiguration

public java.lang.String getConfiguration()
                                  throws java.net.ConnectException,
                                         AdminException
Returns the current servers configuration (a3servers.xml).

Specified by:
getConfiguration in interface PlatformAdminMBean
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

getServersIds

public java.util.List getServersIds()
Returns the list of the platform's servers' identifiers.

Specified by:
getServersIds in interface PlatformAdminMBean

getServersIds

public java.util.List getServersIds(java.lang.String domainName)
                             throws java.net.ConnectException,
                                    AdminException
Returns the list of the servers' identifiers that belong to the specified domain

Specified by:
getServersIds in interface PlatformAdminMBean
Throws:
java.net.ConnectException - If the connection fails.
AdminException - Never thrown.

getDomainNames

public java.lang.String[] getDomainNames(int serverId)
                                  throws java.net.ConnectException,
                                         AdminException
Returns the list of the domain names that contains the specified server.

Specified by:
getDomainNames in interface PlatformAdminMBean
Throws:
java.net.ConnectException - If the connection fails.
AdminException - Never thrown.

setDefaultThreshold

public void setDefaultThreshold(int serverId,
                                int threshold)
                         throws java.net.ConnectException,
                                AdminException
Sets a given value as the default threshold for a given server (-1 for unsetting previous value).

The request fails if the target server does not belong to the platform.

Specified by:
setDefaultThreshold in interface PlatformAdminMBean
Parameters:
serverId - The identifier of the server.
threshold - The threshold value to be set.
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

setDefaultThreshold

public void setDefaultThreshold(int threshold)
                         throws java.net.ConnectException,
                                AdminException
Sets a given value as the default threshold for the local server (-1 for unsetting previous value).

Specified by:
setDefaultThreshold in interface PlatformAdminMBean
Parameters:
threshold - The threshold value to be set.
Throws:
java.net.ConnectException - If the connection fails.
AdminException - Never thrown.

getDefaultThreshold

public int getDefaultThreshold(int serverId)
                        throws java.net.ConnectException,
                               AdminException
Returns the default threshold value for a given server, -1 if not set.

The request fails if the target server does not belong to the platform.

Specified by:
getDefaultThreshold in interface PlatformAdminMBean
Throws:
java.net.ConnectException - If the connection fails.
AdminException - If the request fails.

getDefaultThreshold

public int getDefaultThreshold()
                        throws java.net.ConnectException,
                               AdminException
Returns the default threshold value for the local server, -1 if not set.

Specified by:
getDefaultThreshold in interface PlatformAdminMBean
Throws:
java.net.ConnectException - If the connection fails.
AdminException - Never thrown.

getLocalServerId

public int getLocalServerId()
                     throws java.net.ConnectException
Returns the identifier of the server the module is connected to.

Specified by:
getLocalServerId in interface PlatformAdminMBean
Throws:
java.net.ConnectException - If the admin connection is not established.

getLocalHost

public java.lang.String getLocalHost()
                              throws java.net.ConnectException
Returns the host name of the server the module is connected to.

Specified by:
getLocalHost in interface PlatformAdminMBean
Throws:
java.net.ConnectException - If the admin connection is not established.

getLocalPort

public int getLocalPort()
                 throws java.net.ConnectException
Returns the port number of the server the module is connected to.

Specified by:
getLocalPort in interface PlatformAdminMBean
Throws:
java.net.ConnectException - If the admin connection is not established.

Joram ${version}

Copyright © 2005 Scalagent - All rights reserved