Class BloomFilterMonitor<T>
- java.lang.Object
-
- org.forgerock.bloomfilter.monitoring.BloomFilterMonitor<T>
-
- All Implemented Interfaces:
BloomFilter<T>
,BloomFilterMXBean
public final class BloomFilterMonitor<T> extends Object implements BloomFilterMXBean, BloomFilter<T>
Generic Bloom Filter JMX monitoring.
-
-
Constructor Summary
Constructors Constructor Description BloomFilterMonitor(BloomFilter<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(T element)
Adds the specified element to this set if it is not already possibly present.void
addAll(Collection<? extends T> elements)
Adds all of the specified elements to this set if they are not possibly already present.double
getConfiguredFalsePositiveProbability()
long
getCurrentCapacity()
long
getEstimatedRemainingCapacity()
double
getExpectedFalsePositiveProbability()
Date
getExpiryTime()
long
getMemorySizeKB()
BloomFilterStatistics
getStatistics()
Gets a snapshot of the current statistics of the set.boolean
mightContain(T element)
Checks if the given element might be a member of this set.void
register()
void
register(MBeanServer mBeanServer)
ObjectInstance
register(MBeanServer mBeanServer, String packageName, String instanceName)
String
toString()
-
-
-
Constructor Detail
-
BloomFilterMonitor
public BloomFilterMonitor(BloomFilter<T> delegate)
-
-
Method Detail
-
register
public ObjectInstance register(MBeanServer mBeanServer, String packageName, String instanceName) throws InstanceAlreadyExistsException, MBeanRegistrationException, MalformedObjectNameException
-
register
public void register(MBeanServer mBeanServer) throws InstanceAlreadyExistsException, MBeanRegistrationException
-
register
public void register() throws InstanceAlreadyExistsException, MBeanRegistrationException
-
add
public void add(T element)
Description copied from interface:BloomFilter
Adds the specified element to this set if it is not already possibly present. After a call to this method, subsequent calls toBloomFilter.mightContain(Object)
will returntrue
for the same object.- Specified by:
add
in interfaceBloomFilter<T>
- Parameters:
element
- the element to add to this set.
-
addAll
public void addAll(Collection<? extends T> elements)
Description copied from interface:BloomFilter
Adds all of the specified elements to this set if they are not possibly already present.- Specified by:
addAll
in interfaceBloomFilter<T>
- Parameters:
elements
- the elements to add to the set.
-
mightContain
public boolean mightContain(T element)
Description copied from interface:BloomFilter
Checks if the given element might be a member of this set. If this method returnsfalse
, then the given object is definitely not a member of the set. If the result istrue
then the object may or may not be a member of this set, with a certain probability of false positives.- Specified by:
mightContain
in interfaceBloomFilter<T>
- Parameters:
element
- the element to check for membership in this set.- Returns:
false
if the element is definitely not in the set, ortrue
if it might be.
-
getStatistics
public BloomFilterStatistics getStatistics()
Description copied from interface:BloomFilter
Gets a snapshot of the current statistics of the set.- Specified by:
getStatistics
in interfaceBloomFilter<T>
-
getConfiguredFalsePositiveProbability
public double getConfiguredFalsePositiveProbability()
- Specified by:
getConfiguredFalsePositiveProbability
in interfaceBloomFilterMXBean
-
getExpectedFalsePositiveProbability
public double getExpectedFalsePositiveProbability()
- Specified by:
getExpectedFalsePositiveProbability
in interfaceBloomFilterMXBean
-
getCurrentCapacity
public long getCurrentCapacity()
- Specified by:
getCurrentCapacity
in interfaceBloomFilterMXBean
-
getEstimatedRemainingCapacity
public long getEstimatedRemainingCapacity()
- Specified by:
getEstimatedRemainingCapacity
in interfaceBloomFilterMXBean
-
getMemorySizeKB
public long getMemorySizeKB()
- Specified by:
getMemorySizeKB
in interfaceBloomFilterMXBean
-
getExpiryTime
public Date getExpiryTime()
- Specified by:
getExpiryTime
in interfaceBloomFilterMXBean
-
-