public class SimpleSubscribeResponseHandler extends AbstractSubscribeResponseHandler
aChannelManager, disconnectLock, subscriptionscfg, channelManager| Modifier | Constructor and Description |
|---|---|
protected |
SimpleSubscribeResponseHandler(ClientConfiguration cfg,
HChannelManager channelManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncCloseSubscription(TopicSubscriber topicSubscriber,
Callback<PubSubProtocol.ResponseBody> callback,
Object context)
Close subscription from this handler.
|
protected ActiveSubscriber |
createActiveSubscriber(ClientConfiguration cfg,
AbstractHChannelManager channelManager,
TopicSubscriber ts,
PubSubData op,
PubSubProtocol.SubscriptionPreferences preferences,
org.jboss.netty.channel.Channel channel,
HChannel hChannel) |
protected ActiveSubscriber |
getActiveSubscriber(TopicSubscriber ts) |
void |
handleResponse(PubSubProtocol.PubSubResponse response,
PubSubData pubSubData,
org.jboss.netty.channel.Channel channel)
Logic to handle received response.
|
void |
handleSubscribeMessage(PubSubProtocol.PubSubResponse response)
Handle Message delivered by the server.
|
protected Either<PubSubProtocol.StatusCode,HChannel> |
handleSuccessResponse(TopicSubscriber ts,
PubSubData pubSubData,
org.jboss.netty.channel.Channel channel)
Handle success response for a specific TopicSubscriber
ts. |
boolean |
hasSubscription(TopicSubscriber ts)
Whether the given topic subscriber subscribed thru this handler.
|
protected void |
postHandleSuccessResponse(TopicSubscriber ts,
ActiveSubscriber as) |
protected boolean |
removeSubscription(TopicSubscriber ts,
ActiveSubscriber ss) |
asyncMessageDeliver, consume, getConfiguration, getHChannelManager, handleSubscriptionEvent, messageConsumed, onChannelDisconnected, processSubscriptionEvent, resubscribeIfNecessary, startDelivery, stopDeliveryhandleRedirectResponseprotected SimpleSubscribeResponseHandler(ClientConfiguration cfg, HChannelManager channelManager)
protected ActiveSubscriber createActiveSubscriber(ClientConfiguration cfg, AbstractHChannelManager channelManager, TopicSubscriber ts, PubSubData op, PubSubProtocol.SubscriptionPreferences preferences, org.jboss.netty.channel.Channel channel, HChannel hChannel)
createActiveSubscriber in class AbstractSubscribeResponseHandlerprotected ActiveSubscriber getActiveSubscriber(TopicSubscriber ts)
getActiveSubscriber in class AbstractSubscribeResponseHandlerpublic boolean hasSubscription(TopicSubscriber ts)
SubscribeResponseHandlerhasSubscription in class AbstractSubscribeResponseHandlerts - Topic Subscriberprotected boolean removeSubscription(TopicSubscriber ts, ActiveSubscriber ss)
removeSubscription in class AbstractSubscribeResponseHandlerpublic void handleResponse(PubSubProtocol.PubSubResponse response, PubSubData pubSubData, org.jboss.netty.channel.Channel channel) throws Exception
AbstractResponseHandlerhandleResponse in class AbstractSubscribeResponseHandlerresponse - PubSubResponse received from hub server.pubSubData - PubSubData for the pub/sub request.channel - Channel we used to make the request.Exceptionpublic void handleSubscribeMessage(PubSubProtocol.PubSubResponse response)
SubscribeResponseHandlerhandleSubscribeMessage in class AbstractSubscribeResponseHandlerresponse - Message received from the server.protected Either<PubSubProtocol.StatusCode,HChannel> handleSuccessResponse(TopicSubscriber ts, PubSubData pubSubData, org.jboss.netty.channel.Channel channel)
AbstractSubscribeResponseHandlerts. The method
is triggered after subscribed successfully.handleSuccessResponse in class AbstractSubscribeResponseHandlerts - Topic Subscriber.pubSubData - Pub/Sub Request data for this subscribe request.channel - Subscription Channel.protected void postHandleSuccessResponse(TopicSubscriber ts, ActiveSubscriber as)
postHandleSuccessResponse in class AbstractSubscribeResponseHandlerpublic void asyncCloseSubscription(TopicSubscriber topicSubscriber, Callback<PubSubProtocol.ResponseBody> callback, Object context)
SubscribeResponseHandlerasyncCloseSubscription in class SubscribeResponseHandlertopicSubscriber - Topic Subscribercallback - Callback when the subscription is closed.context - Callback context.Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.