org.rhq.plugins.jbossas.util
Class AbstractMessagingConfigurationEditor

java.lang.Object
  extended by org.rhq.plugins.jbossas.util.AbstractMessagingConfigurationEditor
Direct Known Subclasses:
JBossMessagingConfigurationEditor, JMSConfigurationEditor

public class AbstractMessagingConfigurationEditor
extends Object

Common base class for MessagingConfig related stuff

Author:
Heiko W. Rupp

Field Summary
protected static String ATTRIBUTE
           
protected  String code
           
protected  org.rhq.core.domain.configuration.Configuration config
          Configuration object for the resource.
protected  CreateResourceReport createReport
           
protected static String DEPENDS
           
protected  File deploymentFile
          File object of the XML file that will store the resource's configuration values.
protected static org.apache.commons.logging.Log LOG
           
protected  org.jdom.Element root
          Root Element of the XML File.
protected  String rootElementString
          Root Element of the xml file.
protected  String securityConfig
           
protected  String type
          Holds the type of JMS
protected  ConfigurationUpdateReport updateReport
           
 
Constructor Summary
AbstractMessagingConfigurationEditor()
           
 
Method Summary
protected  void addNameAttributeToMBeanElement(org.jdom.Element mbeanElement, String name)
           
protected  void bindSimplePropertiesToConfiguration(String[] properties, String elementName, String attributeName, org.jdom.Element componentElement)
           
protected  void bindSimplePropertiesToXML(String elementName, String attributeName, org.jdom.Element componentElement)
          Takes the child elements of the componentElement and loops through them to find the particular property via the looped elements attribute and creates the PropertySimple objects to attach to the @see Configuration object
 void deleteComponent(File deploymentFile, String name)
           
protected  org.jdom.Element findComponentElement(String name)
          Finds the main Element object that holds all the configuration for the particular component.
protected  org.jdom.Element findSecurityConf(org.jdom.Element componentElement)
          Gets the Element for the component that holds the Security Confs for Roles.
protected  String getNameProperty()
           
 String getRootElementString()
          Getter method
 String getType()
          Getter method
 org.rhq.core.domain.configuration.Configuration loadConfiguration(File file, String name)
           
protected  void loadNameProperty(org.jdom.Element mbeanElement)
           
 void setRootElementString(String rootElement)
          Setter method
 void setType(String type)
          Setter method
protected  void updateFile(org.jdom.Document doc)
          Updates the file.
protected  void updateIfNameChanged(org.jdom.Element mbeanElement)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG

DEPENDS

protected static final String DEPENDS
See Also:
Constant Field Values

type

protected String type
Holds the type of JMS


code

protected String code

rootElementString

protected String rootElementString
Root Element of the xml file. The component should be a child element of the root element


root

protected org.jdom.Element root
Root Element of the XML File. Always check for NPE in your code. This is assigned in the main interface methods. There are not getters or setters for this attribute.


config

protected org.rhq.core.domain.configuration.Configuration config
Configuration object for the resource. Always check for NPE in your code. Configuration object is assigned in the update methods of the public interface, so there are no setters or getters needed The configuration is retrieved directly from either the @see CreateResourceReport or

See Also:
objects

createReport

protected CreateResourceReport createReport

updateReport

protected ConfigurationUpdateReport updateReport

deploymentFile

protected File deploymentFile
File object of the XML file that will store the resource's configuration values. Always check for NPE in your code. The File object is assigned in the public interface methods, so there are no setters or getters needed. The File object is passed in through the APIs parameters


securityConfig

protected String securityConfig

ATTRIBUTE

protected static final String ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

AbstractMessagingConfigurationEditor

public AbstractMessagingConfigurationEditor()
Method Detail

deleteComponent

public void deleteComponent(File deploymentFile,
                            String name)

bindSimplePropertiesToXML

protected void bindSimplePropertiesToXML(String elementName,
                                         String attributeName,
                                         org.jdom.Element componentElement)
Takes the child elements of the componentElement and loops through them to find the particular property via the looped elements attribute and creates the PropertySimple objects to attach to the @see Configuration object

Parameters:
elementName - String representing the type of Element to get.
attributeName - What is the property name to find within the children
componentElement - Element representing this Topic or Queue

bindSimplePropertiesToConfiguration

protected void bindSimplePropertiesToConfiguration(String[] properties,
                                                   String elementName,
                                                   String attributeName,
                                                   org.jdom.Element componentElement)

findComponentElement

protected org.jdom.Element findComponentElement(String name)
Finds the main Element object that holds all the configuration for the particular component. For example in JMS the tag will be with a name attribute for the particular Topic or Queue name

Parameters:
name - String Topic or Queue name
Returns:
The Element object that holds the entire configuration.

findSecurityConf

protected org.jdom.Element findSecurityConf(org.jdom.Element componentElement)
Gets the Element for the component that holds the Security Confs for Roles.

Parameters:
componentElement - components main Element
Returns:
SecurityConf Element

loadNameProperty

protected void loadNameProperty(org.jdom.Element mbeanElement)

getNameProperty

protected String getNameProperty()

updateIfNameChanged

protected void updateIfNameChanged(org.jdom.Element mbeanElement)

addNameAttributeToMBeanElement

protected void addNameAttributeToMBeanElement(org.jdom.Element mbeanElement,
                                              String name)

updateFile

protected void updateFile(org.jdom.Document doc)
                   throws org.jdom.JDOMException,
                          IOException
Updates the file.

Parameters:
doc - JDom Document object for the file
Throws:
org.jdom.JDOMException - If JDOM cannot process the Document object
IOException - If there is an exception when dealing with the File object.

getRootElementString

public String getRootElementString()
Getter method

Returns:
String root Element name. i.e. "datasources"

setRootElementString

public void setRootElementString(String rootElement)
Setter method

Parameters:
rootElement - root element name. i.e. "datasources"

getType

public String getType()
Getter method

Returns:
String component type. i.e. "local-tx-datasource"

setType

public void setType(String type)
Setter method

Parameters:
type - component type. i.e. "local-tx-datasource"

loadConfiguration

public org.rhq.core.domain.configuration.Configuration loadConfiguration(File file,
                                                                         String name)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.