org.objectweb.petals.tools.webadmin.bo
Class ServerConfiguration

java.lang.Object
  extended by org.objectweb.petals.tools.webadmin.bo.ServerConfiguration

public class ServerConfiguration
extends java.lang.Object

Represents the configuration of a server as a HashMap of his properties : host, jmxPort, jmxLogin, jmxPassword and with an attribute : a MBeanServerConnection connection to the server


Constructor Summary
ServerConfiguration()
          Creates a new empty ServerConfiguration
ServerConfiguration(java.util.Map<java.lang.String,java.lang.String> serverInfos)
          Creatse a new ServerConfiguration, based on a HashMap containing the connexion's informations
ServerConfiguration(java.lang.String host, java.lang.String jmxPort, java.lang.String jmxLogin, java.lang.String jmxPassword)
          Creates a new ServerConfiguration with base connection's informations
ServerConfiguration(java.lang.String name, java.lang.String host, java.lang.String jmxPort, java.lang.String jmxLogin, java.lang.String jmxPassword)
          Creates a new ServerConfiguration with base informations
ServerConfiguration(java.lang.String name, java.lang.String host, java.lang.String jmxPort, java.lang.String jmxLogin, java.lang.String jmxPassword, java.lang.String state)
          Creates a new ServerConfiguration with base informations
ServerConfiguration(java.lang.String name, java.lang.String host, java.lang.String jmxPort, java.lang.String jmxLogin, java.lang.String jmxPassword, java.lang.String state, javax.management.MBeanServerConnection connection)
          Creates a new ServerConfiguration with complete informations
 
Method Summary
 void createConnection()
          Retrieves a new connection to the server and sets the connection attribute
 java.lang.String getAddress()
           
 javax.management.MBeanServerConnection getConnection()
          Returns the connection to the server
 java.util.Map<java.lang.String,java.lang.String> getConnectionParameters()
          Gets basics server's informations for connection : name, host, port, login, password
 java.lang.String getHost()
          Returns the host of the server
 java.lang.String getJmxLogin()
          Returns the JMX login name
 java.lang.String getJmxPassword()
          Returns the JMX user password
 java.lang.String getJmxPort()
          Returns the JMX port
 java.lang.String getMonitor()
           
 java.lang.String getName()
          Returns the name of the server
 java.util.Map<java.lang.String,java.lang.String> getServerProperties()
          Gets the server's informations as a set of parameters
 java.lang.String getShowMessageContent()
           
 java.lang.String getState()
          Returns the state of the server
 void setConnection(javax.management.MBeanServerConnection connection)
          Sets the connection to the server
 void setHost(java.lang.String host)
          Sets the host of the server
 void setJmxLogin(java.lang.String jmxLogin)
          Sets the JMX login name
 void setJmxPassword(java.lang.String jmxPassword)
          Sets the JMX user password
 void setJmxPort(java.lang.String jmxPort)
          Sets the JMX port
 void setMonitor(boolean monitor)
           
 void setName()
          Retrieve the name of the server, and sets it
 void setName(java.lang.String name)
          Sets the name of the server
 void setServerProperties(java.util.Map<java.lang.String,java.lang.String> connectionProperties)
          Sets the new connection properties for the server
 void setShowMessageContent(boolean showMessageContent)
           
 void setState(java.lang.String state)
          Sets the state of the server
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerConfiguration

public ServerConfiguration()
Creates a new empty ServerConfiguration


ServerConfiguration

public ServerConfiguration(java.util.Map<java.lang.String,java.lang.String> serverInfos)
Creatse a new ServerConfiguration, based on a HashMap containing the connexion's informations

Parameters:
serverInfos - HashMap containing the infos

ServerConfiguration

public ServerConfiguration(java.lang.String host,
                           java.lang.String jmxPort,
                           java.lang.String jmxLogin,
                           java.lang.String jmxPassword)
Creates a new ServerConfiguration with base connection's informations

Parameters:
host - host of the server
jmxPort - JMX port of the server
jmxLogin - JMX login of the server
jmxPassword - JMX password of the server

ServerConfiguration

public ServerConfiguration(java.lang.String name,
                           java.lang.String host,
                           java.lang.String jmxPort,
                           java.lang.String jmxLogin,
                           java.lang.String jmxPassword)
Creates a new ServerConfiguration with base informations

Parameters:
name - the name of the server
host - host of the server
jmxPort - JMX port of the server
jmxLogin - JMX login of the server
jmxPassword - JMX password of the server

ServerConfiguration

public ServerConfiguration(java.lang.String name,
                           java.lang.String host,
                           java.lang.String jmxPort,
                           java.lang.String jmxLogin,
                           java.lang.String jmxPassword,
                           java.lang.String state)
Creates a new ServerConfiguration with base informations

Parameters:
name - the name of the server
host - host of the server
jmxPort - JMX port of the server
jmxLogin - JMX login of the server
jmxPassword - JMX password of the server
state - the state of the server (started, stopped)

ServerConfiguration

public ServerConfiguration(java.lang.String name,
                           java.lang.String host,
                           java.lang.String jmxPort,
                           java.lang.String jmxLogin,
                           java.lang.String jmxPassword,
                           java.lang.String state,
                           javax.management.MBeanServerConnection connection)
Creates a new ServerConfiguration with complete informations

Parameters:
name - the name of the server
host - host of the server
jmxPort - JMX port of the server
jmxLogin - JMX login of the server
jmxPassword - JMX password of the server
state - the state of the server (started, stopped)
connection - a MBeanServerConnection connection to the server
Method Detail

createConnection

public void createConnection()
                      throws java.io.IOException
Retrieves a new connection to the server and sets the connection attribute

Throws:
java.io.IOException

getAddress

public java.lang.String getAddress()

getConnection

public javax.management.MBeanServerConnection getConnection()
Returns the connection to the server

Returns:
a MBeanServerConnection connection

getConnectionParameters

public java.util.Map<java.lang.String,java.lang.String> getConnectionParameters()
Gets basics server's informations for connection : name, host, port, login, password

Returns:
a Map containing informations as pairs

getHost

public java.lang.String getHost()
Returns the host of the server

Returns:
a String representation fo the host

getJmxLogin

public java.lang.String getJmxLogin()
Returns the JMX login name

Returns:
a string representation of the JMX login name

getJmxPassword

public java.lang.String getJmxPassword()
Returns the JMX user password

Returns:
the JMX password as a String

getJmxPort

public java.lang.String getJmxPort()
Returns the JMX port

Returns:
a string representation of the port

getShowMessageContent

public java.lang.String getShowMessageContent()

getMonitor

public java.lang.String getMonitor()

getName

public java.lang.String getName()
Returns the name of the server

Returns:
the name of the server as a String

getServerProperties

public java.util.Map<java.lang.String,java.lang.String> getServerProperties()
Gets the server's informations as a set of parameters

Returns:
a Map representation of the connection properties

getState

public java.lang.String getState()
Returns the state of the server

Returns:
a string representation of the state of the server

setConnection

public void setConnection(javax.management.MBeanServerConnection connection)
Sets the connection to the server

Parameters:
state - a MBeanServerConnection that is to be the connection

setHost

public void setHost(java.lang.String host)
Sets the host of the server

Parameters:
host - a String that is to be the host of the server

setJmxLogin

public void setJmxLogin(java.lang.String jmxLogin)
Sets the JMX login name

Parameters:
jmxLogin - a String that is to be the JMX login name

setJmxPassword

public void setJmxPassword(java.lang.String jmxPassword)
Sets the JMX user password

Parameters:
jmxPassword - a String that is to be password for jmx access

setJmxPort

public void setJmxPort(java.lang.String jmxPort)
Sets the JMX port

Parameters:
jmxPort - a String that is to be the port

setMonitor

public void setMonitor(boolean monitor)

setName

public void setName()
             throws javax.management.MBeanException,
                    java.io.IOException,
                    javax.management.AttributeNotFoundException
Retrieve the name of the server, and sets it

Throws:
java.io.IOException
javax.management.MBeanException
javax.management.AttributeNotFoundException
java.lang.Exception

setName

public void setName(java.lang.String name)
Sets the name of the server

Parameters:
name - a String that is to be the server's name

setServerProperties

public void setServerProperties(java.util.Map<java.lang.String,java.lang.String> connectionProperties)
Sets the new connection properties for the server

Parameters:
connectionProperties -

setShowMessageContent

public void setShowMessageContent(boolean showMessageContent)

setState

public void setState(java.lang.String state)
Sets the state of the server

Parameters:
state - a String that is to be the state

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005-2007 ObjectWeb Consortium. All Rights Reserved.