com.streamhub.api
Interface SubscriptionManager


public interface SubscriptionManager

Provides the core publish and subscribe listening capabilities of the server. The SubscriptionManager is used to add listeners for when a client publishes or subscribes.

To retrieve the SubscriptionManager use NIOServer.getSubscriptionManager()


Method Summary
 void addPublishListener(PublishListener publishListener)
          Adds a PublishListener which will be notified every time a client publishes some data
 void addSubscriptionListener(SubscriptionListener subscriptionListener)
          Adds a SubscriptionListener which will be notified every time a client subscribes to a topic
 void removePublishListener(PublishListener publishListener)
          Removes a PublishListener from being notified of publish events
 void removeSubscriptionListener(SubscriptionListener subscriptionListener)
          Removes a SubscriptionListener from being notified of subscription events
 

Method Detail

addSubscriptionListener

void addSubscriptionListener(SubscriptionListener subscriptionListener)
Adds a SubscriptionListener which will be notified every time a client subscribes to a topic

A client may choose to subscribe to the same topic multiple times in which case this method will be called multiple times

Parameters:
subscriptionListener - the listener to be notified of subscriptions

removeSubscriptionListener

void removeSubscriptionListener(SubscriptionListener subscriptionListener)
Removes a SubscriptionListener from being notified of subscription events

Parameters:
subscriptionListener - the listener to be removed

addPublishListener

void addPublishListener(PublishListener publishListener)
Adds a PublishListener which will be notified every time a client publishes some data

Parameters:
publishListener - the listener to be notified of each publish

removePublishListener

void removePublishListener(PublishListener publishListener)
Removes a PublishListener from being notified of publish events

Parameters:
publishListener - the listener to be removed


Copyright © 2009 StreamHub. Tutorials, news and guides can be found on the StreamHub Comet Blog.