Interface IRoutingSubscriptionRequest
A single request from a session to subscribe to routing topic.
Namespace: PushTechnology.ClientInterface.Client.Features.Control.Topics
Assembly: Diffusion.Client.dll
Syntax
public interface IRoutingSubscriptionRequest
Remarks
Each request received by a handler must trigger a Route(String, ISubscriptionCallback) or Defer() action.
Properties
SessionId
The session making the subscription request.
Declaration
ISessionId SessionId { get; }
Property Value
Type | Description |
---|---|
ISessionId |
TopicPath
The routing topic to subscribe to.
Declaration
string TopicPath { get; }
Property Value
Type | Description |
---|---|
String |
Methods
Defer()
Defers the handling of this routing topic.
Declaration
void Defer()
Remarks
Further action may be manually initiated, either from this control session or from the server, but will not retain the context of this original request.
Route(String, ISubscriptionCallback)
Resolve a subscription request by providing the path of a source topic to which the requesting session will be subscribed via the routing topic.
Declaration
void Route(string topicPath, ISubscriptionCallback callback)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The topic path of the resolved source topic. |
ISubscriptionCallback | callback | Provides callback methods indicating the status of this request. |
Remarks
The requesting session will receive a subscription notification with the routing topic's path and the topic specification of the source topic. If the source topic is stateful, the requesting session will also be sent an update for the routing topic path with the current value of the source topic. The existence of the source topic is hidden from the requesting session. Updates to the source topic are forwarded to the session as if they came from the routing topic.
A session that does not have SELECT_TOPIC or READ_TOPIC permission for the source topic cannot subscribe directly, but can be subscribed indirectly using this method.
The operation will fail and the callback return OnDiscard() in the following cases:
- There is no source topic bound to
topicPath
; - The topic bound to
topicPath
is a routing topic; - The calling session does not have READ_TOPIC permission
for the source topic bound to
topicPath
; - Route(String, ISubscriptionCallback) or Defer() has already been called for this IRoutingSubscriptionRequest.
Route<TC>(String, TC, ISubscriptionContextCallback<TC>)
Resolve a subscription request by providing the path of a source topic to which the requesting session will be subscribed via the routing topic.
Declaration
void Route<TC>(string topicPath, TC context, ISubscriptionContextCallback<TC> callback)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The topic path of the resolved source topic. |
TC | context | Passed to the callback with the reply to allow requests and replies to be correlated.
The caller may use any convenient object reference, including |
ISubscriptionContextCallback<TC> | callback | Provides callback methods indicating the status of this request. |
Type Parameters
Name | Description |
---|---|
TC | The context object type. |
Remarks
The requesting session will receive a subscription notification with the routing topic's path and the topic specification of the source topic. If the source topic is stateful, the requesting session will also be sent an update for the routing topic path with the current value of the source topic. The existence of the source topic is hidden from the requesting session. Updates to the source topic are forwarded to the session as if they came from the routing topic.
A session that does not have SELECT_TOPIC or READ_TOPIC permission for the source topic cannot subscribe directly, but can be subscribed indirectly using this method.
The operation will fail and the callback return OnDiscard() in the following cases:
- There is no source topic bound to
topicPath
; - The topic bound to
topicPath
is a routing topic; - The calling session does not have READ_TOPIC permission
for the source topic bound to
topicPath
; - Route(String, ISubscriptionCallback) or Defer() has already been called for this IRoutingSubscriptionRequest.