Class SimpleAddressManager
- java.lang.Object
-
- org.apache.activemq.artemis.core.postoffice.impl.SimpleAddressManager
-
- All Implemented Interfaces:
AddressManager
- Direct Known Subclasses:
WildcardAddressManager
public class SimpleAddressManager extends Object implements AddressManager
A simple address manager that maintains the addresses and bindings.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConcurrentMap<SimpleString,Bindings>mappingsHashMap<Address, Binding>protected MetricsManagermetricsManagerprotected WildcardConfigurationwildcardConfiguration
-
Constructor Summary
Constructors Constructor Description SimpleAddressManager(BindingsFactory bindingsFactory, WildcardConfiguration wildcardConfiguration, StorageManager storageManager, MetricsManager metricsManager)SimpleAddressManager(BindingsFactory bindingsFactory, StorageManager storageManager, MetricsManager metricsManager)
-
Method Summary
-
-
-
Field Detail
-
mappings
protected final ConcurrentMap<SimpleString,Bindings> mappings
HashMap<Address, Binding>
-
metricsManager
protected final MetricsManager metricsManager
-
wildcardConfiguration
protected final WildcardConfiguration wildcardConfiguration
-
-
Constructor Detail
-
SimpleAddressManager
public SimpleAddressManager(BindingsFactory bindingsFactory, StorageManager storageManager, MetricsManager metricsManager)
-
SimpleAddressManager
public SimpleAddressManager(BindingsFactory bindingsFactory, WildcardConfiguration wildcardConfiguration, StorageManager storageManager, MetricsManager metricsManager)
-
-
Method Detail
-
addBinding
public boolean addBinding(Binding binding) throws Exception
- Specified by:
addBindingin interfaceAddressManager- Throws:
Exception
-
removeBinding
public Binding removeBinding(SimpleString uniqueName, Transaction tx) throws Exception
Description copied from interface:AddressManagerThis will use a Transaction as we need to confirm the queue was removed- Specified by:
removeBindingin interfaceAddressManager- Returns:
- Throws:
Exception
-
getExistingBindingsForRoutingAddress
public Bindings getExistingBindingsForRoutingAddress(SimpleString address) throws Exception
- Specified by:
getExistingBindingsForRoutingAddressin interfaceAddressManager- Throws:
Exception
-
getBindingsForRoutingAddress
public Bindings getBindingsForRoutingAddress(SimpleString address) throws Exception
- Specified by:
getBindingsForRoutingAddressin interfaceAddressManager- Throws:
Exception
-
getBinding
public Binding getBinding(SimpleString bindableName)
- Specified by:
getBindingin interfaceAddressManager
-
getBindings
public Stream<Binding> getBindings()
- Specified by:
getBindingsin interfaceAddressManager
-
getMatchingBindings
public Collection<Binding> getMatchingBindings(SimpleString address) throws Exception
- Specified by:
getMatchingBindingsin interfaceAddressManager- Throws:
Exception
-
getDirectBindings
public Collection<Binding> getDirectBindings(SimpleString address) throws Exception
- Specified by:
getDirectBindingsin interfaceAddressManager- Throws:
Exception
-
getMatchingQueue
public SimpleString getMatchingQueue(SimpleString address, RoutingType routingType) throws Exception
- Specified by:
getMatchingQueuein interfaceAddressManager- Throws:
Exception
-
getMatchingQueue
public SimpleString getMatchingQueue(SimpleString address, SimpleString queueName, RoutingType routingType) throws Exception
- Specified by:
getMatchingQueuein interfaceAddressManager- Throws:
Exception
-
clear
public void clear()
- Specified by:
clearin interfaceAddressManager
-
getAddresses
public Set<SimpleString> getAddresses()
- Specified by:
getAddressesin interfaceAddressManager
-
removeBindingInternal
protected void removeBindingInternal(SimpleString address, SimpleString bindableName)
-
bindingsEmpty
protected void bindingsEmpty(SimpleString realAddress, Bindings bindings)
-
addMappingsInternal
protected Bindings addMappingsInternal(SimpleString address, Collection<Binding> newBindings) throws Exception
- Throws:
Exception
-
addMappingInternal
protected boolean addMappingInternal(SimpleString address, Binding binding) throws Exception
- Throws:
Exception
-
reloadAddressInfo
public boolean reloadAddressInfo(AddressInfo addressInfo)
- Specified by:
reloadAddressInfoin interfaceAddressManager
-
addAddressInfo
public boolean addAddressInfo(AddressInfo addressInfo) throws Exception
- Specified by:
addAddressInfoin interfaceAddressManager- Returns:
- true if the address was added, false if it wasn't added
- Throws:
Exception
-
updateAddressInfo
public AddressInfo updateAddressInfo(SimpleString addressName, EnumSet<RoutingType> routingTypes) throws Exception
Description copied from interface:AddressManagerit will return null if there are no updates. it will throw an exception if the address doesn't exist- Specified by:
updateAddressInfoin interfaceAddressManager- Throws:
Exception
-
checkAutoRemoveAddress
public boolean checkAutoRemoveAddress(AddressInfo addressInfo, AddressSettings settings, boolean ignoreDelay) throws Exception
- Specified by:
checkAutoRemoveAddressin interfaceAddressManager- Throws:
Exception
-
removeAddressInfo
public AddressInfo removeAddressInfo(SimpleString address) throws Exception
- Specified by:
removeAddressInfoin interfaceAddressManager- Throws:
Exception
-
getAddressInfo
public AddressInfo getAddressInfo(SimpleString addressName)
- Specified by:
getAddressInfoin interfaceAddressManager
-
scanAddresses
public void scanAddresses(MirrorController mirrorController) throws Exception
- Specified by:
scanAddressesin interfaceAddressManager- Throws:
Exception
-
-