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

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

public abstract class EditJoramBaseAction
extends BaseDeployAction

Author:
Adriana Danes

Field Summary
 
Fields inherited from class org.ow2.jonas.webapp.jonasadmin.JonasBaseAction
DEPTH_DOMAIN, DEPTH_SERVER, GLOBAL_ERROR_FORWARD, 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 String currentServerId(ObjectName destinationOn)
          Determine the server Id of a destination.
protected  ArrayList getBaseItemList(List inputList, ObjectName destOn, String serverName)
          Treat a list (Vector) of Joram user names
protected  ArrayList getBaseItemList(List inputList, String serverName)
          Treat a list (Vector) of Joram user items (example: User[anonymous]:#0.0.1035)
 ItemDestination getDestinationItem(String joramAdminDestination, String serverName)
          Create a ItemDestination object from a String structured as follows: type=queue/topic, name=destName, id=#x.y.z
 ObjectName getDestinationOn(String name, String serverId, String serverName)
           
protected  ObjectName getDmq(String dmqId, String serverName)
           
protected  ObjectName getDmqOn(String dmqId, String jonasServerName)
           
 ObjectName getDmqOn(String name, String serverId, String serverName)
           
protected  String getPathToExportRepository()
           
protected  String getPathToReloadJoramAdmin()
          Get the path to the joramAdmin.xml file
protected  String getServerId(String location)
          Return server Id
protected  void getStatistics(ObjectName destOn, MonitoringDestForm oMonitForm, DestinationForm oForm, String serverName)
           
protected  ItemUser getUserItem(String joramAdminUser, String serverName)
          Create a ItemUser object from a String structured as follows: User[anonymous]:#0.0.1035
protected  String getUserName(String userId, String jonasServerName)
          Return the name of the User corresponding to a given agent id
protected  ObjectName getUserOn(String userName, Short serverId, String serverName)
          * Return the ObjectName of the User MBean corresponding to a given user
protected  boolean hasDeps(String pDestName, String jonasServerName)
           
protected  void initRefs(String domainName, String jonasServerName)
           
protected  void populate(DestinationForm p_Form)
           
protected  void populateDestination(ObjectName destOn, DestinationForm oForm, String serverName)
           
 void printDestination(ItemDestination dest, String serverName)
           
protected  org.apache.struts.action.ActionForward treatError(Throwable pThrowable, org.apache.struts.action.ActionMapping pMapping, HttpServletRequest pRequest)
          Treat specific case where Joram RAR was unloaded
protected  void updateReadablesWriteables(DestinationForm pForm, String jonasServerName)
           
 
Methods inherited from class org.ow2.jonas.webapp.jonasadmin.deploy.BaseDeployAction
deploy, deployDataSource, deployMailFactory, deployModule, getCurrentJonasDeployment, getDomainDeploymentMethodName, getDomainUploadDeployMethodName, getForwardEdit, getListDeployableFiles, getListDeployedFiles, isConfigurable, isDeployment, isDomain, isModule, refreshJoramTree, refreshMBeansTree, refreshServiceTree, refreshTree, refreshWebServiceTree, removeFile, removeModule, runGC, setCurrentJonasDeployment, undeploy, undeployDataSource, undeployMailFactory, undeployModule
 
Methods inherited from class org.ow2.jonas.webapp.jonasadmin.JonasBaseAction
addGlobalError, execute, executeAction, getAttributes, getBooleanAttribute, getBooleanAttribute, getBooleanAttribute, getIntAttribute, getIntegerAttribute, getIntegerAttribute, getIntegerAttribute, getJonasBase, getListAttribute, getLongAttribute, getLongAttribute, getLongAttribute, getNameForProvider, getPropsFromString, getServerItem, getShortAttribute, getStringArrayAttribute, getStringAttribute, getStringAttribute, getStringAttribute, getTreeBranchName, initialize, invoke, isActive, refreshDomainDeployTree, refreshServicesTree, 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(Throwable pThrowable,
                                                            org.apache.struts.action.ActionMapping pMapping,
                                                            HttpServletRequest pRequest)
Treat specific case where Joram RAR was unloaded

Parameters:
t - Exception to treat
pMapping - provided by executeAction
pRequest - provided by executeAction
Returns:

getPathToExportRepository

protected String getPathToExportRepository()

getPathToReloadJoramAdmin

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

Returns:

getDmqOn

public ObjectName getDmqOn(String name,
                           String serverId,
                           String serverName)
                    throws MalformedObjectNameException
Throws:
MalformedObjectNameException

getDestinationOn

public ObjectName getDestinationOn(String name,
                                   String serverId,
                                   String serverName)
                            throws 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:
MalformedObjectNameException

getDmqOn

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

getDestinationItem

public ItemDestination getDestinationItem(String joramAdminDestination,
                                          String serverName)
                                   throws 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:
MalformedObjectNameException - could not construct destination ObjectName

getUserItem

protected ItemUser getUserItem(String joramAdminUser,
                               String serverName)
                        throws 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:
MalformedObjectNameException

getUserOn

protected ObjectName getUserOn(String userName,
                               Short serverId,
                               String serverName)
                        throws 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:
MalformedObjectNameException

getUserName

protected String getUserName(String userId,
                             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,
                             String serverName)

initRefs

protected void initRefs(String domainName,
                        String jonasServerName)

hasDeps

protected boolean hasDeps(String pDestName,
                          String jonasServerName)

getServerId

protected String getServerId(String location)
Return server Id

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

currentServerId

public static String currentServerId(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(ObjectName destOn,
                                   DestinationForm oForm,
                                   String serverName)
                            throws MalformedObjectNameException
Throws:
MalformedObjectNameException

getBaseItemList

protected ArrayList getBaseItemList(List inputList,
                                    ObjectName destOn,
                                    String serverName)
                             throws 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:
MalformedObjectNameException

getDmq

protected ObjectName getDmq(String dmqId,
                            String serverName)

getBaseItemList

protected ArrayList getBaseItemList(List inputList,
                                    String serverName)
                             throws MalformedObjectNameException
Treat a list (Vector) of Joram user items (example: User[anonymous]:#0.0.1035)

Parameters:
inputList - list of Joram user items
Returns:
a list of user item objects (ItemUser type)
Throws:
MalformedObjectNameException

getStatistics

protected void getStatistics(ObjectName destOn,
                             MonitoringDestForm oMonitForm,
                             DestinationForm oForm,
                             String serverName)

populate

protected void populate(DestinationForm p_Form)
                 throws Exception
Throws:
Exception

updateReadablesWriteables

protected void updateReadablesWriteables(DestinationForm pForm,
                                         String jonasServerName)


Copyright © 2010 OW2 Consortium. All Rights Reserved.