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
public abstract class PulsarHandler extends PulsarDecoder
Implementation of the channel handler to process inbound Pulsar data.
-
-
Field Summary
Fields Modifier and Type Field Description protected io.netty.channel.ChannelHandlerContextctxprotected java.net.SocketAddressremoteAddress-
Fields inherited from class org.apache.pulsar.common.protocol.PulsarDecoder
proxyMessage
-
-
Constructor Summary
Constructors Constructor Description PulsarHandler(int keepAliveInterval, java.util.concurrent.TimeUnit unit)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcancelKeepAliveTask()voidchannelActive(io.netty.channel.ChannelHandlerContext ctx)voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx)intgetRemoteEndpointProtocolVersion()protected voidhandlePing(CommandPing ping)protected voidhandlePong(CommandPong pong)protected abstract booleanisHandshakeCompleted()protected voidmessageReceived()protected voidsetRemoteEndpointProtocolVersion(int remoteEndpointProtocolVersion)-
Methods inherited from class org.apache.pulsar.common.protocol.PulsarDecoder
channelRead, handleAck, handleAckResponse, handleActiveConsumerChange, handleAddPartitionToTxn, handleAddPartitionToTxnResponse, handleAddSubscriptionToTxn, handleAddSubscriptionToTxnResponse, handleAuthChallenge, handleAuthResponse, handleCloseConsumer, handleCloseProducer, 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, 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
-
-
-
-
Method Detail
-
getRemoteEndpointProtocolVersion
public int getRemoteEndpointProtocolVersion()
-
setRemoteEndpointProtocolVersion
protected void setRemoteEndpointProtocolVersion(int remoteEndpointProtocolVersion)
-
messageReceived
protected final void messageReceived()
- Specified by:
messageReceivedin classPulsarDecoder
-
channelActive
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
handlePing
protected final void handlePing(CommandPing ping)
- Overrides:
handlePingin classPulsarDecoder
-
handlePong
protected final void handlePong(CommandPong pong)
- Overrides:
handlePongin classPulsarDecoder
-
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
-
-