org.objectweb.jonas.webapp.jonasadmin
Class WhereAreYou

java.lang.Object
  extended by org.objectweb.jonas.webapp.jonasadmin.WhereAreYou

public class WhereAreYou
extends java.lang.Object

Author:
Michel-Ange ANTON

Field Summary
static java.lang.String CONTEXT_MACRO
           
static int DEPLOYMENT_DATASOURCE
           
static int DEPLOYMENT_EAR
           
static int DEPLOYMENT_JAR
           
static int DEPLOYMENT_JMS
           
static int DEPLOYMENT_MAIL
           
static int DEPLOYMENT_RAR
           
static java.lang.String DEPLOYMENT_STRING_DATASOURCE
           
static java.lang.String DEPLOYMENT_STRING_EAR
           
static java.lang.String DEPLOYMENT_STRING_JAR
           
static java.lang.String DEPLOYMENT_STRING_JMS
           
static java.lang.String DEPLOYMENT_STRING_MAILFACTORY
           
static java.lang.String DEPLOYMENT_STRING_RAR
           
static java.lang.String DEPLOYMENT_STRING_WAR
           
static int DEPLOYMENT_WAR
           
static int DOMAIN_DEPLOYMENT_EAR
           
static int DOMAIN_DEPLOYMENT_JAR
           
static int DOMAIN_DEPLOYMENT_RAR
           
static java.lang.String DOMAIN_DEPLOYMENT_STRING_EAR
           
static java.lang.String DOMAIN_DEPLOYMENT_STRING_JAR
           
static java.lang.String DOMAIN_DEPLOYMENT_STRING_RAR
           
static java.lang.String DOMAIN_DEPLOYMENT_STRING_WAR
           
static int DOMAIN_DEPLOYMENT_WAR
           
static java.lang.String EXCEPTION_JONASSERVER_NOTFOUND
           
static java.lang.String EXCEPTION_MBEAN_J2EEDOMAIN_NOTFOUND
           
static java.lang.String EXCEPTION_MBEAN_J2EESERVER_NOTFOUND
           
static java.lang.String EXCEPTION_MBEANSERVER_NOTFOUND
          Exceptions
static java.lang.String NODE_SEPARATOR
          Used separator in the ident node in the tree
static java.lang.String SESSION_NAME
          Name of the variable in http session
static java.lang.String TAGS_IMAGES_ROOT_KEY
           
static java.lang.String TREE_PAGE_REFRESH
           
 
Constructor Summary
WhereAreYou()
           
 
Method Summary
 java.lang.String getAdminJonasServerConfDir()
           
 java.lang.String getAdminJonasServerName()
           
 java.lang.String getApplicationContextPath()
           
 int getApplicationServerPort()
           
 java.lang.String getCurrentCatalinaDefaultHostName()
           
 java.lang.String getCurrentCatalinaDomainName()
           
 java.lang.String getCurrentCatalinaEngineName()
           
 java.lang.String getCurrentCatalinaServiceName()
           
 javax.management.ObjectName getCurrentDomain()
          Return the current J2EE domain ObjectName.
 java.lang.String getCurrentDomainName()
          Return the current J2EE domain name.
 int getCurrentJonasDeploymentType()
           
 javax.management.ObjectName getCurrentJonasServer()
          Return the ObjectName of the MBean associated to the current Jonas server.
 java.lang.String getCurrentJonasServerName()
          Return the current Jonas server name.
 java.lang.String getImagesRoot()
           
 java.lang.String getSelectedNameNode()
          Return the name of the selected node in the tree.
 TreeControlNode getSelectedTreeControlNode()
          Return the selected node in the tree.
protected  java.lang.String getServletServerName()
          Return the name of the servlet server.
 TreeControl getTreeControl()
           
 java.lang.String getUrlToRefreshSelectedNode(javax.servlet.http.HttpServletRequest p_Request, javax.servlet.http.HttpServletResponse p_Response)
          Return the URL to refresh the selected node in the tree.
 void initialize(org.apache.struts.action.ActionServlet p_Servlet, javax.servlet.http.HttpServletRequest p_Request)
          Initialize the properties in only reading.
 boolean isCatalinaServer()
           
 boolean isCurrentJonasServer()
           
 boolean isJettyServer()
           
 boolean isTreeToRefresh()
          Return the state of current display of tree.
 void refreshCatalina(javax.servlet.http.HttpServletRequest p_Request)
          Refresh the Catalina server properties.
 void refreshJetty(javax.servlet.http.HttpServletRequest p_Request)
          Refresh the Jetty server properties.
 void refreshJonas(javax.servlet.http.HttpServletRequest p_Request, java.lang.String serverName)
          Refresh the managed JOnAS server properties.
 void refreshServers(javax.servlet.http.HttpServletRequest p_Request)
           
 void refreshServers(javax.servlet.http.HttpServletRequest p_Request, java.lang.String serverName)
          Refresh all the servers properties.
protected  void resetCatalina()
          Reset the Catalina server properties.
protected  void resetDomain()
          Reset the domain properties.
protected  void resetJetty()
          Reset the Jetty server properties.
protected  void resetJonas()
          Reset the JOnAS server properties.
 void selectNameNode(java.lang.String p_Name, boolean p_Expand)
          Select the node in the tree.
 void setCurrentJonasDeploymentType(int currentJonasDeploymentType)
           
 void setTreeControl(TreeControl treeControl)
           
 void setTreeToRefresh(boolean treeToRefresh)
          Change the state of current display of tree.
 java.lang.String toString()
          Return in a string the contents of the instance for each propertie.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXCEPTION_MBEANSERVER_NOTFOUND

public static final java.lang.String EXCEPTION_MBEANSERVER_NOTFOUND
Exceptions

See Also:
Constant Field Values

EXCEPTION_JONASSERVER_NOTFOUND

public static final java.lang.String EXCEPTION_JONASSERVER_NOTFOUND
See Also:
Constant Field Values

EXCEPTION_MBEAN_J2EEDOMAIN_NOTFOUND

public static final java.lang.String EXCEPTION_MBEAN_J2EEDOMAIN_NOTFOUND
See Also:
Constant Field Values

EXCEPTION_MBEAN_J2EESERVER_NOTFOUND

public static final java.lang.String EXCEPTION_MBEAN_J2EESERVER_NOTFOUND
See Also:
Constant Field Values

SESSION_NAME

public static final java.lang.String SESSION_NAME
Name of the variable in http session

See Also:
Constant Field Values

TAGS_IMAGES_ROOT_KEY

public static final java.lang.String TAGS_IMAGES_ROOT_KEY
See Also:
Constant Field Values

CONTEXT_MACRO

public static final java.lang.String CONTEXT_MACRO
See Also:
Constant Field Values

TREE_PAGE_REFRESH

public static final java.lang.String TREE_PAGE_REFRESH
See Also:
Constant Field Values

NODE_SEPARATOR

public static final java.lang.String NODE_SEPARATOR
Used separator in the ident node in the tree

See Also:
Constant Field Values

DEPLOYMENT_EAR

public static final int DEPLOYMENT_EAR
See Also:
Constant Field Values

DEPLOYMENT_JAR

public static final int DEPLOYMENT_JAR
See Also:
Constant Field Values

DEPLOYMENT_WAR

public static final int DEPLOYMENT_WAR
See Also:
Constant Field Values

DEPLOYMENT_RAR

public static final int DEPLOYMENT_RAR
See Also:
Constant Field Values

DEPLOYMENT_DATASOURCE

public static final int DEPLOYMENT_DATASOURCE
See Also:
Constant Field Values

DEPLOYMENT_JMS

public static final int DEPLOYMENT_JMS
See Also:
Constant Field Values

DEPLOYMENT_MAIL

public static final int DEPLOYMENT_MAIL
See Also:
Constant Field Values

DOMAIN_DEPLOYMENT_EAR

public static final int DOMAIN_DEPLOYMENT_EAR
See Also:
Constant Field Values

DOMAIN_DEPLOYMENT_JAR

public static final int DOMAIN_DEPLOYMENT_JAR
See Also:
Constant Field Values

DOMAIN_DEPLOYMENT_WAR

public static final int DOMAIN_DEPLOYMENT_WAR
See Also:
Constant Field Values

DOMAIN_DEPLOYMENT_RAR

public static final int DOMAIN_DEPLOYMENT_RAR
See Also:
Constant Field Values

DEPLOYMENT_STRING_EAR

public static final java.lang.String DEPLOYMENT_STRING_EAR
See Also:
Constant Field Values

DEPLOYMENT_STRING_JAR

public static final java.lang.String DEPLOYMENT_STRING_JAR
See Also:
Constant Field Values

DEPLOYMENT_STRING_WAR

public static final java.lang.String DEPLOYMENT_STRING_WAR
See Also:
Constant Field Values

DEPLOYMENT_STRING_RAR

public static final java.lang.String DEPLOYMENT_STRING_RAR
See Also:
Constant Field Values

DEPLOYMENT_STRING_DATASOURCE

public static final java.lang.String DEPLOYMENT_STRING_DATASOURCE
See Also:
Constant Field Values

DEPLOYMENT_STRING_JMS

public static final java.lang.String DEPLOYMENT_STRING_JMS
See Also:
Constant Field Values

DEPLOYMENT_STRING_MAILFACTORY

public static final java.lang.String DEPLOYMENT_STRING_MAILFACTORY
See Also:
Constant Field Values

DOMAIN_DEPLOYMENT_STRING_EAR

public static final java.lang.String DOMAIN_DEPLOYMENT_STRING_EAR
See Also:
Constant Field Values

DOMAIN_DEPLOYMENT_STRING_JAR

public static final java.lang.String DOMAIN_DEPLOYMENT_STRING_JAR
See Also:
Constant Field Values

DOMAIN_DEPLOYMENT_STRING_WAR

public static final java.lang.String DOMAIN_DEPLOYMENT_STRING_WAR
See Also:
Constant Field Values

DOMAIN_DEPLOYMENT_STRING_RAR

public static final java.lang.String DOMAIN_DEPLOYMENT_STRING_RAR
See Also:
Constant Field Values
Constructor Detail

WhereAreYou

public WhereAreYou()
Method Detail

initialize

public void initialize(org.apache.struts.action.ActionServlet p_Servlet,
                       javax.servlet.http.HttpServletRequest p_Request)
                throws JonasAdminException
Initialize the properties in only reading.

Parameters:
p_Servlet - The instance of servlet to access to the parameter of the servlet config
p_Request - The request to access to the HTTP informations
Throws:
JonasAdminException

getCurrentJonasServerName

public java.lang.String getCurrentJonasServerName()
Return the current Jonas server name.

Returns:
The name

getCurrentJonasServer

public javax.management.ObjectName getCurrentJonasServer()
Return the ObjectName of the MBean associated to the current Jonas server.

Returns:
The ObjectName

getCurrentDomain

public javax.management.ObjectName getCurrentDomain()
Return the current J2EE domain ObjectName.

Returns:
The ObjectName

getCurrentDomainName

public java.lang.String getCurrentDomainName()
Return the current J2EE domain name.

Returns:
The name

getSelectedNameNode

public java.lang.String getSelectedNameNode()
Return the name of the selected node in the tree.

Returns:
The name

getUrlToRefreshSelectedNode

public java.lang.String getUrlToRefreshSelectedNode(javax.servlet.http.HttpServletRequest p_Request,
                                                    javax.servlet.http.HttpServletResponse p_Response)
Return the URL to refresh the selected node in the tree.

Parameters:
p_Request - HTTP request
p_Response - HTTP response
Returns:
The URL

selectNameNode

public void selectNameNode(java.lang.String p_Name,
                           boolean p_Expand)
Select the node in the tree.

Parameters:
p_Name - The name of node to select
p_Expand - Expand parent branch

getSelectedTreeControlNode

public TreeControlNode getSelectedTreeControlNode()
Return the selected node in the tree.

Returns:
The selected node

isTreeToRefresh

public boolean isTreeToRefresh()
Return the state of current display of tree.

Returns:
True if the current tree is not correctly displaying

setTreeToRefresh

public void setTreeToRefresh(boolean treeToRefresh)
Change the state of current display of tree.

Parameters:
treeToRefresh - True to refresh

refreshServers

public void refreshServers(javax.servlet.http.HttpServletRequest p_Request,
                           java.lang.String serverName)
                    throws ManagementException,
                           JonasAdminException
Refresh all the servers properties.

Parameters:
p_Request - The request to access to the HTTP informations
Throws:
ManagementException - if could not connect to the MBeanServer
JonasAdminException

refreshServers

public void refreshServers(javax.servlet.http.HttpServletRequest p_Request)

refreshCatalina

public void refreshCatalina(javax.servlet.http.HttpServletRequest p_Request)
Refresh the Catalina server properties.

Parameters:
p_Request - The request to access to the HTTP informations

refreshJetty

public void refreshJetty(javax.servlet.http.HttpServletRequest p_Request)
Refresh the Jetty server properties.

Parameters:
p_Request - The request to access to the HTTP informations

refreshJonas

public void refreshJonas(javax.servlet.http.HttpServletRequest p_Request,
                         java.lang.String serverName)
                  throws ManagementException,
                         JonasAdminException
Refresh the managed JOnAS server properties.

Parameters:
p_Request - The request to access to the HTTP informations
Throws:
ManagementException - if could not connect to the MBeanServer
JonasAdminException

toString

public java.lang.String toString()
Return in a string the contents of the instance for each propertie. Debug utility.

Overrides:
toString in class java.lang.Object
Returns:
The string contents

getServletServerName

protected java.lang.String getServletServerName()
                                         throws ManagementException
Return the name of the servlet server.

Returns:
The name of the servlet server.
Throws:
ManagementException

resetCatalina

protected void resetCatalina()
Reset the Catalina server properties.


resetJetty

protected void resetJetty()
Reset the Jetty server properties.


resetJonas

protected void resetJonas()
Reset the JOnAS server properties.


resetDomain

protected void resetDomain()
Reset the domain properties.


getImagesRoot

public java.lang.String getImagesRoot()

getTreeControl

public TreeControl getTreeControl()

setTreeControl

public void setTreeControl(TreeControl treeControl)

isCatalinaServer

public boolean isCatalinaServer()

getCurrentCatalinaServiceName

public java.lang.String getCurrentCatalinaServiceName()

isCurrentJonasServer

public boolean isCurrentJonasServer()

getCurrentJonasDeploymentType

public int getCurrentJonasDeploymentType()

setCurrentJonasDeploymentType

public void setCurrentJonasDeploymentType(int currentJonasDeploymentType)

getApplicationServerPort

public int getApplicationServerPort()

getApplicationContextPath

public java.lang.String getApplicationContextPath()

getCurrentCatalinaDefaultHostName

public java.lang.String getCurrentCatalinaDefaultHostName()

getCurrentCatalinaEngineName

public java.lang.String getCurrentCatalinaEngineName()

getCurrentCatalinaDomainName

public java.lang.String getCurrentCatalinaDomainName()

isJettyServer

public boolean isJettyServer()

getAdminJonasServerName

public java.lang.String getAdminJonasServerName()
Returns:
Returns the adminJonasServerName.

getAdminJonasServerConfDir

public java.lang.String getAdminJonasServerConfDir()