Interface SubscriptionControl

All Superinterfaces:
Feature

public interface SubscriptionControl extends Feature
This feature allows a session to subscribe or unsubscribe other sessions to topics, on a single server or across a cluster.

Requests to subscribe sessions to topics can be submitted at any time even if the topics do not exist at the server. Topic selectors are used on subscription to match against topics at the server. The session will become subscribed to any topics that exist at the server that match the selector (unless they are already subscribed, or the session has insufficient permission). The subscription request is also retained at the server so that if any newly created topics match the selector, the session will then become subscribed to it (unless a subsequent unsubscription cancels it).

Specific sessions (anywhere in a cluster) may be subscribed/unsubscribed if the SessionId is known.

Subscriptions may also be requested using 'session filters' (see Session for a full description of session filters), where all sessions (anywhere in a cluster) that satisfy a particular filter expression will be subscribed/unsubscribed. The filter is only evaluated once against the current sessions that exist at the time - it is not retained and applied to any sessions that are created later. In order to be notified of new sessions as they are created session event listeners can be used and those sessions subscribed as required based upon their session properties.

This feature also provides the ability to query the topic selections of another session.

Access control


To directly subscribe other sessions to topics, a session must have MODIFY_SESSION permission, and SELECT_TOPIC permission for the topic selector used for subscription. The subscribed sessions will only be subscribed to matching topics for which they have READ_TOPIC permission.

To directly unsubscribe other sessions, a session must have MODIFY_SESSION permission, and SELECT_TOPIC permission for the topic selector used for unsubscription.

Getting the topic selections for a specified session requires VIEW_SESSION permission.

Accessing the feature

This feature may be obtained from a session as follows:
 
 SubscriptionControl subsControl = session.feature(SubscriptionControl.class);
 
 
Since:
5.0
Author:
DiffusionData Limited