org.objectweb.jonas.webapp.jonasadmin.joramplatform
Class EditJoramBaseAction

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended byorg.objectweb.jonas.webapp.jonasadmin.JonasBaseAction
          extended byorg.objectweb.jonas.webapp.jonasadmin.deploy.BaseDeployAction
              extended byorg.objectweb.jonas.webapp.jonasadmin.joramplatform.EditJoramBaseAction
Direct Known Subclasses:
AddJoramReaderAction, AddJoramWriterAction, ApplyJoramQueueAction, ApplyJoramReaderAction, ApplyJoramTopicAction, ApplyJoramWriterAction, CreateJoramDestinationAction, CreateJoramLocalDestinationAction, CreateJoramUserAction, EditJoramDestinationAction, EditJoramPlatformAction, EditJoramQueueAction, EditJoramRemoteServerAction, EditJoramResourceAdapterAction, EditJoramServerAction, EditJoramTopicAction, EditJoramUserAction, ExportRepository, ListJoramServersAction, ListLocalDestinationsAction, ListRemoteDestinationsAction, ReloadJoramAdmin

public abstract class EditJoramBaseAction
extends BaseDeployAction

Author:
Adriana Danes

Field Summary
 
Fields inherited from class org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction
DEPTH_DOMAIN, DEPTH_SERVER, m_Errors, m_Resources, m_Session, m_WhereAreYou
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
EditJoramBaseAction()
           
 
Method Summary
static java.lang.String currentServerId(javax.management.ObjectName destinationOn)
          Determine the server Id of a destination.
protected  java.util.ArrayList getBaseItemList(java.util.List inputList, javax.management.ObjectName destOn, java.lang.String serverName)
          Treat a list (Vector) of Joram user names
 ItemDestination getDestinationItem(java.lang.String joramAdminDestination, java.lang.String serverName)
          Create a ItemDestination object from a String structured as follows: type=queue/topic, name=destName, id=#x.y.z
 javax.management.ObjectName getDestinationOn(java.lang.String name, java.lang.String serverId, java.lang.String serverName)
           
protected  javax.management.ObjectName getDmqOn(java.lang.String dmqId, java.lang.String jonasServerName)
           
 javax.management.ObjectName getDmqOn(java.lang.String name, java.lang.String serverId, java.lang.String serverName)
           
protected  java.lang.String getPathToExportRepository()
           
protected  java.lang.String getPathToReloadJoramAdmin()
          Get the path to the joramAdmin.xml file
protected  java.lang.String getServerId(java.lang.String location)
          Return server Id
protected  void getStatistics(javax.management.ObjectName destOn, MonitoringDestForm oMonitForm, DestinationForm oForm, java.lang.String serverName)
           
protected  ItemUser getUserItem(java.lang.String joramAdminUser, java.lang.String serverName)
          Create a ItemUser object from a String structured as follows: User[anonymous]:#0.0.1035
protected  java.lang.String getUserName(java.lang.String userId, java.lang.String jonasServerName)
          Return the name of the User corresponding to a given agent id
protected  javax.management.ObjectName getUserOn(java.lang.String userName, java.lang.Short serverId, java.lang.String serverName)
          Return the ObjectName of the User MBean corresponding to a given user
protected  boolean hasDeps(java.lang.String pDestName, java.lang.String jonasServerName)
           
protected  void initRefs(java.lang.String jonasServerName)
           
protected  void populate(DestinationForm p_Form)
           
protected  void populateDestination(javax.management.ObjectName destOn, DestinationForm oForm, java.lang.String serverName)
           
 void printDestination(ItemDestination dest, java.lang.String serverName)
           
protected  org.apache.struts.action.ActionForward treatError(java.lang.Throwable pThrowable, org.apache.struts.action.ActionMapping pMapping, javax.servlet.http.HttpServletRequest pRequest)
          Treat specific case where Joram RAR was unloaded
protected  void updateReadablesWriteables(DestinationForm pForm, java.lang.String jonasServerName)
           
 
Methods inherited from class org.objectweb.jonas.webapp.jonasadmin.deploy.BaseDeployAction
deploy, deployDataSource, deployMailFactory, getCurrentJonasDeployment, getDomainDeploymentMethodName, getDomainUploadDeployMethodName, getForwardEdit, getListDeployableFiles, getListDeployedFiles, isConfigurable, isDomain, isModule, refreshJoramTree, refreshMBeansTree, refreshServiceTree, refreshTree, refreshWebServiceTree, removeFile, runGC, setCurrentJonasDeployment, undeploy, undeployDataSource, undeployMailFactory
 
Methods inherited from class org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction
addGlobalError, execute, executeAction, getBooleanAttribute, getBooleanAttribute, getBooleanAttribute, getIntegerAttribute, getIntegerAttribute, getIntegerAttribute, getJonasBase, getListAttribute, getLongAttribute, getLongAttribute, getLongAttribute, getPropsFromString, getShortAttribute, getStringArrayAttribute, getStringAttribute, getStringAttribute, getStringAttribute, getTreeBranchName, initialize, invoke, refreshDomainDeployTree, refreshDomainMonitoringTree, refreshServerTree, removeChar, setBooleanAttribute, setBooleanAttribute, setIntegerAttribute, setIntegerAttribute, setIntegerAttribute, setLongAttribute, setLongAttribute, setShortAttribute, setStringAttribute, setStringAttribute, setStringAttribute, toStringBooleanAttribute, toStringIntegerAttribute, toStringLongAttribute, toStringShortAttribute
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditJoramBaseAction

public EditJoramBaseAction()
Method Detail

treatError

protected org.apache.struts.action.ActionForward treatError(java.lang.Throwable pThrowable,
                                                            org.apache.struts.action.ActionMapping pMapping,
                                                            javax.servlet.http.HttpServletRequest pRequest)
Treat specific case where Joram RAR was unloaded

Parameters:
pMapping - provided by executeAction
pRequest - provided by executeAction
Returns:

getPathToExportRepository

protected java.lang.String getPathToExportRepository()

getPathToReloadJoramAdmin

protected java.lang.String getPathToReloadJoramAdmin()
Get the path to the joramAdmin.xml file

Returns:

getDmqOn

public javax.management.ObjectName getDmqOn(java.lang.String name,
                                            java.lang.String serverId,
                                            java.lang.String serverName)
                                     throws javax.management.MalformedObjectNameException
Throws:
javax.management.MalformedObjectNameException

getDestinationOn

public javax.management.ObjectName getDestinationOn(java.lang.String name,
                                                    java.lang.String serverId,
                                                    java.lang.String serverName)
                                             throws javax.management.MalformedObjectNameException
Parameters:
name - the destination's admin name or name (agent id based)
serverName - jonas server name being managed
Returns:
the ObjectName of the destination's MBean
Throws:
javax.management.MalformedObjectNameException

getDmqOn

protected javax.management.ObjectName getDmqOn(java.lang.String dmqId,
                                               java.lang.String jonasServerName)
                                        throws javax.management.MalformedObjectNameException
Parameters:
dmqId - id=#x.y.z
Returns:
Throws:
javax.management.MalformedObjectNameException

getDestinationItem

public ItemDestination getDestinationItem(java.lang.String joramAdminDestination,
                                          java.lang.String serverName)
                                   throws javax.management.MalformedObjectNameException
Create a ItemDestination object from a String structured as follows: type=queue/topic, name=destName, id=#x.y.z

Parameters:
joramAdminDestination - String containing destination description
serverName - the name of the JOnAS server to which the current JORAM server is connected
Returns:
ItemDestination containing name, type, id and ObjectName of the MBean associated to the corresponding destination
Throws:
javax.management.MalformedObjectNameException - could not construct destination ObjectName

getUserItem

protected ItemUser getUserItem(java.lang.String joramAdminUser,
                               java.lang.String serverName)
                        throws javax.management.MalformedObjectNameException
Create a ItemUser object from a String structured as follows: User[anonymous]:#0.0.1035

Parameters:
joramAdminUser - String containing user description
serverName - the name of the JOnAS server to which the current JORAM server is connected
Returns:
ItemUser containing name and ObjectName of the MBean associated to the corresponding user
Throws:
javax.management.MalformedObjectNameException

getUserOn

protected javax.management.ObjectName getUserOn(java.lang.String userName,
                                                java.lang.Short serverId,
                                                java.lang.String serverName)
                                         throws javax.management.MalformedObjectNameException
Return the ObjectName of the User MBean corresponding to a given user

Parameters:
userName - the user's name
serverId - the JORAM server's Id
serverName - the name of the JOnAS server to which the current JORAM server is connected
Returns:
the Objectname of the User MBean having the ProxyId attribute equal to the userId
Throws:
javax.management.MalformedObjectNameException

getUserName

protected java.lang.String getUserName(java.lang.String userId,
                                       java.lang.String jonasServerName)
Return the name of the User corresponding to a given agent id

Parameters:
userId - Agent id for a user (#x.y.z.)
jonasServerName - the name of the JOnAS server to which the current JORAM server is connected
Returns:
the value of the name attribute of the User MBean having the ProxyId attribute equal to the userId

printDestination

public void printDestination(ItemDestination dest,
                             java.lang.String serverName)

initRefs

protected void initRefs(java.lang.String jonasServerName)

hasDeps

protected boolean hasDeps(java.lang.String pDestName,
                          java.lang.String jonasServerName)

getServerId

protected java.lang.String getServerId(java.lang.String location)
Return server Id

Parameters:
location - String having this form : server#id
Returns:
id

currentServerId

public static java.lang.String currentServerId(javax.management.ObjectName destinationOn)
Determine the server Id of a destination.

Parameters:
destinationOn - the ObjectName destination's MBean. The 'loaction' key has the following structure : server#y. The server id to be returned is "y"
Returns:
server id

populateDestination

protected void populateDestination(javax.management.ObjectName destOn,
                                   DestinationForm oForm,
                                   java.lang.String serverName)
                            throws javax.management.MalformedObjectNameException
Throws:
javax.management.MalformedObjectNameException

getBaseItemList

protected java.util.ArrayList getBaseItemList(java.util.List inputList,
                                              javax.management.ObjectName destOn,
                                              java.lang.String serverName)
                                       throws javax.management.MalformedObjectNameException
Treat a list (Vector) of Joram user names

Parameters:
inputList - list of Joram user names
destOn - the ObjectName corresponding to the destination's MBean
Returns:
a list of user item objects (ItemUser type)
Throws:
javax.management.MalformedObjectNameException

getStatistics

protected void getStatistics(javax.management.ObjectName destOn,
                             MonitoringDestForm oMonitForm,
                             DestinationForm oForm,
                             java.lang.String serverName)

populate

protected void populate(DestinationForm p_Form)
                 throws java.lang.Exception
Throws:
java.lang.Exception

updateReadablesWriteables

protected void updateReadablesWriteables(DestinationForm pForm,
                                         java.lang.String jonasServerName)