flex.messaging.services.messaging
Class SubscriptionManager

java.lang.Object
  extended by flex.management.ManageableComponent
      extended by flex.messaging.services.messaging.SubscriptionManager
All Implemented Interfaces:
Manageable, FlexComponent, FlexConfigurable
Direct Known Subclasses:
RemoteSubscriptionManager

public class SubscriptionManager
extends ManageableComponent

The SubscriptionManager monitors subscribed clients for MessageService and its subclasses, such as DataService.


Field Summary
static String TYPE
           
 
Constructor Summary
SubscriptionManager(MessageDestination destination)
           
SubscriptionManager(MessageDestination destination, boolean enableManagement)
           
 
Method Summary
 void addSubscriber(Object clientId, String selector, String subtopicString, String endpointId)
           
 void destroy()
          Remove subscription information for all subscriptions during destroy.
 MessageClient getMessageClient(Object clientId, String endpointId)
           
 MessageClient getSubscriber(Object clientId)
          Returns the requested subscriber.
 Set getSubscriberIds()
           
 Set getSubscriberIds(Message message, boolean evalSelector)
           
 Set getSubscriberIds(String subtopicPattern, Map messageHeaders)
           
 Object getSubscriptionState()
          Implement a serializer instance which wraps the subscription manager in a transient variable.
 long getSubscriptionTimeoutMillis()
           
 MessageClient registerMessageClient(Object clientId, String endpointId)
          This method is used for subscribers who maintain client ids in their own subscription tables.
 void releaseMessageClient(MessageClient client)
           
 void removeSubscriber(MessageClient client)
          Removes the subscriber, unsubscribing it from all current subscriptions.
 void removeSubscriber(Object clientId, String selector, String subtopicString, String endpointId)
           
 void setId(String id)
          Sets the id of the ManageableComponent.
 void setSubscriptionTimeoutMillis(long value)
           
 
Methods inherited from class flex.management.ManageableComponent
getControl, getId, getParent, initialize, isManaged, isStarted, isValid, setControl, setManaged, setParent, start, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
See Also:
Constant Field Values
Constructor Detail

SubscriptionManager

public SubscriptionManager(MessageDestination destination)

SubscriptionManager

public SubscriptionManager(MessageDestination destination,
                           boolean enableManagement)
Method Detail

setId

public void setId(String id)
Description copied from class: ManageableComponent
Sets the id of the ManageableComponent. The id cannot be null and it cannot be changed after startup.

Overrides:
setId in class ManageableComponent
Parameters:
id - The id of the ManageableComponent.

destroy

public void destroy()
Remove subscription information for all subscriptions during destroy.


setSubscriptionTimeoutMillis

public void setSubscriptionTimeoutMillis(long value)

getSubscriptionTimeoutMillis

public long getSubscriptionTimeoutMillis()

getSubscriptionState

public Object getSubscriptionState()
Implement a serializer instance which wraps the subscription manager in a transient variable. It will need to block out all sub/unsub messages before they are broadcast to the remote server, iterate through the maps of subscriptions and for each "unique" subscription it writes the selector and subtopic. synchronization note: this assumes no add/remove subscriptions are occuring while this method is called.


getSubscriberIds

public Set getSubscriberIds()

getSubscriberIds

public Set getSubscriberIds(Message message,
                            boolean evalSelector)

getSubscriberIds

public Set getSubscriberIds(String subtopicPattern,
                            Map messageHeaders)

getSubscriber

public MessageClient getSubscriber(Object clientId)
Returns the requested subscriber. If the subscriber exists it is also registered for subscription timeout if necessary. If the subscriber is not found this method returns null.

Parameters:
clientId - The clientId of the target subscriber.
Returns:
The subscriber, or null if the subscriber is not found.

removeSubscriber

public void removeSubscriber(MessageClient client)
Removes the subscriber, unsubscribing it from all current subscriptions. This is used by the admin UI.


addSubscriber

public void addSubscriber(Object clientId,
                          String selector,
                          String subtopicString,
                          String endpointId)

removeSubscriber

public void removeSubscriber(Object clientId,
                             String selector,
                             String subtopicString,
                             String endpointId)

registerMessageClient

public MessageClient registerMessageClient(Object clientId,
                                           String endpointId)
This method is used for subscribers who maintain client ids in their own subscription tables. It ensures we have the MessageClient for a given clientId for as long as this session is valid (or the subscription times out).


getMessageClient

public MessageClient getMessageClient(Object clientId,
                                      String endpointId)

releaseMessageClient

public void releaseMessageClient(MessageClient client)


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/services/messaging/SubscriptionManager.html