org.apache.geronimo.monitoring.snapshot
Class SnapshotConfigXMLBuilder

java.lang.Object
  extended by org.apache.geronimo.monitoring.snapshot.SnapshotConfigXMLBuilder

public class SnapshotConfigXMLBuilder
extends Object

In charge of dealing with the XML processing of the snapshot's data.


Constructor Summary
SnapshotConfigXMLBuilder()
           
 
Method Summary
static boolean addMBeanName(String mbeanName)
          Removes from the snapshot-config.xml a configuration element in order to persistently keep track of all user requested statistics.
static void checkXMLExists()
          Ensures that there is an existing XML file.
static Document createDocument()
          Creates an instance of a Document and returns it
static void ensureMonitorDir()
          Checks to see if the GERONIMO_HOME/var/monitoring/ directory was made.
static String getAttributeValue(String key)
          Returns the value of the configuration attribute, defined by the key
static ArrayList<String> getMBeanNames()
           
static Document openDocument()
          Parses the XML document specified by the private member 'pathToXML' and stores the information in the a Document object
static boolean removeMBeanName(String mbeanName)
          Adds to the snapshot-config.xml another configuration element in order to persistently keep track of all user requested statistics.
static void saveDocument(Document document, String path)
          Write the document object to the file location specified by the path.
static void saveDuration(long duration)
          Saves the duration of the snapshot as a configuration attribute
static void saveRetention(int retention)
          Saves the retention of the snapshot as a configuration attribute
static Document setUpDocument(Document document)
          Prepares the root element for a document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnapshotConfigXMLBuilder

public SnapshotConfigXMLBuilder()
Method Detail

getMBeanNames

public static ArrayList<String> getMBeanNames()
Returns:
A list of all mbean names that have been previously saved. These mbean names are those to keep track of for per snapshot.

removeMBeanName

public static boolean removeMBeanName(String mbeanName)
Adds to the snapshot-config.xml another configuration element in order to persistently keep track of all user requested statistics. If there is a duplicate, nothing will be done.


addMBeanName

public static boolean addMBeanName(String mbeanName)
Removes from the snapshot-config.xml a configuration element in order to persistently keep track of all user requested statistics. If there does not exist an instance of the mbeanNAme, nothing will be done.


saveDuration

public static void saveDuration(long duration)
Saves the duration of the snapshot as a configuration attribute

Parameters:
duration -

saveRetention

public static void saveRetention(int retention)
Saves the retention of the snapshot as a configuration attribute

Parameters:
retention -

getAttributeValue

public static String getAttributeValue(String key)
                                throws Exception
Returns the value of the configuration attribute, defined by the key

Parameters:
key -
Returns:
Throws:
Exception

checkXMLExists

public static void checkXMLExists()
Ensures that there is an existing XML file. Creates one if there does not exist one already.


setUpDocument

public static Document setUpDocument(Document document)
Prepares the root element for a document.


createDocument

public static Document createDocument()
Creates an instance of a Document and returns it


saveDocument

public static void saveDocument(Document document,
                                String path)
Write the document object to the file location specified by the path.


openDocument

public static Document openDocument()
Parses the XML document specified by the private member 'pathToXML' and stores the information in the a Document object


ensureMonitorDir

public static void ensureMonitorDir()
Checks to see if the GERONIMO_HOME/var/monitoring/ directory was made. If not, the method creates it.



Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.