Class FederationQueueEntry
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.federation.internal.FederationQueueEntry
-
public class FederationQueueEntry extends Object
An entry type class used to hold aFederationConsumerInternaland 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 Summary
Constructors Constructor Description FederationQueueEntry(FederationConsumerInfo consumerInfo)Creates a new queue entry with a single reference
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FederationQueueEntryaddDemand(org.apache.activemq.artemis.core.server.ServerConsumer consumer)Add additional demand on the resource associated with this entries consumer.FederationQueueEntryclearConsumer()Clears the currently assigned consumer from this entry.FederationConsumerInternalgetConsumer()FederationConsumerInfogetConsumerInfo()StringgetQueueName()booleanhasConsumer()booleanhasDemand()FederationQueueEntryremoveDemand(org.apache.activemq.artemis.core.server.ServerConsumer consumer)Remove the known demand on the resource from the givenServerConsumer.FederationQueueEntrysetConsumer(FederationConsumerInternal consumer)Sets the consumer assigned to this entry to the given instance.
-
-
-
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:
trueif a consumer is currently set on this entry.
-
getConsumer
public FederationConsumerInternal getConsumer()
- Returns:
- the consumer managed by 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- TheServerConsumerthat 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 givenServerConsumer.- Parameters:
consumer- TheServerConsumerthat generated the demand on federated resource.- Returns:
- this federation queue entry instance.
-
-