IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.event
Class MirrorHandler

java.lang.Object
  extended bycom.ibm.btt.event.MirrorHandler
All Implemented Interfaces:
Handler

public class MirrorHandler
extends java.lang.Object
implements Handler

The instance of MirrorHandler is a handler that is interested for an event that will be signaled by a BTT Notifier and represents a handler in a external server interested in a remote event.


Field Summary
(package private)  java.util.Hashtable eventList
          A Event List is to store interested events.
 boolean fromClient
          A boolean flag to indicate whehter the handler which mirror handler represents is from client.
(package private)  java.lang.String sessionId
          session ID.
(package private)  java.lang.String tid
          teriminal ID.
 
Constructor Summary
MirrorHandler(java.lang.String aSessionId, java.lang.String anEventName)
          This constructor creates a MirrorHandler with its session id and interested event name.
MirrorHandler(java.lang.String aSessionId, java.lang.String anEventName, boolean fromClient)
          This constructor creates a MirrorHandler with its session id, interested event name , and a boolean flag to indicate whehter the handler is from client.
 
Method Summary
 void addEvent(java.lang.String anEventName)
          Adds an event to the event list.
 Handler dispatchEvent(DSEEventObject anEvent)
          Dispatchs the event anEvent.
protected  java.util.Hashtable getEventList()
          Returns the eventList attribute value.
 java.lang.String getHandlerGlobalID()
          Returns Handler global ID.
 java.lang.String getSessionId()
          Returns the sessionId attribute value.
 java.lang.String getTID()
          Returns the tid attribute value.
 void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName)
          Indicates that the Handler is interested in the event anEventName.
 boolean hasEvents()
          Returns true if there is any event in the events list.
 void removeEvent(java.lang.String anEventName)
          Removes an event from the events list.
 void setHandlerGlobalID(java.lang.String string)
          Sets Handler global ID.
 void setSessionId(java.lang.String aSessionId)
          Sets the sessionId attribute to aSessionId.
 void setTID(java.lang.String aTID)
          Sets the tid attribute to aTID.
 void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName)
          Removes the Mirror Handler from the list of Handlers for the specific event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tid

java.lang.String tid
teriminal ID.


sessionId

java.lang.String sessionId
session ID.


eventList

java.util.Hashtable eventList
A Event List is to store interested events.


fromClient

public boolean fromClient
A boolean flag to indicate whehter the handler which mirror handler represents is from client.

Constructor Detail

MirrorHandler

public MirrorHandler(java.lang.String aSessionId,
                     java.lang.String anEventName)
              throws DSEInvalidRequestException,
                     DSEObjectNotFoundException
This constructor creates a MirrorHandler with its session id and interested event name.

Parameters:
aSessionId - java.lang.String
anEventName - java.lang.String
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

MirrorHandler

public MirrorHandler(java.lang.String aSessionId,
                     java.lang.String anEventName,
                     boolean fromClient)
              throws DSEInvalidRequestException,
                     DSEObjectNotFoundException
This constructor creates a MirrorHandler with its session id, interested event name , and a boolean flag to indicate whehter the handler is from client.

Parameters:
aSessionId - java.lang.String
anEventName - java.lang.String
fromClient - boolean
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException
Method Detail

addEvent

public void addEvent(java.lang.String anEventName)
Adds an event to the event list.

Parameters:
anEventName - java.lang.String

dispatchEvent

public Handler dispatchEvent(DSEEventObject anEvent)
Dispatchs the event anEvent. If the event is going to client, then calls the client/server mechanism sendEvent() method to send the event to a remote workstation. If the event is going to server or external server, then send to message queue.

Specified by:
dispatchEvent in interface Handler
Parameters:
anEvent - com.ibm.btt.event.DSEEventObject
Returns:
com.ibm.btt.event.Handler

getEventList

protected java.util.Hashtable getEventList()
Returns the eventList attribute value.

Returns:
com.ibm.dse.base.Hashtable

getSessionId

public java.lang.String getSessionId()
Returns the sessionId attribute value.

Returns:
java.lang.String

getTID

public java.lang.String getTID()
Returns the tid attribute value.

Returns:
java.lang.String

hasEvents

public boolean hasEvents()
Returns true if there is any event in the events list.

Returns:
boolean

removeEvent

public void removeEvent(java.lang.String anEventName)
Removes an event from the events list.

Parameters:
anEventName - java.lang.String

setSessionId

public void setSessionId(java.lang.String aSessionId)
Sets the sessionId attribute to aSessionId.

Parameters:
aSessionId - java.lang.String

setTID

public void setTID(java.lang.String aTID)
Sets the tid attribute to aTID.

Parameters:
aTID - java.lang.String

handleEvent

public void handleEvent(java.lang.String anEventName,
                        java.lang.String aNotifierName)
                 throws DSEInvalidArgumentException
Indicates that the Handler is interested in the event anEventName. This method should call the EventManager class to register the Handler as interested in the event anEventName from the Notifier aNotifierName. This method throws a DSEInvalidArgumentException.

Specified by:
handleEvent in interface Handler
Parameters:
anEventName - java.lang.String
aNotifierName - java.lang.String
Throws:
DSEInvalidArgumentException

stopHandlingEvent

public void stopHandlingEvent(java.lang.String anEventName,
                              java.lang.String aNotifierName)
                       throws DSEInvalidArgumentException,
                              DSEHandlerNotFoundException
Removes the Mirror Handler from the list of Handlers for the specific event. This method throws a DSEInvalidArgumentException and a DSEHandlerNotFoundException generated by the EventManager removeHandler method.

Specified by:
stopHandlingEvent in interface Handler
Parameters:
anEventName - java.lang.String
aNotifierName - java.lang.String
Throws:
DSEInvalidArgumentException
DSEHandlerNotFoundException

getHandlerGlobalID

public java.lang.String getHandlerGlobalID()
Returns Handler global ID.

Returns:
java.lang.String

setHandlerGlobalID

public void setHandlerGlobalID(java.lang.String string)
Sets Handler global ID.

Parameters:
string - java.lang.String

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005