Class FederationQueueEntry


  • public class FederationQueueEntry
    extends Object
    An entry type class used to hold a FederationConsumerInternal and any other state data needed by the manager that is creating them based on the policy configuration for the federation instance. The entry can be extended by federation implementation to hold additional state data for the federation consumer and the managing of its lifetime. This entry type provides reference tracking state for current demand (bindings) on a federation resource such that it is not torn down until all demand has been removed from the local resource.
    • Constructor Detail

      • FederationQueueEntry

        public FederationQueueEntry​(FederationConsumerInfo consumerInfo)
        Creates a new queue entry with a single reference
        Parameters:
        consumerInfo - Consumer information object used to define the federation queue consumer
    • Method Detail

      • getQueueName

        public String getQueueName()
        Returns:
        the name of the queue that this entry tracks demand for.
      • getConsumerInfo

        public FederationConsumerInfo getConsumerInfo()
        Returns:
        the consumer information that defines the properties of federation queue consumers
      • hasConsumer

        public boolean hasConsumer()
        Returns:
        true if a consumer is currently set on this entry.
      • setConsumer

        public FederationQueueEntry setConsumer​(FederationConsumerInternal consumer)
        Sets the consumer assigned to this entry to the given instance.
        Parameters:
        consumer - The federation consumer that is currently active for this entry.
        Returns:
        this federation queue consumer entry.
      • clearConsumer

        public FederationQueueEntry clearConsumer()
        Clears the currently assigned consumer from this entry.
        Returns:
        this federation queue consumer entry.
      • hasDemand

        public boolean hasDemand()
        Returns:
        true if there are bindings that are mapped to this federation entry.
      • addDemand

        public FederationQueueEntry addDemand​(org.apache.activemq.artemis.core.server.ServerConsumer consumer)
        Add additional demand on the resource associated with this entries consumer.
        Parameters:
        consumer - The ServerConsumer that generated the demand on federated resource.
        Returns:
        this federation queue entry instance.
      • removeDemand

        public FederationQueueEntry removeDemand​(org.apache.activemq.artemis.core.server.ServerConsumer consumer)
        Remove the known demand on the resource from the given ServerConsumer.
        Parameters:
        consumer - The ServerConsumer that generated the demand on federated resource.
        Returns:
        this federation queue entry instance.