eu.scape_project.watch.notification
Class LogNotificationAdaptor

java.lang.Object
  extended by eu.scape_project.watch.notification.LogNotificationAdaptor
All Implemented Interfaces:
NotificationAdaptorInterface, PluginInterface

public class LogNotificationAdaptor
extends Object
implements NotificationAdaptorInterface

Dummy adaptor that simply writes every notification to log.

Author:
Luis Faria

Field Summary
static String PARAM_MESSAGE
          Message parameter key.
 
Constructor Summary
LogNotificationAdaptor()
           
 
Method Summary
 String getDescription()
          Retrieves a short human readable description of this plugin.
 String getName()
          Retrieves the name of this plugin.
 Map<String,DataType> getParametersInfo()
          Get list of parameters and their type.
 PluginType getPluginType()
          Retrieves the type of the plugin.
 Set<String> getSupportedTypes()
          Get Notification types this adaptors supports.
 String getVersion()
          Retrieves the version of this plugin.
 void init()
          Initializes the plugin.
 boolean send(Notification notification)
          Send a notification.
 void shutdown()
          This method is called exactly once before the system shuts down or when the component decides this plugin is not needed anymore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_MESSAGE

public static final String PARAM_MESSAGE
Message parameter key.

See Also:
Constant Field Values
Constructor Detail

LogNotificationAdaptor

public LogNotificationAdaptor()
Method Detail

getSupportedTypes

public Set<String> getSupportedTypes()
Description copied from interface: NotificationAdaptorInterface
Get Notification types this adaptors supports.

Specified by:
getSupportedTypes in interface NotificationAdaptorInterface
Returns:
A set of types.

send

public boolean send(Notification notification)
Description copied from interface: NotificationAdaptorInterface
Send a notification.

Specified by:
send in interface NotificationAdaptorInterface
Parameters:
notification - The notification to send
Returns:
true if notification should be consumed, i.e. should not be relayed to any other adaptor

init

public void init()
          throws PluginException
Description copied from interface: PluginInterface
Initializes the plugin. This method gets called exactly once by the PluginManager before the plugin gets executed. and initializing itself accordingly.

Specified by:
init in interface PluginInterface
Throws:
PluginException - if something goes wrong during the initialization process.

shutdown

public void shutdown()
              throws PluginException
Description copied from interface: PluginInterface
This method is called exactly once before the system shuts down or when the component decides this plugin is not needed anymore. The plugin is responsible for cleaning up and freeing all neeeded resources.

Specified by:
shutdown in interface PluginInterface
Throws:
PluginException - if something goes wrong.

getName

public String getName()
Description copied from interface: PluginInterface
Retrieves the name of this plugin.

Specified by:
getName in interface PluginInterface
Returns:
the name.

getVersion

public String getVersion()
Description copied from interface: PluginInterface
Retrieves the version of this plugin.

Specified by:
getVersion in interface PluginInterface
Returns:
the version.

getDescription

public String getDescription()
Description copied from interface: PluginInterface
Retrieves a short human readable description of this plugin.

Specified by:
getDescription in interface PluginInterface
Returns:
the description.

getPluginType

public PluginType getPluginType()
Description copied from interface: PluginInterface
Retrieves the type of the plugin.

Specified by:
getPluginType in interface PluginInterface
Returns:
the plugin type.

getParametersInfo

public Map<String,DataType> getParametersInfo()
Description copied from interface: NotificationAdaptorInterface
Get list of parameters and their type. TODO add parameter description, mandatory/optional flag, readable/password flag, etc.

Specified by:
getParametersInfo in interface NotificationAdaptorInterface
Returns:
A map with possible parameter names as key and the data type as value.


Copyright © 2012. All Rights Reserved.