edu.uci.isr.yancees
Class SubscriptionFacade

java.lang.Object
  extended by edu.uci.isr.yancees.SubscriptionFacade

public class SubscriptionFacade
extends java.lang.Object

This is the subscriber façade for publishing and subscribing events to Yancees. It performs all necessary operations with both notification and subscription managers. It also invokes the appropriate output filters if they are installed This class stays behind the YanceesServer class


Nested Class Summary
 class SubscriptionFacade.SubscriptionMediator
          The subscriber mediator receives notifications from the plug-ins and forward them to their specific subscribers.
 
Field Summary
protected  boolean outputFiltersInstalled
           
 
Method Summary
protected static SubscriptionFacade getInstance()
           
protected  void installOutputFilters(FilterManagerInterface filterMan)
          Installs the input queue managed by filterManager in this API
protected  void setNotificationManger(NotificationManager nm)
          Used by the Yancees façade, during bootstrap, to register a notification manager component
protected  void setSubscriptionManager(SubscriptionManager sm)
          Used by the Yancees façade, during bootstrap, to register the subscription manager component
 void subscribe(SubscriptionInterface sub, SubscriberInterface si)
          look for the tag on the message extract the and subtrees parse the and extract the plug-in evaluation tree parse the part if any.
 void unsubscribe(SubscriberInterface si)
          Removes all the subscriptions associated to the provided subscriber
 void unsubscribe(SubscriberInterface si, MessageInterface sub)
          Removes all the subscriptions associated to the provided subscriber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputFiltersInstalled

protected boolean outputFiltersInstalled
Method Detail

getInstance

protected static SubscriptionFacade getInstance()

installOutputFilters

protected void installOutputFilters(FilterManagerInterface filterMan)
Installs the input queue managed by filterManager in this API

Parameters:
filterManager - is the outputFilterManager to be used

subscribe

public void subscribe(SubscriptionInterface sub,
                      SubscriberInterface si)
               throws YanceesException
look for the tag on the message extract the and subtrees parse the and extract the plug-in evaluation tree parse the part if any. If it does not exist, the default notification policy is used. When parsing the notification, inform the parsed tree so the NotificationManager can connect it to its selected policy.

Parameters:
sub - is a message having and optional part.
si - is a callback interface of the subscriber.
Throws:
YanceesException

unsubscribe

public void unsubscribe(SubscriberInterface si)
                 throws YanceesException
Removes all the subscriptions associated to the provided subscriber

Parameters:
si - the callbabk interface of the subscriber
Throws:
YanceesException - in case there is no subscriptions associated to this subscriber

unsubscribe

public void unsubscribe(SubscriberInterface si,
                        MessageInterface sub)
                 throws YanceesException
Removes all the subscriptions associated to the provided subscriber

Parameters:
si - the callbabk interface of the subscriber
sub - the specific subscription to be discontinued
Throws:
YanceesException - in case there is no subscriptions associated to this subscriber

setNotificationManger

protected void setNotificationManger(NotificationManager nm)
Used by the Yancees façade, during bootstrap, to register a notification manager component

Parameters:
nm - the NotificatoinManager instance to be used.

setSubscriptionManager

protected void setSubscriptionManager(SubscriptionManager sm)
Used by the Yancees façade, during bootstrap, to register the subscription manager component

Parameters:
nm - the SubscriptionManager instance to be used.