fr.cnes.sitools.notification.business
Class NotificationManager

java.lang.Object
  extended by fr.cnes.sitools.notification.business.NotificationManager

public class NotificationManager
extends java.lang.Object

Release 1 : manage notification on DELETE only Release 2 : manage POST / PUT

Author:
jp.boignard (AKKA Technologies)

Constructor Summary
NotificationManager(NotificationStore store)
          Notification Manager
 
Method Summary
 void addObserver(java.lang.String observableUUID, RestletObserver observer)
          Add an observer
static Notification getObject(org.restlet.representation.Representation representation)
          Gets Notification object
static org.restlet.representation.Representation getRepresentation(Notification notification, org.restlet.data.MediaType media, org.restlet.Context context)
          Representation of a notification
 NotificationStore getStore()
          Gets the store value
 void notifyObservers(org.restlet.Context context, java.lang.String observableUUID, Notification notification)
          Used by NotificationResource
 void removeObserver(java.lang.String observableUUID, java.lang.String observerUUID)
          Remove an observer
 void setStore(NotificationStore store)
          Sets the value of store
 void triggerEvent(org.restlet.Context context, java.lang.String observable, Notification notification)
          Calls trigger resource registered for this event
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationManager

public NotificationManager(NotificationStore store)
Notification Manager

Parameters:
store - NotificationStore
Method Detail

getStore

public final NotificationStore getStore()
Gets the store value

Returns:
the store

setStore

public final void setStore(NotificationStore store)
Sets the value of store

Parameters:
store - the store to set

getRepresentation

public static org.restlet.representation.Representation getRepresentation(Notification notification,
                                                                          org.restlet.data.MediaType media,
                                                                          org.restlet.Context context)
Representation of a notification

Parameters:
notification - Notification object
media - Restlet MediaType
context - a Restlet Context
Returns:
Representation

notifyObservers

public final void notifyObservers(org.restlet.Context context,
                                  java.lang.String observableUUID,
                                  Notification notification)
Used by NotificationResource

Parameters:
context - Restlet Context
observableUUID - Observable unique identifier
notification - Notification object to send to observers

addObserver

public final void addObserver(java.lang.String observableUUID,
                              RestletObserver observer)
Add an observer

Parameters:
observableUUID - UUID of the observable
observer - the restlet observer

removeObserver

public final void removeObserver(java.lang.String observableUUID,
                                 java.lang.String observerUUID)
Remove an observer

Parameters:
observableUUID - UUID of the observable
observerUUID - UUID of the observer

triggerEvent

public final void triggerEvent(org.restlet.Context context,
                               java.lang.String observable,
                               Notification notification)
Calls trigger resource registered for this event

Parameters:
context - RESTlet context
observable - the observable to trigger
notification - notification sent

getObject

public static Notification getObject(org.restlet.representation.Representation representation)
Gets Notification object

Parameters:
representation - Notification representation
Returns:
Notification object


Copyright © 2010-2013 CNES. All Rights Reserved.