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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAMQPRemoteBrokerConnection(org.apache.activemq.artemis.core.server.ActiveMQServer server, AMQPConnectionContext connection, String remoteNodeId, String remoteConnectionName) -
Method Summary
Modifier and TypeMethodDescriptionaddFederationTarget(AMQPFederationTarget federation) Add a new federation target to this remote broker connection instance which will be started if this federation instance has already been started.Returns the connection context for this incoming broker connection.getName()static AMQPRemoteBrokerConnectiongetOrCreateRemoteBrokerConnection(org.apache.activemq.artemis.core.server.ActiveMQServer server, AMQPConnectionContext connection, org.apache.qpid.proton.engine.Connection protonConnection) 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.org.apache.activemq.artemis.core.server.ActiveMQServerReturns the server instance that owns this remote broker connection.voidInitialize the remote broker connection object which moves it to the started state where it will remain until shutdown.booleanReturns has this remote broker connection been initialized.booleanReturnstrueif 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.booleanReturns has this remote broker connection been shutdown.booleanReturns has this remote broker connection been started.voidshutdown()Shutdown the remote broker connection object which removes any management objects and informs any registered services of the shutdown.
-
Field Details
-
REMOTE_BROKER_CONNECTION_RECORD
- See Also:
-
-
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
Returns the connection context for this incoming broker connection.- Returns:
- the connection context for this incoming broker connection
-
getNodeId
- Specified by:
getNodeIdin interfaceorg.apache.activemq.artemis.core.server.RemoteBrokerConnection- Returns:
- the remote node ID if it was provided or null if not supplied on connect
-
getName
- Specified by:
getNamein interfaceorg.apache.activemq.artemis.core.server.RemoteBrokerConnection- Returns:
- the remote broker connection name if it was provided or null if not supplied on connect
-
getProtocol
- Specified by:
getProtocolin interfaceorg.apache.activemq.artemis.core.server.RemoteBrokerConnection
-
isManagable
public boolean isManagable()Returnstrueif 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:
trueif 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
Initialize the remote broker connection object which moves it to the started state where it will remain until shutdown.- Specified by:
initializein interfaceorg.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:
shutdownin interfaceorg.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.
-