Class PulsarHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
org.apache.pulsar.common.protocol.PulsarDecoder
org.apache.pulsar.common.protocol.PulsarHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
Implementation of the channel handler to process inbound Pulsar data.
Please see PulsarDecoder
javadoc for important details about handle* method
parameter instance lifecycle.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Modifier and TypeFieldDescriptionprotected io.netty.channel.ChannelHandlerContext
protected SocketAddress
Fields inherited from class org.apache.pulsar.common.protocol.PulsarDecoder
proxyMessage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
channelActive
(io.netty.channel.ChannelHandlerContext ctx) void
channelInactive
(io.netty.channel.ChannelHandlerContext ctx) int
protected final void
handlePing
(CommandPing ping) protected final void
handlePong
(CommandPong pong) protected abstract boolean
protected void
protected io.netty.channel.ChannelFuture
sendPing()
protected void
setRemoteEndpointProtocolVersion
(int remoteEndpointProtocolVersion) Methods inherited from class org.apache.pulsar.common.protocol.PulsarDecoder
channelRead, handleAck, handleAckResponse, handleActiveConsumerChange, handleAddPartitionToTxn, handleAddPartitionToTxnResponse, handleAddSubscriptionToTxn, handleAddSubscriptionToTxnResponse, handleAuthChallenge, handleAuthResponse, handleCloseConsumer, handleCloseProducer, handleCommandWatchTopicList, handleCommandWatchTopicListClose, handleCommandWatchTopicListSuccess, handleCommandWatchTopicUpdate, handleConnect, handleConnected, handleConsumerStats, handleConsumerStatsResponse, handleEndTxn, handleEndTxnOnPartition, handleEndTxnOnPartitionResponse, handleEndTxnOnSubscription, handleEndTxnOnSubscriptionResponse, handleEndTxnResponse, handleError, handleFlow, handleGetLastMessageId, handleGetLastMessageIdSuccess, handleGetOrCreateSchema, handleGetOrCreateSchemaResponse, handleGetSchema, handleGetSchemaResponse, handleGetTopicsOfNamespace, handleGetTopicsOfNamespaceSuccess, handleLookup, handleLookupResponse, handleMessage, handleNewTxn, handleNewTxnResponse, handlePartitionMetadataRequest, handlePartitionResponse, handleProducer, handleProducerSuccess, handleReachedEndOfTopic, handleRedeliverUnacknowledged, handleSeek, handleSend, handleSendError, handleSendReceipt, handleSubscribe, handleSuccess, handleTcClientConnectRequest, handleTcClientConnectResponse, handleTopicMigrated, handleUnsubscribe, interceptCommand
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
ctx
protected io.netty.channel.ChannelHandlerContext ctx -
remoteAddress
-
-
Constructor Details
-
PulsarHandler
-
-
Method Details
-
getRemoteEndpointProtocolVersion
public int getRemoteEndpointProtocolVersion() -
setRemoteEndpointProtocolVersion
protected void setRemoteEndpointProtocolVersion(int remoteEndpointProtocolVersion) -
messageReceived
protected void messageReceived()- Specified by:
messageReceived
in classPulsarDecoder
-
channelActive
- Specified by:
channelActive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
channelInactive
- Specified by:
channelInactive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelInactive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
handlePing
- Overrides:
handlePing
in classPulsarDecoder
-
handlePong
- Overrides:
handlePong
in classPulsarDecoder
-
sendPing
protected io.netty.channel.ChannelFuture sendPing() -
cancelKeepAliveTask
public void cancelKeepAliveTask() -
isHandshakeCompleted
protected abstract boolean isHandshakeCompleted()- Returns:
- true if the connection is ready to use, meaning the Pulsar handshake was already completed
-