eu.scape_project.watch.notification
Class NotificationService

java.lang.Object
  extended by eu.scape_project.watch.notification.NotificationService

public final class NotificationService
extends Object

Singleton that allows sending of notifications.

Author:
Luis Faria

Method Summary
 boolean addAdaptor(NotificationAdaptorInterface adaptor)
          Add a new notification adaptor and update index.
 Set<NotificationAdaptorInterface> getAdaptors()
           
static NotificationService getInstance()
          Get the singleton instance.
 Map<String,DataType> getTypeParameters(String type)
          Get all possible parameters for a notification type.
 Set<String> getTypes()
           
 boolean removeAdaptor(NotificationAdaptorInterface adaptor)
          Remove an existing adaptor, updating index.
 boolean send(Notification notification)
          Send a notification by all adaptors that support the notification type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NotificationService getInstance()
Get the singleton instance.

Returns:
The existing instance if exists or a creates a new one.

addAdaptor

public boolean addAdaptor(NotificationAdaptorInterface adaptor)
Add a new notification adaptor and update index.

Parameters:
adaptor - The notification adaptor to add.
Returns:
true if did not already contain the specified adaptor

removeAdaptor

public boolean removeAdaptor(NotificationAdaptorInterface adaptor)
Remove an existing adaptor, updating index.

Parameters:
adaptor - The adaptor to remove
Returns:
true if contained the specified adaptor

getAdaptors

public Set<NotificationAdaptorInterface> getAdaptors()

getTypes

public Set<String> getTypes()

getTypeParameters

public Map<String,DataType> getTypeParameters(String type)
Get all possible parameters for a notification type.

Parameters:
type - The notification type.
Returns:
A map will all the parameters.

send

public boolean send(Notification notification)
Send a notification by all adaptors that support the notification type.

Parameters:
notification - The notification to send
Returns:
true if notification sent by one or more adaptors


Copyright © 2012. All Rights Reserved.