public interface RoutingTopicData extends TopicData
The result is that a Client may subscribe to a Topic which is in reality supported by another Topic and the Mapping of the Routing Topic to the actual Topic can be different for each Client.
As an example of use you may wish for all Clients to simply subscribe to a Topic called "Prices" but depending upon the Client type the actual Topic could differ (Prices/Discount, Prices/Standard etc).
An instance of this data may map any number of Clients to any number of
different 'real' Topics. Each real Topic must have
PublishingTopicData
, UniversalTopicData
or have
no data
.
To obtain current state from such data TopicData.getLoadMessage(TopicClient)
must be used.
An instance of this data may be created using
TopicDataFactory#newRoutingData
.
Modifier and Type | Method and Description |
---|---|
List<TopicClient> |
getClientsForTopic(Topic topic)
Get the list of Clients that are mapped to a particular Topic.
|
List<Topic> |
getMappedTopics()
Get the list of Topics that this Routing data maps to.
|
RoutingTopicDataSubscriptionHandler |
getRoutingHandler()
Returns the routing handler.
|
Topic |
getTopicForClient(String clientId)
Returns the real Topic mapped to for a particular client.
|
void |
subscribe(TopicClient client,
Topic topic)
This may be used to subscribe a client to a Topic other than the parent
Topic, bypassing any authorisation checks.
|
getDeltaEncoding, getLoadEncoding, getLoadMessage, getLoadMessage, getTopic, getType, hasSubscribers, isCommand, isLockedByCurrentThread, isPaged, isPublishing, isRouting, isService, lock, setDeltaEncoding, setLoadEncoding, unlock
void subscribe(TopicClient client, Topic topic) throws APIException
This should normally only be used after subscription checks have been
delegated to a TopicSubscriptionHandler
and the Client now may be
subscribed.
This has the effect of subscribing the Client to the parent Topic but routing from the specified Topic.
client
- the client to subscribetopic
- the actual topic that the client will be subscribed to as a
result of being subscribed to the parent topic.APIException
- if subscription failsTopic getTopicForClient(String clientId)
clientId
- the client identifier.List<Topic> getMappedTopics() throws APIException
APIException
- if unable to lock the data in order to obtain the
list.List<TopicClient> getClientsForTopic(Topic topic) throws APIException
topic
- the topicAPIException
- if unable to lock the data in order to obtain the
listRoutingTopicDataSubscriptionHandler getRoutingHandler()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.