org.ow2.jasmine.monitoring.eventswitch.extractor
Class JasmineEventDataExtractor

java.lang.Object
  extended by org.ow2.jasmine.monitoring.eventswitch.connectors.EJB3Connector<org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventSLBRemote>
      extended by org.ow2.jasmine.monitoring.eventswitch.extractor.JasmineEventDataExtractor

public class JasmineEventDataExtractor
extends org.ow2.jasmine.monitoring.eventswitch.connectors.EJB3Connector<org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventSLBRemote>

The JASMINe Event Data Extractor is an executable utility class. It will connect to a given JASMINe Event stateless bean, fetch information and print it back on stdio using the CSV similar to mbeancmd's.


Constructor Summary
protected JasmineEventDataExtractor(java.lang.String[] args)
           
 
Method Summary
protected  void extractEvents(org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventEB[] events)
          Extracts and puts on stdio an array of events.
protected  java.util.Date getTime(java.lang.String s)
          Parses a given time using the formatter, defaults to format "long".
static void main(java.lang.String[] args)
          Launches JasmineEventDataExtractor(String[]).
 
Methods inherited from class org.ow2.jasmine.monitoring.eventswitch.connectors.EJB3Connector
connect, disconnect, getBean, setConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JasmineEventDataExtractor

protected JasmineEventDataExtractor(java.lang.String[] args)
                             throws javax.naming.NamingException,
                                    java.text.ParseException,
                                    java.io.IOException
Throws:
javax.naming.NamingException
java.text.ParseException
java.io.IOException
See Also:
main(String[])
Method Detail

main

public static void main(java.lang.String[] args)
                 throws javax.naming.NamingException,
                        java.text.ParseException,
                        java.io.IOException
Launches JasmineEventDataExtractor(String[]). That will connect to the given JASMINe Event stateless bean, requests data that satisfies the given constraints an prints it back on stdio.

Parameters:
args - Accepts three types of variables: - Any number of string constants defined in Context. Example: to set the Context.INITIAL_CONTEXT_FACTORY to factory, use the option: -Context.INITIAL_CONTEXT_FACTORY factory - The "Wrapper.LOOKUP_BEAN" option, the value of which is looked up on the server and set as remote bean. - The "timeformat" option, which defines the time format when defining start and end times. If none specified, it uses the "long" format (seconds since 01/01/1970). - Filtering options. These are: - domain: server domain - server: server name - source: source (for example, MBeanCmd) - probe: probe name - value: probe value - startTimestamp: time to start at - endTimestamp: time to end at If you don't need a certain filtering, don't set it.
Throws:
javax.naming.NamingException - If there's a problem resolving the bean.
java.text.ParseException - If there's a problem parsing times.
java.io.IOException - On configuration file failure.

extractEvents

protected void extractEvents(org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventEB[] events)
Extracts and puts on stdio an array of events.

Parameters:
events - Events to put on stdio.

getTime

protected java.util.Date getTime(java.lang.String s)
                          throws java.text.ParseException
Parses a given time using the formatter, defaults to format "long".

Parameters:
s - Time to parse, can be null (in that case return is null).
Returns:
Parsed time.
Throws:
java.text.ParseException - If parsing fails.


Copyright © 2008 OW2 Consortium. All Rights Reserved.