Class HierarchicalObjectRepository<T>
- java.lang.Object
-
- org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository<T>
-
- All Implemented Interfaces:
HierarchicalRepository<T>
public class HierarchicalObjectRepository<T> extends Object implements HierarchicalRepository<T>
allows objects to be mapped against a regex pattern and held in order in a list
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHierarchicalObjectRepository.MatchModifierModifies the match String for any add or get from the repository
-
Constructor Summary
Constructors Constructor Description HierarchicalObjectRepository()HierarchicalObjectRepository(WildcardConfiguration wildcardConfiguration)HierarchicalObjectRepository(WildcardConfiguration wildcardConfiguration, HierarchicalObjectRepository.MatchModifier matchModifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMatch(String match, T value)Add a new match to the repositoryvoidaddMatch(String match, T value, boolean immutableMatch)Add a new match to the repositoryvoidclear()clear the repositoryvoidclearCache()Clears the cache.voidclearListeners()Removes all listeners.booleancontainsExactMatch(String match)booleancontainsExactWildcardMatch(String match)voiddisableListeners()voidenableListeners()intgetCacheSize()TgetDefault()TgetMatch(String match)return the value held against the nearest matchvoidregisterListener(HierarchicalRepositoryChangeListener listener)register a listener to listen for changes in the repositoryvoidremoveMatch(String match)remove a match from the repositoryvoidsetDefault(T defaultValue)set the default value to fallback to if none foundvoidswap(Set<Map.Entry<String,T>> entries)voidunRegisterListener(HierarchicalRepositoryChangeListener listener)unregister a listenerList<T>values()Return a list of Values being added
-
-
-
Constructor Detail
-
HierarchicalObjectRepository
public HierarchicalObjectRepository()
-
HierarchicalObjectRepository
public HierarchicalObjectRepository(WildcardConfiguration wildcardConfiguration)
-
HierarchicalObjectRepository
public HierarchicalObjectRepository(WildcardConfiguration wildcardConfiguration, HierarchicalObjectRepository.MatchModifier matchModifier)
-
-
Method Detail
-
disableListeners
public void disableListeners()
- Specified by:
disableListenersin interfaceHierarchicalRepository<T>
-
enableListeners
public void enableListeners()
- Specified by:
enableListenersin interfaceHierarchicalRepository<T>
-
addMatch
public void addMatch(String match, T value)
Description copied from interface:HierarchicalRepositoryAdd a new match to the repository- Specified by:
addMatchin interfaceHierarchicalRepository<T>- Parameters:
match- The regex to use to match againstvalue- the value to hold against the match
-
values
public List<T> values()
Description copied from interface:HierarchicalRepositoryReturn a list of Values being added- Specified by:
valuesin interfaceHierarchicalRepository<T>- Returns:
-
addMatch
public void addMatch(String match, T value, boolean immutableMatch)
Add a new match to the repository- Specified by:
addMatchin interfaceHierarchicalRepository<T>- Parameters:
match- The regex to use to match againstvalue- the value to hold against the match
-
getCacheSize
public int getCacheSize()
- Specified by:
getCacheSizein interfaceHierarchicalRepository<T>
-
getMatch
public T getMatch(String match)
return the value held against the nearest match- Specified by:
getMatchin interfaceHierarchicalRepository<T>- Parameters:
match- the match to look for- Returns:
- the value
-
containsExactMatch
public boolean containsExactMatch(String match)
- Specified by:
containsExactMatchin interfaceHierarchicalRepository<T>
-
containsExactWildcardMatch
public boolean containsExactWildcardMatch(String match)
- Specified by:
containsExactWildcardMatchin interfaceHierarchicalRepository<T>
-
removeMatch
public void removeMatch(String match)
remove a match from the repository- Specified by:
removeMatchin interfaceHierarchicalRepository<T>- Parameters:
match- the match to remove
-
registerListener
public void registerListener(HierarchicalRepositoryChangeListener listener)
Description copied from interface:HierarchicalRepositoryregister a listener to listen for changes in the repository- Specified by:
registerListenerin interfaceHierarchicalRepository<T>
-
unRegisterListener
public void unRegisterListener(HierarchicalRepositoryChangeListener listener)
Description copied from interface:HierarchicalRepositoryunregister a listener- Specified by:
unRegisterListenerin interfaceHierarchicalRepository<T>
-
setDefault
public void setDefault(T defaultValue)
set the default value to fallback to if none found- Specified by:
setDefaultin interfaceHierarchicalRepository<T>- Parameters:
defaultValue- the value
-
getDefault
public T getDefault()
- Specified by:
getDefaultin interfaceHierarchicalRepository<T>- Returns:
- the default match for this repo
-
clear
public void clear()
Description copied from interface:HierarchicalRepositoryclear the repository- Specified by:
clearin interfaceHierarchicalRepository<T>
-
swap
public void swap(Set<Map.Entry<String,T>> entries)
- Specified by:
swapin interfaceHierarchicalRepository<T>
-
clearListeners
public void clearListeners()
Description copied from interface:HierarchicalRepositoryRemoves all listeners.- Specified by:
clearListenersin interfaceHierarchicalRepository<T>
-
clearCache
public void clearCache()
Description copied from interface:HierarchicalRepositoryClears the cache.- Specified by:
clearCachein interfaceHierarchicalRepository<T>
-
-