Package org.ldaptive
Class RoundRobinConnectionStrategy
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.AbstractConnectionStrategy
-
- org.ldaptive.RoundRobinConnectionStrategy
-
- All Implemented Interfaces:
Iterable<LdapURL>
,ConnectionStrategy
,Freezable
public class RoundRobinConnectionStrategy extends AbstractConnectionStrategy
Connection strategy that reorders its URLs based on the number of times it's been invoked.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ldaptive.AbstractConnectionStrategy
AbstractConnectionStrategy.DefaultLdapURLIterator
-
-
Field Summary
Fields Modifier and Type Field Description private AtomicInteger
counter
Usage counter.private Function<List<LdapURL>,Iterator<LdapURL>>
iterFunction
Custom iterator function.-
Fields inherited from class org.ldaptive.AbstractConnectionStrategy
ldapURLSet, logger
-
-
Constructor Summary
Constructors Constructor Description RoundRobinConnectionStrategy()
Default constructor.RoundRobinConnectionStrategy(Function<List<LdapURL>,Iterator<LdapURL>> function)
Creates a new round robin connection strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<LdapURL>
iterator()
RoundRobinConnectionStrategy
newInstance()
Create a deep copy of this strategy.-
Methods inherited from class org.ldaptive.AbstractConnectionStrategy
failure, getActivateCondition, getRetryCondition, initialize, isInitialized, populate, setRetryCondition, success, toString
-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozen
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
newInstance
public RoundRobinConnectionStrategy newInstance()
Description copied from interface:ConnectionStrategy
Create a deep copy of this strategy.- Returns:
- new instance of this connection strategy
-
-