Package org.apache.pulsar.proxy.server
Class ProxyConnection
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.apache.pulsar.common.protocol.PulsarDecoder
-
- org.apache.pulsar.common.protocol.PulsarHandler
-
- org.apache.pulsar.proxy.server.ProxyConnection
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class ProxyConnection extends org.apache.pulsar.common.protocol.PulsarHandlerHandles incoming discovery request from client and sends appropriate response back to client.
-
-
Constructor Summary
Constructors Constructor Description ProxyConnection(ProxyService proxyService, io.netty.resolver.dns.DnsAddressResolverGroup dnsAddressResolverGroup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbrokerConnected(DirectProxyHandler directProxyHandler, org.apache.pulsar.common.api.proto.CommandConnected connected)voidchannelActive(io.netty.channel.ChannelHandlerContext ctx)voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx)voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg)voidchannelRegistered(io.netty.channel.ChannelHandlerContext ctx)voidchannelUnregistered(io.netty.channel.ChannelHandlerContext ctx)voidchannelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx)voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)org.apache.pulsar.client.api.AuthenticationgetClientAuthentication()io.netty.handler.codec.haproxy.HAProxyMessagegetHAProxyMessage()protected voidhandleAuthResponse(org.apache.pulsar.common.api.proto.CommandAuthResponse authResponse)protected voidhandleConnect(org.apache.pulsar.common.api.proto.CommandConnect connect)protected voidhandleGetSchema(org.apache.pulsar.common.api.proto.CommandGetSchema commandGetSchema)protected voidhandleGetTopicsOfNamespace(org.apache.pulsar.common.api.proto.CommandGetTopicsOfNamespace commandGetTopicsOfNamespace)protected voidhandleLookup(org.apache.pulsar.common.api.proto.CommandLookupTopic lookup)handles discovery request from client ands sends next active broker address.protected voidhandlePartitionMetadataRequest(org.apache.pulsar.common.api.proto.CommandPartitionedTopicMetadata partitionMetadata)booleanhasHAProxyMessage()protected booleanisHandshakeCompleted()-
Methods inherited from class org.apache.pulsar.common.protocol.PulsarHandler
cancelKeepAliveTask, getRemoteEndpointProtocolVersion, handlePing, handlePong, messageReceived, setRemoteEndpointProtocolVersion
-
Methods inherited from class org.apache.pulsar.common.protocol.PulsarDecoder
handleAck, handleAckResponse, handleActiveConsumerChange, handleAddPartitionToTxn, handleAddPartitionToTxnResponse, handleAddSubscriptionToTxn, handleAddSubscriptionToTxnResponse, handleAuthChallenge, handleCloseConsumer, handleCloseProducer, handleConnected, handleConsumerStats, handleConsumerStatsResponse, handleEndTxn, handleEndTxnOnPartition, handleEndTxnOnPartitionResponse, handleEndTxnOnSubscription, handleEndTxnOnSubscriptionResponse, handleEndTxnResponse, handleError, handleFlow, handleGetLastMessageId, handleGetLastMessageIdSuccess, handleGetOrCreateSchema, handleGetOrCreateSchemaResponse, handleGetSchemaResponse, handleGetTopicsOfNamespaceSuccess, handleLookupResponse, handleMessage, handleNewTxn, handleNewTxnResponse, handlePartitionResponse, handleProducer, handleProducerSuccess, handleReachedEndOfTopic, handleRedeliverUnacknowledged, handleSeek, handleSend, handleSendError, handleSendReceipt, handleSubscribe, handleSuccess, handleTcClientConnectRequest, handleTcClientConnectResponse, handleUnsubscribe, interceptCommand
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
ProxyConnection
public ProxyConnection(ProxyService proxyService, io.netty.resolver.dns.DnsAddressResolverGroup dnsAddressResolverGroup)
-
-
Method Detail
-
channelRegistered
public void channelRegistered(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelRegisteredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelRegisteredin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
channelUnregistered
public void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelUnregisteredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelUnregisteredin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
channelActive
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classorg.apache.pulsar.common.protocol.PulsarHandler- 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 classorg.apache.pulsar.common.protocol.PulsarHandler- Throws:
java.lang.Exception
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
channelWritabilityChanged
public void channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception- Specified by:
channelWritabilityChangedin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelWritabilityChangedin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classorg.apache.pulsar.common.protocol.PulsarDecoder- Throws:
java.lang.Exception
-
brokerConnected
public void brokerConnected(DirectProxyHandler directProxyHandler, org.apache.pulsar.common.api.proto.CommandConnected connected)
-
handleConnect
protected void handleConnect(org.apache.pulsar.common.api.proto.CommandConnect connect)
- Overrides:
handleConnectin classorg.apache.pulsar.common.protocol.PulsarDecoder
-
handleAuthResponse
protected void handleAuthResponse(org.apache.pulsar.common.api.proto.CommandAuthResponse authResponse)
- Overrides:
handleAuthResponsein classorg.apache.pulsar.common.protocol.PulsarDecoder
-
handlePartitionMetadataRequest
protected void handlePartitionMetadataRequest(org.apache.pulsar.common.api.proto.CommandPartitionedTopicMetadata partitionMetadata)
- Overrides:
handlePartitionMetadataRequestin classorg.apache.pulsar.common.protocol.PulsarDecoder
-
handleGetTopicsOfNamespace
protected void handleGetTopicsOfNamespace(org.apache.pulsar.common.api.proto.CommandGetTopicsOfNamespace commandGetTopicsOfNamespace)
- Overrides:
handleGetTopicsOfNamespacein classorg.apache.pulsar.common.protocol.PulsarDecoder
-
handleGetSchema
protected void handleGetSchema(org.apache.pulsar.common.api.proto.CommandGetSchema commandGetSchema)
- Overrides:
handleGetSchemain classorg.apache.pulsar.common.protocol.PulsarDecoder
-
handleLookup
protected void handleLookup(org.apache.pulsar.common.api.proto.CommandLookupTopic lookup)
handles discovery request from client ands sends next active broker address.- Overrides:
handleLookupin classorg.apache.pulsar.common.protocol.PulsarDecoder
-
getClientAuthentication
public org.apache.pulsar.client.api.Authentication getClientAuthentication()
-
isHandshakeCompleted
protected boolean isHandshakeCompleted()
- Specified by:
isHandshakeCompletedin classorg.apache.pulsar.common.protocol.PulsarHandler
-
hasHAProxyMessage
public boolean hasHAProxyMessage()
-
getHAProxyMessage
public io.netty.handler.codec.haproxy.HAProxyMessage getHAProxyMessage()
-
-