Package org.ldaptive.pool
Class AbstractPruneStrategy
java.lang.Object
org.ldaptive.AbstractFreezable
org.ldaptive.pool.AbstractPruneStrategy
- All Implemented Interfaces:
Consumer<Supplier<Iterator<PooledConnectionProxy>>>,Freezable,PruneStrategy
- Direct Known Subclasses:
AgePruneStrategy
Base class for prune strategy implementations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classBase class for prune strategy builders. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(Supplier<Iterator<PooledConnectionProxy>> connections) protected abstract List<Predicate<PooledConnectionProxy>>Returns the predicates used by this prune strategy.Returns the interval at which the prune task will be executed.voidsetPrunePeriod(Duration period) Sets the prune period.Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ldaptive.pool.PruneStrategy
getStatisticsSize
-
Field Details
-
logger
Logger for this class. -
prunePeriod
Prune period.
-
-
Constructor Details
-
AbstractPruneStrategy
public AbstractPruneStrategy()
-
-
Method Details
-
getPrunePeriod
Description copied from interface:PruneStrategyReturns the interval at which the prune task will be executed.- Specified by:
getPrunePeriodin interfacePruneStrategy- Returns:
- prune period
-
setPrunePeriod
Sets the prune period.- Parameters:
period- to set
-
accept
- Specified by:
acceptin interfaceConsumer<Supplier<Iterator<PooledConnectionProxy>>>
-
getPruneConditions
Returns the predicates used by this prune strategy. Each predicate will be invoked for every connection to be pruned.- Returns:
- List of predicates that are evaluated in order. Connections are removed from the pool immediately upon predicate returning true; subsequent predicates operate on a reduced pool.
-