org.opennms.bb.dp.poller.plugins
Class JSDTEventProxy

java.lang.Object
  |
  +--org.opennms.bb.dp.poller.plugins.JSDTEventProxy
All Implemented Interfaces:
EventProxy

public class JSDTEventProxy
extends Object
implements EventProxy

The JSDTEventProxy implements the EventProxy to send an event to the events subsystem via JSDT

Version:
$Revision: 1.2 $
Author:
Sowmya Kumaraswamy, OpenNMS

Field Summary
private  com.sun.media.jsdt.Channel m_channel
          The events source channel
private  com.sun.media.jsdt.Client m_client
          The JSDT client that this identifies itself as
private  String m_clientID
          The JSDT client identifier that the sender wants to use
private  boolean m_receiveSentEvent
          A flag set by the user that indicates if the sender wants to receive the event being sent A 'true' indicates that the sender wants to receive the sent event A 'false' indicates that the sender only wants to send the event, not recieve it
private  com.sun.media.jsdt.Session m_session
          The events JSDT session
 
Constructor Summary
JSDTEventProxy()
          The default constructor is not supported since a JSDT client identifer is a must
JSDTEventProxy(String clientID)
          Constructor
JSDTEventProxy(String clientID, boolean bReceiveSentEvent)
          Constructor
 
Method Summary
private  void jsdtConnect()
          Connect to the events session's source channel - the JSDT exceptions don't have their 'getMessage()' defined - so create a new exception for each
static void main(String[] args)
          Send a test event out to the events source channel
 void send(Event event)
          Implements the EventProxy-> send() method to send the event to the events source channel
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_session

private com.sun.media.jsdt.Session m_session
The events JSDT session

m_client

private com.sun.media.jsdt.Client m_client
The JSDT client that this identifies itself as

m_channel

private com.sun.media.jsdt.Channel m_channel
The events source channel

m_clientID

private String m_clientID
The JSDT client identifier that the sender wants to use

m_receiveSentEvent

private boolean m_receiveSentEvent
A flag set by the user that indicates if the sender wants to receive the event being sent A 'true' indicates that the sender wants to receive the sent event A 'false' indicates that the sender only wants to send the event, not recieve it
Constructor Detail

JSDTEventProxy

public JSDTEventProxy()
               throws UnsupportedOperationException
The default constructor is not supported since a JSDT client identifer is a must
Throws:
UnsupportedOperationException - thrown

JSDTEventProxy

public JSDTEventProxy(String clientID)
               throws com.sun.media.jsdt.JSDTException
Constructor
Parameters:
clientID - the JSDT client identifier
Throws:
com.sun.media.jsdt.JSDTException - thrown if the JSDT communication path cannot be set up

JSDTEventProxy

public JSDTEventProxy(String clientID,
                      boolean bReceiveSentEvent)
               throws com.sun.media.jsdt.JSDTException
Constructor
Parameters:
clientID - the JSDT client identifier
recieveSentEvent - flag indicating if the sent event is also required to be received
Throws:
com.sun.media.jsdt.JSDTException - thrown if the JSDT communication path cannot be set up
Method Detail

jsdtConnect

private void jsdtConnect()
                  throws com.sun.media.jsdt.JSDTException
Connect to the events session's source channel - the JSDT exceptions don't have their 'getMessage()' defined - so create a new exception for each
Throws:
com.sun.media.jsdt.JSDTException - thrown if the JSDT connection does not go throught for any reason

send

public void send(Event event)
          throws EventProxyException
Implements the EventProxy-> send() method to send the event to the events source channel
Specified by:
send in interface EventProxy
Parameters:
event - the event to be sent
Throws:
EventProxyException - thrown if the event cannot be sent for any reason

main

public static void main(String[] args)
Send a test event out to the events source channel