org.apache.savan.subscribers
Class AbstractSubscriber

java.lang.Object
  extended byorg.apache.savan.subscribers.AbstractSubscriber
All Implemented Interfaces:
Subscriber
Direct Known Subclasses:
CompositeSubscriber, LeafSubscriber

public abstract class AbstractSubscriber
extends java.lang.Object
implements Subscriber

Defines a subscriber which is the entity that define a specific subscription in savan. Independent of the protocol type.


Constructor Summary
AbstractSubscriber()
           
 
Method Summary
 void addProperty(java.lang.String key, java.lang.Object value)
          To add a property to the subscriber.
 boolean doesMessageBelongToTheFilter(SavanMessageContext smc)
          To check weather a certain message complies with the filter.
 Filter getFilter()
          To get the Filter object
 java.lang.String getId()
          To get the subscriber Id.
 java.lang.Object getProperty(java.lang.String key)
          To get a property from the Subscriber.
 void processPublication(SavanMessageContext publication, PublicationReport report)
          This method first checks weather the passed message complies with the current filter.
abstract  void renewSubscription(ExpirationBean bean)
          To renew a subscription.
protected abstract  void sendPublication(SavanMessageContext publication, PublicationReport report)
          This should be used by based classes to sendThe publication in its own manner
 void setFilter(Filter filter)
          To set the Filter object
 void setId(java.lang.String id)
          To set the subscriber Id
abstract  void setSubscriptionEndingTime(java.util.Date subscriptionEndingTime)
          To set the Subscription expiration time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSubscriber

public AbstractSubscriber()
Method Detail

addProperty

public void addProperty(java.lang.String key,
                        java.lang.Object value)
Description copied from interface: Subscriber
To add a property to the subscriber.

Specified by:
addProperty in interface Subscriber
Parameters:
key -
value -

getProperty

public java.lang.Object getProperty(java.lang.String key)
Description copied from interface: Subscriber
To get a property from the Subscriber.

Specified by:
getProperty in interface Subscriber
Parameters:
key -
Returns:

getFilter

public Filter getFilter()
Description copied from interface: Subscriber
To get the Filter object

Specified by:
getFilter in interface Subscriber
Returns:

setFilter

public void setFilter(Filter filter)
Description copied from interface: Subscriber
To set the Filter object

Specified by:
setFilter in interface Subscriber
Parameters:
filter -

getId

public java.lang.String getId()
Description copied from interface: Subscriber
To get the subscriber Id.

Specified by:
getId in interface Subscriber
Returns:

setId

public void setId(java.lang.String id)
Description copied from interface: Subscriber
To set the subscriber Id

Specified by:
setId in interface Subscriber
Parameters:
id -

doesMessageBelongToTheFilter

public boolean doesMessageBelongToTheFilter(SavanMessageContext smc)
                                     throws SavanException
Description copied from interface: Subscriber
To check weather a certain message complies with the filter.

Specified by:
doesMessageBelongToTheFilter in interface Subscriber
Parameters:
smc -
Returns:
Throws:
SavanException

processPublication

public void processPublication(SavanMessageContext publication,
                               PublicationReport report)
                        throws SavanException
This method first checks weather the passed message complies with the current filter. If so message is sent, and the subscriberID is added to the PublicationReport. Else message is ignored.

Specified by:
processPublication in interface Subscriber
Parameters:
report -
Throws:
SavanException

setSubscriptionEndingTime

public abstract void setSubscriptionEndingTime(java.util.Date subscriptionEndingTime)
Description copied from interface: Subscriber
To set the Subscription expiration time.

Specified by:
setSubscriptionEndingTime in interface Subscriber
Parameters:
subscriptionEndingTime -

renewSubscription

public abstract void renewSubscription(ExpirationBean bean)
Description copied from interface: Subscriber
To renew a subscription.

Specified by:
renewSubscription in interface Subscriber
Parameters:
bean -

sendPublication

protected abstract void sendPublication(SavanMessageContext publication,
                                        PublicationReport report)
                                 throws SavanException
This should be used by based classes to sendThe publication in its own manner

Parameters:
publication -
report -
Throws:
SavanException


Copyright © 2007 null. All Rights Reserved.