public class SimpleSubscribeResponseHandler extends AbstractSubscribeResponseHandler
aChannelManager, disconnectLock, subscriptions
cfg, 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, stopDelivery
handleRedirectResponse
protected 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 AbstractSubscribeResponseHandler
protected ActiveSubscriber getActiveSubscriber(TopicSubscriber ts)
getActiveSubscriber
in class AbstractSubscribeResponseHandler
public boolean hasSubscription(TopicSubscriber ts)
SubscribeResponseHandler
hasSubscription
in class AbstractSubscribeResponseHandler
ts
- Topic Subscriberprotected boolean removeSubscription(TopicSubscriber ts, ActiveSubscriber ss)
removeSubscription
in class AbstractSubscribeResponseHandler
public void handleResponse(PubSubProtocol.PubSubResponse response, PubSubData pubSubData, org.jboss.netty.channel.Channel channel) throws Exception
AbstractResponseHandler
handleResponse
in class AbstractSubscribeResponseHandler
response
- PubSubResponse received from hub server.pubSubData
- PubSubData for the pub/sub request.channel
- Channel we used to make the request.Exception
public void handleSubscribeMessage(PubSubProtocol.PubSubResponse response)
SubscribeResponseHandler
handleSubscribeMessage
in class AbstractSubscribeResponseHandler
response
- Message received from the server.protected Either<PubSubProtocol.StatusCode,HChannel> handleSuccessResponse(TopicSubscriber ts, PubSubData pubSubData, org.jboss.netty.channel.Channel channel)
AbstractSubscribeResponseHandler
ts
. The method
is triggered after subscribed successfully.handleSuccessResponse
in class AbstractSubscribeResponseHandler
ts
- Topic Subscriber.pubSubData
- Pub/Sub Request data for this subscribe request.channel
- Subscription Channel.protected void postHandleSuccessResponse(TopicSubscriber ts, ActiveSubscriber as)
postHandleSuccessResponse
in class AbstractSubscribeResponseHandler
public void asyncCloseSubscription(TopicSubscriber topicSubscriber, Callback<PubSubProtocol.ResponseBody> callback, Object context)
SubscribeResponseHandler
asyncCloseSubscription
in class SubscribeResponseHandler
topicSubscriber
- Topic Subscribercallback
- Callback when the subscription is closed.context
- Callback context.Copyright © 2015 The Apache Software Foundation. All rights reserved.