jpl.mipl.mdms.FileService.komodo.ui.savannah.subscription.handler
Class AbstractSubscriptionHandler

java.lang.Object
  extended by jpl.mipl.mdms.FileService.komodo.ui.savannah.subscription.handler.AbstractSubscriptionHandler
All Implemented Interfaces:
SubscriptionHandler
Direct Known Subclasses:
NotificationPanelHandler, SavannahModelUpdateHandler

public abstract class AbstractSubscriptionHandler
extends Object
implements SubscriptionHandler

Purpose: Default implementation of the methods of the SubscriptionHandler. Subclasses must implement the handleEvent() method.

   Copyright 2005, California Institute of Technology.
   ALL RIGHTS RESERVED.
   U.S. Government Sponsorship acknowledge. 2005.
   
 ============================================================================
 Modification History :
 ----------------------

 Date              Who              What
 ----------------------------------------------------------------------------
 mm/dd/2005        Nick             Initial Release
 ============================================================================
 

Version:
$Id: AbstractSubscriptionHandler.java,v 1.4 2005/03/31 22:02:02 ntt Exp $
Author:
Nicholas Toole (Nicholas.T.Toole@jpl.nasa.gov)

Field Summary
protected  String _classname
          Class name of this handler
protected  Client _client
           
protected  String _id
          Id of this handler
protected  SavannahModel _model
           
protected  String _name
          Name of this handler
 
Fields inherited from interface jpl.mipl.mdms.FileService.komodo.ui.savannah.subscription.handler.SubscriptionHandler
ATTR_CLASS, ATTR_DESC, ATTR_NAME, ATTR_VERSION, ELEMENT_HANDLER_NAME, ELEMENT_PROPERTIES_NAME, ELEMENT_PROPERTY_NAME, PROPERTY_KEYWORD, PROPERTY_VALUE
 
Constructor Summary
AbstractSubscriptionHandler()
           
 
Method Summary
 void destroy()
           
 String getClassname()
          Returns the description of this handler
 String getId()
          Returns the id of this handler
 String getName()
          Returns the name of this handler
abstract  void handleEvent(int taskType, List results)
          Handle method performs operation of the handler.
 void initialize(HandlerInfo info)
          Initializes handler from contents of a DOM element.
 void setAppModel(SavannahModel model)
          Sets the reference to the client object associated with this handler.
 void setClient(Client client)
          Sets the reference to the client object associated with this handler.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_client

protected Client _client

_model

protected SavannahModel _model

_name

protected String _name
Name of this handler


_id

protected String _id
Id of this handler


_classname

protected String _classname
Class name of this handler

Constructor Detail

AbstractSubscriptionHandler

public AbstractSubscriptionHandler()
Method Detail

handleEvent

public abstract void handleEvent(int taskType,
                                 List results)
Handle method performs operation of the handler. Implementors can use the event type as a filter so that handler is only invoked for specific event types.

Specified by:
handleEvent in interface SubscriptionHandler
Parameters:
taskType - Type of task, one of SubscriptionConstants.TASK_{SUBSCRIPTION,NOTIFICATION}
results - List of Result objects

initialize

public void initialize(HandlerInfo info)
                throws Exception
Description copied from interface: SubscriptionHandler
Initializes handler from contents of a DOM element.

Specified by:
initialize in interface SubscriptionHandler
Throws:
Exception - if element is null is does not contain required attributes.

getName

public String getName()
Returns the name of this handler

Specified by:
getName in interface SubscriptionHandler
Returns:
Handler name

getId

public String getId()
Returns the id of this handler

Specified by:
getId in interface SubscriptionHandler
Returns:
Handler id

getClassname

public String getClassname()
Returns the description of this handler

Specified by:
getClassname in interface SubscriptionHandler
Returns:
Handler description

setClient

public void setClient(Client client)
Description copied from interface: SubscriptionHandler
Sets the reference to the client object associated with this handler.

Specified by:
setClient in interface SubscriptionHandler
Parameters:
client - Current client object

setAppModel

public void setAppModel(SavannahModel model)
Description copied from interface: SubscriptionHandler
Sets the reference to the client object associated with this handler.

Specified by:
setAppModel in interface SubscriptionHandler

toString

public String toString()
Overrides:
toString in class Object

destroy

public void destroy()
Specified by:
destroy in interface SubscriptionHandler