Class AMQPFederation

java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederation
All Implemented Interfaces:
Federation
Direct Known Subclasses:
AMQPFederationSource, AMQPFederationTarget

public abstract class AMQPFederation extends Object implements Federation
A single AMQP Federation instance that can be tied to an AMQP broker connection or used on a remote peer to control the reverse case of when the remote configures the target side of the connection.
  • Field Details

  • Constructor Details

    • AMQPFederation

      public AMQPFederation(String name, org.apache.activemq.artemis.core.server.ActiveMQServer server)
  • Method Details

    • getWildcardConfiguration

      public WildcardConfiguration getWildcardConfiguration()
      Returns the WildcardConfiguration that is in use by this server federation.
      Returns:
      the WildcardConfiguration that is in use by this server federation
    • getScheduler

      public ScheduledExecutorService getScheduler()
    • getServer

      public org.apache.activemq.artemis.core.server.ActiveMQServer getServer()
      Description copied from interface: Federation
      Returns the ActiveMQServer instance assigned to this Federation.
      Specified by:
      getServer in interface Federation
      Returns:
      the ActiveMQServer instance assigned to this Federation
    • getMetrics

      public AMQPFederationMetrics getMetrics()
      Returns the metrics instance tied to this federation instance.
      Returns:
      the metrics instance tied to this federation instance
    • getName

      public String getName()
      Description copied from interface: Federation
      Returns the unique name that was assigned to this server federation connector.
      Specified by:
      getName in interface Federation
      Returns:
      the unique name that was assigned to this server federation connector
    • isStarted

      public boolean isStarted()
      Description copied from interface: Federation
      Returns is this federation instance started (may not be connected yet).
      Specified by:
      isStarted in interface Federation
      Returns:
      is this federation instance started (may not be connected yet)
    • isConnected

      public boolean isConnected()
      Returns true if the federation has been marked as connected.
      Returns:
      true if the federation has been marked as connected
    • getConnectionContext

      public abstract AMQPConnectionContext getConnectionContext()
      Returns the session context assigned to this federation instance.
      Returns:
      the session context assigned to this federation instance
    • getSessionContext

      public abstract AMQPSessionContext getSessionContext()
      Returns the session context assigned to this federation instance.
      Returns:
      the session context assigned to this federation instance
    • getConfiguration

      public abstract AMQPFederationConfiguration getConfiguration()
      Returns the federation configuration that is in effect.
      Returns:
      the federation configuration that is in effect
    • getCapabilities

      public abstract AMQPFederationCapabilities getCapabilities()
      Returns the federation capabilities that is in effect following negotiation.
      Returns:
      the federation capabilities that is in effect following negotiation
    • initialize

      public final void initialize() throws ActiveMQException
      Initialize this federation instance if not already initialized.
      Throws:
      ActiveMQException - if an error occurs during the initialization process.
    • start

      public final void start() throws ActiveMQException
      Starts this federation instance if not already started.
      Throws:
      ActiveMQException - if an error occurs during the start process.
    • stop

      public final void stop() throws ActiveMQException
      Stops this federation instance and shuts down all remote resources that the federation currently has open and active.
      Throws:
      ActiveMQException - if an error occurs during the stop process.
    • shutdown

      public final void shutdown() throws ActiveMQException
      Shutdown this federation instance if not already shutdown (this is a terminal operation).
      Throws:
      ActiveMQException - if an error occurs during the shutdown process.
    • addLinkClosedInterceptor

      public AMQPFederation addLinkClosedInterceptor(String id, Predicate<org.apache.qpid.proton.engine.Link> interceptor)
      Adds a remote linked closed event interceptor that can intercept the closed event and if it returns true indicate that the close has been handled and that no further action need to be taken for this event.
      Parameters:
      id - A unique Id value that identifies the interceptor for later removal.
      interceptor - The predicate that will be called for any link close.
      Returns:
      this AMQPFederation instance
    • removeLinkClosedInterceptor

      public AMQPFederation removeLinkClosedInterceptor(String id)
      Remove a previously registered link close interceptor from the list of close interceptor bindings.
      Parameters:
      id - The id of the interceptor to remove
      Returns:
      this AMQPFederation instance
    • addQueueMatchPolicy

      public AMQPFederation addQueueMatchPolicy(FederationReceiveFromQueuePolicy queuePolicy) throws ActiveMQException
      Adds a new FederationReceiveFromQueuePolicy entry to the set of policies that this federation will use to create demand on the remote when local demand is present.
      Parameters:
      queuePolicy - The policy to add to the set of configured FederationReceiveFromQueuePolicy instance.
      Returns:
      this AMQPFederation instance
      Throws:
      ActiveMQException - if an error occurs processing the added policy
    • addAddressMatchPolicy

      public AMQPFederation addAddressMatchPolicy(FederationReceiveFromAddressPolicy addressPolicy) throws ActiveMQException
      Adds a new FederationReceiveFromAddressPolicy entry to the set of policies that this federation will use to create demand on the remote when local demand is present.
      Parameters:
      addressPolicy - The policy to add to the set of configured FederationReceiveFromAddressPolicy instance.
      Returns:
      this AMQPFederation instance
      Throws:
      ActiveMQException - if an error occurs processing the added policy
    • getRemoteAddressPolicyManager

      public AMQPFederationRemoteAddressPolicyManager getRemoteAddressPolicyManager(String policyName)
      Gets the remote federation address policy manager assigned to the given name, if none is yet managed by this federation instance a new manager is created and added to this managers tracking state for remote policy managers.
      Parameters:
      policyName - The name of the policy whose manager is being queried for.
      Returns:
      an AMQPFederationRemoteAddressPolicyManager that matches the given name and type
    • getRemoteQueuePolicyManager

      public AMQPFederationRemoteQueuePolicyManager getRemoteQueuePolicyManager(String policyName)
      Gets the remote federation queue policy manager assigned to the given name, if none is yet managed by this federation instance a new manager is created and added to this managers tracking state for remote policy managers.
      Parameters:
      policyName - The name of the policy whose manager is being queried for.
      Returns:
      an AMQPFederationRemoteQueuePolicyManager that matches the given name and type
    • signalResourceCreateError

      protected abstract void signalResourceCreateError(Exception cause)
      Error signaling API that must be implemented by the specific federation implementation to handle error when creating a federation resource such as an outgoing receiver link.
      Parameters:
      cause - The error that caused the resource creation to fail.
    • signalError

      protected abstract void signalError(Exception cause)
      Error signaling API that must be implemented by the specific federation implementation to handle errors encountered during normal operations.
      Parameters:
      cause - The error that caused the operation to fail.
    • handleFederationInitialized

      protected void handleFederationInitialized() throws ActiveMQException
      Provides an entry point for the concrete federation implementation to respond to being initialized.
      Throws:
      ActiveMQException - if an error is thrown during initialization handling.
    • handleFederationStarted

      protected void handleFederationStarted() throws ActiveMQException
      Provides an entry point for the concrete federation implementation to respond to being started.
      Throws:
      ActiveMQException - if an error is thrown during start handling.
    • handleFederationStopped

      protected void handleFederationStopped() throws ActiveMQException
      Provides an entry point for the concrete federation implementation to respond to being stopped.
      Throws:
      ActiveMQException - if an error is thrown during stop handling.
    • handleFederationShutdown

      protected void handleFederationShutdown() throws ActiveMQException
      Provides an entry point for the concrete federation implementation to respond to being shutdown.
      Throws:
      ActiveMQException - if an error is thrown during initialization handling.
    • invokeLinkClosedInterceptors

      protected final boolean invokeLinkClosedInterceptors(org.apache.qpid.proton.engine.Link link)
    • signalFederationStarted

      protected final void signalFederationStarted()
    • signalFederationStopped

      protected final void signalFederationStopped()