Class ProxyConnection

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

    public class ProxyConnection
    extends org.apache.pulsar.common.protocol.PulsarHandler
    Handles incoming discovery request from client and sends appropriate response back to client.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Field Summary

      • Fields inherited from class org.apache.pulsar.common.protocol.PulsarHandler

        ctx, remoteAddress
      • Fields inherited from class org.apache.pulsar.common.protocol.PulsarDecoder

        proxyMessage
    • 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
      void brokerConnected​(DirectProxyHandler directProxyHandler, org.apache.pulsar.common.api.proto.CommandConnected connected)  
      void channelActive​(io.netty.channel.ChannelHandlerContext ctx)  
      void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)  
      void channelRead​(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg)  
      void channelRegistered​(io.netty.channel.ChannelHandlerContext ctx)  
      void channelUnregistered​(io.netty.channel.ChannelHandlerContext ctx)  
      void channelWritabilityChanged​(io.netty.channel.ChannelHandlerContext ctx)  
      void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)  
      org.apache.pulsar.client.api.Authentication getClientAuthentication()  
      io.netty.handler.codec.haproxy.HAProxyMessage getHAProxyMessage()  
      protected void handleAuthResponse​(org.apache.pulsar.common.api.proto.CommandAuthResponse authResponse)  
      protected void handleConnect​(org.apache.pulsar.common.api.proto.CommandConnect connect)  
      protected void handleGetSchema​(org.apache.pulsar.common.api.proto.CommandGetSchema commandGetSchema)  
      protected void handleGetTopicsOfNamespace​(org.apache.pulsar.common.api.proto.CommandGetTopicsOfNamespace commandGetTopicsOfNamespace)  
      protected void handleLookup​(org.apache.pulsar.common.api.proto.CommandLookupTopic lookup)
      handles discovery request from client ands sends next active broker address.
      protected void handlePartitionMetadataRequest​(org.apache.pulsar.common.api.proto.CommandPartitionedTopicMetadata partitionMetadata)  
      boolean hasHAProxyMessage()  
      protected boolean isHandshakeCompleted()  
      • 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
      • 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
    • 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:
        channelRegistered in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelRegistered in class io.netty.channel.ChannelInboundHandlerAdapter
        Throws:
        java.lang.Exception
      • channelUnregistered

        public void channelUnregistered​(io.netty.channel.ChannelHandlerContext ctx)
                                 throws java.lang.Exception
        Specified by:
        channelUnregistered in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelUnregistered in class io.netty.channel.ChannelInboundHandlerAdapter
        Throws:
        java.lang.Exception
      • channelActive

        public void channelActive​(io.netty.channel.ChannelHandlerContext ctx)
                           throws java.lang.Exception
        Specified by:
        channelActive in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelActive in class org.apache.pulsar.common.protocol.PulsarHandler
        Throws:
        java.lang.Exception
      • channelInactive

        public void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)
                             throws java.lang.Exception
        Specified by:
        channelInactive in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelInactive in class org.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:
        exceptionCaught in interface io.netty.channel.ChannelHandler
        Specified by:
        exceptionCaught in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        exceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapter
        Throws:
        java.lang.Exception
      • channelWritabilityChanged

        public void channelWritabilityChanged​(io.netty.channel.ChannelHandlerContext ctx)
                                       throws java.lang.Exception
        Specified by:
        channelWritabilityChanged in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelWritabilityChanged in class io.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:
        channelRead in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelRead in class org.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:
        handleConnect in class org.apache.pulsar.common.protocol.PulsarDecoder
      • handleAuthResponse

        protected void handleAuthResponse​(org.apache.pulsar.common.api.proto.CommandAuthResponse authResponse)
        Overrides:
        handleAuthResponse in class org.apache.pulsar.common.protocol.PulsarDecoder
      • handlePartitionMetadataRequest

        protected void handlePartitionMetadataRequest​(org.apache.pulsar.common.api.proto.CommandPartitionedTopicMetadata partitionMetadata)
        Overrides:
        handlePartitionMetadataRequest in class org.apache.pulsar.common.protocol.PulsarDecoder
      • handleGetTopicsOfNamespace

        protected void handleGetTopicsOfNamespace​(org.apache.pulsar.common.api.proto.CommandGetTopicsOfNamespace commandGetTopicsOfNamespace)
        Overrides:
        handleGetTopicsOfNamespace in class org.apache.pulsar.common.protocol.PulsarDecoder
      • handleGetSchema

        protected void handleGetSchema​(org.apache.pulsar.common.api.proto.CommandGetSchema commandGetSchema)
        Overrides:
        handleGetSchema in class org.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:
        handleLookup in class org.apache.pulsar.common.protocol.PulsarDecoder
      • getClientAuthentication

        public org.apache.pulsar.client.api.Authentication getClientAuthentication()
      • isHandshakeCompleted

        protected boolean isHandshakeCompleted()
        Specified by:
        isHandshakeCompleted in class org.apache.pulsar.common.protocol.PulsarHandler
      • hasHAProxyMessage

        public boolean hasHAProxyMessage()
      • getHAProxyMessage

        public io.netty.handler.codec.haproxy.HAProxyMessage getHAProxyMessage()