Routing topics are deprecated. The more powerful
SessionTrees
feature should be used in their place.
@Deprecated public static interface SubscriptionControl.RoutingSubscriptionRequest
Modifier and Type | Interface and Description |
---|---|
static interface |
SubscriptionControl.RoutingSubscriptionRequest.Handler
Deprecated.
since 6.7
Routing topics are deprecated. The more powerful
|
static interface |
SubscriptionControl.RoutingSubscriptionRequest.RoutingHandler
Deprecated.
since 6.7
Routing topics are deprecated. The more powerful
|
Modifier and Type | Method and Description |
---|---|
CompletableFuture<?> |
defer()
Deprecated.
Defer the handling of this subscription request.
|
SessionId |
getSessionId()
Deprecated.
Identifies the session making the subscription request.
|
String |
getTopicPath()
Deprecated.
Identifies the subscribed routing topic.
|
CompletableFuture<?> |
route(String topicPath)
Deprecated.
Resolve a subscription request by providing the path of a source
topic to which the requesting session will be subscribed via the
routing topic.
|
<C> void |
route(String topicPath,
C context,
SubscriptionControl.SubscriptionContextCallback<C> callback)
Deprecated.
Provide the path of a source topic to which the requesting session
will be subscribed via the routing topic, with a contextual object.
|
void |
route(String topicPath,
SubscriptionControl.SubscriptionCallback callback)
Deprecated.
Resolve a subscription request by providing the path of a source
topic to which the requesting session will be subscribed via the
routing topic.
|
SessionId getSessionId()
String getTopicPath()
CompletableFuture<?> defer()
When a request is deferred, the server will discard the request, and the requesting session will not receive a subscription notification.
An implementation can retain the requesting session's
session ID
and the routing topic's
path
so a routing subscription can be
established at a later time using
SubscriptionControl.subscribe(SessionId, String, SubscriptionCallback)
.
A RoutingSubscriptionRequest
can be used once. If
route()
or defer()
has already been called for this
RoutingSubscriptionRequest
, calling this method will cause a
warning to be logged by the server, but otherwise have no effect.
From 6.0, this method returns a CompletableFuture and no longer throws exceptions. All errors are reported through the CompletableFuture result.
If the instruction was processed, the CompletableFuture will complete successfully. The result type is any rather than Void to provide forward compatibility with future iterations of this API that may provide a non-null result with a more specific result type.
Otherwise, the CompletableFuture will complete exceptionally
with a CompletionException
. Common reasons for
failure, listed by the exception reported as the
cause
, include:
SessionException
– if route()
or
defer()
has already been called for this
RoutingSubscriptionRequest
;
SessionClosedException
– if the session is
closed.
CompletableFuture<?> route(String topicPath)
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.
topicPath
- the topic path of the source topicIf a routing subscription was established, the CompletableFuture will complete successfully. The result type is any rather than Void to provide forward compatibility with future iterations of this API that may provide a non-null result with a more specific result type.
Otherwise, the CompletableFuture will complete exceptionally
with a CompletionException
. Common reasons for
failure, listed by the exception reported as the
cause
, include:
RoutingSubscriptionException
– if there is
no topic bound to topicPath
;
RoutingSubscriptionException
– if the topic
bound to topicPath
is itself a routing topic;
PermissionsException
– if the calling
session does not have READ_TOPIC
permission for the
source topic bound to topicPath
;
PermissionsException
– if the calling
session does not have READ_TOPIC
permission for the
routing topic bound to getTopicPath()
;
SessionException
– if route()
or
defer()
has already been called for this
RoutingSubscriptionRequest
;
SessionClosedException
– if the session is
closed.
void route(String topicPath, SubscriptionControl.SubscriptionCallback callback)
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 with be
discarded
in the following
cases:
topicPath
;
topicPath
is a routing topic;
READ_TOPIC
permission
for the source topic bound to topicPath
;
READ_TOPIC
permission
for the routing topic bound to getTopicPath()
;
route()
or defer()
has already been called for
this RoutingSubscriptionRequest
.
topicPath
- the topic path of the resolved source topiccallback
- provides callback methods indicating the status of
this request.<C> void route(String topicPath, C context, SubscriptionControl.SubscriptionContextCallback<C> callback)
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 with be
discarded
in the following
cases:
topicPath
;
topicPath
is a routing topic;
READ_TOPIC
permission
for the source topic bound to topicPath
;
READ_TOPIC
permission
for the routing topic bound to getTopicPath()
;
route()
or defer()
has already been called for
this RoutingSubscriptionRequest
.
C
- context object typetopicPath
- the topic path of the resolved source topiccontext
- passed to the callback with the reply to allow
requests and replies to be correlated. The caller may use any
convenient object reference, including null
callback
- provides callback methods indicating the status of
this request.Copyright © 2023 DiffusionData Ltd. All Rights Reserved.