Class AMQPConnectionContext

java.lang.Object
org.apache.activemq.artemis.protocol.amqp.proton.ProtonInitializable
org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext
All Implemented Interfaces:
EventHandler

public class AMQPConnectionContext extends ProtonInitializable implements EventHandler
  • Field Details

    • CONNECTION_OPEN_FAILED

      public static final org.apache.qpid.proton.amqp.Symbol CONNECTION_OPEN_FAILED
    • AMQP_CONTAINER_ID

      public static final String AMQP_CONTAINER_ID
      See Also:
    • handler

      protected final ProtonHandler handler
  • Constructor Details

    • AMQPConnectionContext

      public AMQPConnectionContext(ProtonProtocolManager protocolManager, AMQPConnectionCallback connectionSP, String containerId, int idleTimeout, int maxFrameSize, int channelMax, boolean useCoreSubscriptionNaming, ScheduledExecutorService scheduledPool, boolean isIncomingConnection, ClientSASLFactory saslClientFactory, Map<org.apache.qpid.proton.amqp.Symbol, Object> connectionProperties, org.apache.qpid.proton.amqp.Symbol[] offeredCapabilities, org.apache.qpid.proton.amqp.Symbol[] desiredCapabilities)
    • AMQPConnectionContext

      public AMQPConnectionContext(ProtonProtocolManager protocolManager, AMQPConnectionCallback connectionSP, String containerId, int idleTimeout, int maxFrameSize, int channelMax, boolean useCoreSubscriptionNaming, ScheduledExecutorService scheduledPool, boolean isIncomingConnection, ClientSASLFactory saslClientFactory, Map<org.apache.qpid.proton.amqp.Symbol, Object> connectionProperties, org.apache.qpid.proton.amqp.Symbol[] offeredCapabilities, org.apache.qpid.proton.amqp.Symbol[] desiredCapabilities, boolean brokerConnection)
  • Method Details

    • disableAutoRead

      public void disableAutoRead()
    • enableAutoRead

      public void enableAutoRead()
    • isLargeMessageSync

      public boolean isLargeMessageSync()
    • initialize

      public void initialize() throws Exception
      Specified by:
      initialize in class ProtonInitializable
      Throws:
      Exception
    • addLinkRemoteCloseListener

      public AMQPConnectionContext addLinkRemoteCloseListener(String id, LinkCloseListener linkCloseListener)
      Adds a listener that will be invoked any time an AMQP link is remotely closed before having been closed on this end of the connection.
      Parameters:
      id - A unique ID assigned to the listener used to later remove it if needed.
      linkCloseListener - The instance of a closed listener.
      Returns:
      this connection context instance
    • removeLinkRemoteCloseListener

      public void removeLinkRemoteCloseListener(String id)
      Remove the link remote close listener that is identified by the given ID.
      Parameters:
      id - The unique ID assigned to the listener when it was added.
    • clearLinkRemoteCloseListeners

      public void clearLinkRemoteCloseListeners()
      Clear all link remote close listeners, usually done before connection termination to avoid any remote close events triggering processing after the connection shutdown has already started.
    • isBrokerConnection

      public boolean isBrokerConnection()
    • requireInHandler

      public void requireInHandler()
    • isHandler

      public boolean isHandler()
    • scheduledFlush

      public void scheduledFlush()
    • isIncomingConnection

      public boolean isIncomingConnection()
    • getSaslClientFactory

      public ClientSASLFactory getSaslClientFactory()
    • newSessionExtension

      protected AMQPSessionContext newSessionExtension(org.apache.qpid.proton.engine.Session realSession) throws ActiveMQAMQPException
      Throws:
      ActiveMQAMQPException
    • getSessions

      public Map<org.apache.qpid.proton.engine.Session, AMQPSessionContext> getSessions()
    • getSecurityAuth

      public org.apache.activemq.artemis.core.security.SecurityAuth getSecurityAuth()
    • getSASLResult

      public SASLResult getSASLResult()
    • inputBuffer

      public void inputBuffer(io.netty.buffer.ByteBuf buffer)
    • getHandler

      public ProtonHandler getHandler()
    • getUser

      public String getUser()
    • getPassword

      public String getPassword()
    • getValidatedUser

      public String getValidatedUser()
    • destroy

      public void destroy()
    • isSyncOnFlush

      public boolean isSyncOnFlush()
    • instantFlush

      public void instantFlush()
    • flush

      public void flush()
    • afterFlush

      public void afterFlush(Runnable runnable)
    • close

      public void close(org.apache.qpid.proton.amqp.transport.ErrorCondition errorCondition)
    • getSessionExtension

      public AMQPSessionContext getSessionExtension(org.apache.qpid.proton.engine.Session realSession) throws ActiveMQAMQPException
      Throws:
      ActiveMQAMQPException
    • runOnPool

      public void runOnPool(Runnable run)
    • runNow

      public void runNow(Runnable run)
    • runLater

      public void runLater(Runnable run)
    • validateConnection

      protected boolean validateConnection(org.apache.qpid.proton.engine.Connection connection)
    • checkDataReceived

      public boolean checkDataReceived()
    • getCreationTime

      public long getCreationTime()
    • getRemoteContainer

      public String getRemoteContainer()
    • getPubSubPrefix

      public String getPubSubPrefix()
    • initInternal

      protected void initInternal() throws Exception
      Throws:
      Exception
    • getConnectionCallback

      public AMQPConnectionCallback getConnectionCallback()
    • remoteLinkOpened

      protected void remoteLinkOpened(org.apache.qpid.proton.engine.Link link) throws Exception
      Throws:
      Exception
    • open

      public void open()
    • getContainer

      public String getContainer()
    • addEventHandler

      public void addEventHandler(EventHandler eventHandler)
    • getProtocolManager

      public ProtonProtocolManager getProtocolManager()
    • getAmqpLowCredits

      public int getAmqpLowCredits()
    • getAmqpCredits

      public int getAmqpCredits()
    • isUseCoreSubscriptionNaming

      public boolean isUseCoreSubscriptionNaming()
    • onAuthInit

      public void onAuthInit(ProtonHandler handler, org.apache.qpid.proton.engine.Connection connection, boolean sasl)
      Specified by:
      onAuthInit in interface EventHandler
    • onSaslRemoteMechanismChosen

      public void onSaslRemoteMechanismChosen(ProtonHandler handler, String mech)
      Specified by:
      onSaslRemoteMechanismChosen in interface EventHandler
    • onSaslMechanismsOffered

      public void onSaslMechanismsOffered(ProtonHandler handler, String[] mechanisms)
      Specified by:
      onSaslMechanismsOffered in interface EventHandler
    • onAuthFailed

      public void onAuthFailed(ProtonHandler protonHandler, org.apache.qpid.proton.engine.Connection connection)
      Specified by:
      onAuthFailed in interface EventHandler
    • onAuthSuccess

      public void onAuthSuccess(ProtonHandler protonHandler, org.apache.qpid.proton.engine.Connection connection)
      Specified by:
      onAuthSuccess in interface EventHandler
    • onTransport

      public void onTransport(org.apache.qpid.proton.engine.Transport transport)
      Specified by:
      onTransport in interface EventHandler
    • pushBytes

      public void pushBytes(io.netty.buffer.ByteBuf bytes)
      Specified by:
      pushBytes in interface EventHandler
    • flowControl

      public boolean flowControl(ReadyListener readyListener)
      Specified by:
      flowControl in interface EventHandler
    • getRemoteAddress

      public String getRemoteAddress()
      Specified by:
      getRemoteAddress in interface EventHandler
    • addRemoteOpenedListener

      public AMQPConnectionContext addRemoteOpenedListener(Consumer<AMQPConnectionContext> listener)
    • onRemoteOpen

      public void onRemoteOpen(org.apache.qpid.proton.engine.Connection connection) throws Exception
      Specified by:
      onRemoteOpen in interface EventHandler
      Throws:
      Exception
    • onTransportError

      public void onTransportError(org.apache.qpid.proton.engine.Transport transport) throws Exception
      Specified by:
      onTransportError in interface EventHandler
      Throws:
      Exception
    • onLocalClose

      public void onLocalClose(org.apache.qpid.proton.engine.Connection connection)
      Specified by:
      onLocalClose in interface EventHandler
    • onRemoteClose

      public void onRemoteClose(org.apache.qpid.proton.engine.Connection connection)
      Specified by:
      onRemoteClose in interface EventHandler
    • onLocalOpen

      public void onLocalOpen(org.apache.qpid.proton.engine.Session session) throws Exception
      Specified by:
      onLocalOpen in interface EventHandler
      Throws:
      Exception
    • onRemoteOpen

      public void onRemoteOpen(org.apache.qpid.proton.engine.Session session) throws Exception
      Specified by:
      onRemoteOpen in interface EventHandler
      Throws:
      Exception
    • onRemoteClose

      public void onRemoteClose(org.apache.qpid.proton.engine.Session session) throws Exception
      Specified by:
      onRemoteClose in interface EventHandler
      Throws:
      Exception
    • onRemoteOpen

      public void onRemoteOpen(org.apache.qpid.proton.engine.Link link) throws Exception
      Specified by:
      onRemoteOpen in interface EventHandler
      Throws:
      Exception
    • onFlow

      public void onFlow(org.apache.qpid.proton.engine.Link link) throws Exception
      Specified by:
      onFlow in interface EventHandler
      Throws:
      Exception
    • onRemoteClose

      public void onRemoteClose(org.apache.qpid.proton.engine.Link link) throws Exception
      Specified by:
      onRemoteClose in interface EventHandler
      Throws:
      Exception
    • onRemoteDetach

      public void onRemoteDetach(org.apache.qpid.proton.engine.Link link) throws Exception
      Specified by:
      onRemoteDetach in interface EventHandler
      Throws:
      Exception
    • onLocalDetach

      public void onLocalDetach(org.apache.qpid.proton.engine.Link link) throws Exception
      Specified by:
      onLocalDetach in interface EventHandler
      Throws:
      Exception
    • onDelivery

      public void onDelivery(org.apache.qpid.proton.engine.Delivery delivery) throws Exception
      Specified by:
      onDelivery in interface EventHandler
      Throws:
      Exception