Class FederationAddressEntry
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.federation.internal.FederationAddressEntry
-
public class FederationAddressEntry 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 active demand. 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 FederationAddressEntry(org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo)Creates a new address entry for tracking demand on a federated address
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FederationAddressEntryaddDemand(org.apache.activemq.artemis.core.postoffice.Binding binding)Add demand on this federation address consumer from the given binding.FederationAddressEntryclearConsumer()Clears the currently assigned consumer from this entry.StringgetAddress()org.apache.activemq.artemis.core.server.impl.AddressInfogetAddressInfo()FederationConsumerInternalgetConsumer()booleanhasConsumer()booleanhasDemand()FederationAddressEntryremoveDemand(org.apache.activemq.artemis.core.postoffice.Binding binding)Reduce demand on this federation address consumer from the given binding.FederationAddressEntrysetConsumer(FederationConsumerInternal consumer)Sets the consumer assigned to this entry to the given instance.
-
-
-
Constructor Detail
-
FederationAddressEntry
public FederationAddressEntry(org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo)
Creates a new address entry for tracking demand on a federated address- Parameters:
addressInfo- The address information object that this entry hold demand state for.
-
-
Method Detail
-
getAddressInfo
public org.apache.activemq.artemis.core.server.impl.AddressInfo getAddressInfo()
- Returns:
- the address information that this entry is acting to federate.
-
getAddress
public String getAddress()
- Returns:
- the address that this entry is acting to federate.
-
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 FederationAddressEntry 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 address consumer entry.
-
clearConsumer
public FederationAddressEntry clearConsumer()
Clears the currently assigned consumer from this entry.- Returns:
- this federation address consumer entry.
-
hasDemand
public boolean hasDemand()
- Returns:
- true if there are bindings that are mapped to this federation entry.
-
addDemand
public FederationAddressEntry addDemand(org.apache.activemq.artemis.core.postoffice.Binding binding)
Add demand on this federation address consumer from the given binding.- Returns:
- this federation address consumer entry.
-
removeDemand
public FederationAddressEntry removeDemand(org.apache.activemq.artemis.core.postoffice.Binding binding)
Reduce demand on this federation address consumer from the given binding.- Returns:
- this federation address consumer entry.
-
-