Class AMQPRemoteBrokerConnection

java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.AMQPRemoteBrokerConnection
All Implemented Interfaces:
org.apache.activemq.artemis.core.server.RemoteBrokerConnection

public class AMQPRemoteBrokerConnection extends Object implements org.apache.activemq.artemis.core.server.RemoteBrokerConnection
A Utility class that represents the remote end of an incoming AMQP broker connection used to provide a common root for services that are active on a given incoming broker connection.
  • Field Details

  • Constructor Details

    • AMQPRemoteBrokerConnection

      public AMQPRemoteBrokerConnection(org.apache.activemq.artemis.core.server.ActiveMQServer server, AMQPConnectionContext connection, String remoteNodeId, String remoteConnectionName)
  • Method Details

    • getServer

      public org.apache.activemq.artemis.core.server.ActiveMQServer getServer()
      Returns the server instance that owns this remote broker connection.
      Returns:
      the server instance that owns this remote broker connection
    • getConnection

      public AMQPConnectionContext getConnection()
      Returns the connection context for this incoming broker connection.
      Returns:
      the connection context for this incoming broker connection
    • getNodeId

      public String getNodeId()
      Specified by:
      getNodeId in interface org.apache.activemq.artemis.core.server.RemoteBrokerConnection
      Returns:
      the remote node ID if it was provided or null if not supplied on connect
    • getName

      public String getName()
      Specified by:
      getName in interface org.apache.activemq.artemis.core.server.RemoteBrokerConnection
      Returns:
      the remote broker connection name if it was provided or null if not supplied on connect
    • getProtocol

      public String getProtocol()
      Specified by:
      getProtocol in interface org.apache.activemq.artemis.core.server.RemoteBrokerConnection
    • isManagable

      public boolean isManagable()
      Returns true if the remote broker connection was established with enough information to uniquely identify the connection source for purposes of adding the remote connection into the server management services.
      Returns:
      true if the remote broker connection was established with enough information to uniquely identify the connection source for purposes of adding the remote connection into the server management services
    • isInitialized

      public boolean isInitialized()
      Returns has this remote broker connection been initialized.
      Returns:
      has this remote broker connection been initialized
    • isStarted

      public boolean isStarted()
      Returns has this remote broker connection been started.
      Returns:
      has this remote broker connection been started
    • isShutdown

      public boolean isShutdown()
      Returns has this remote broker connection been shutdown.
      Returns:
      has this remote broker connection been shutdown
    • initialize

      public void initialize() throws ActiveMQException
      Initialize the remote broker connection object which moves it to the started state where it will remain until shutdown.
      Specified by:
      initialize in interface org.apache.activemq.artemis.core.server.RemoteBrokerConnection
      Throws:
      ActiveMQException - if an error occurs on initialization.
    • shutdown

      public void shutdown()
      Shutdown the remote broker connection object which removes any management objects and informs any registered services of the shutdown.
      Specified by:
      shutdown in interface org.apache.activemq.artemis.core.server.RemoteBrokerConnection
    • addFederationTarget

      public AMQPRemoteBrokerConnection addFederationTarget(AMQPFederationTarget federation) throws ActiveMQException
      Add a new federation target to this remote broker connection instance which will be started if this federation instance has already been started.
      Returns:
      this remote broker connection instance
      Throws:
      ActiveMQException - if an error occurs while adding the federation to this connection.
    • getOrCreateRemoteBrokerConnection

      public static AMQPRemoteBrokerConnection getOrCreateRemoteBrokerConnection(org.apache.activemq.artemis.core.server.ActiveMQServer server, AMQPConnectionContext connection, org.apache.qpid.proton.engine.Connection protonConnection) throws ActiveMQException
      Utility methods for checking the current connection for an existing remote broker connection instance and returning it, or creating a new instance if none yet exists and initializing it.
      Parameters:
      server - The server instance that has accepted the remote broker connection.
      connection - The connection context object that is assigned to the active connection.
      protonConnection - The proton connection instance where the connection attachments are stored.
      Returns:
      a remote broker connection instance that has been initialized that is scoped to the active connection
      Throws:
      ActiveMQException - if an error occurs while attempting to get a remote broker connection instance.