Package org.ldaptive
Class RoundRobinConnectionStrategy
java.lang.Object
org.ldaptive.AbstractConnectionStrategy
org.ldaptive.RoundRobinConnectionStrategy
- All Implemented Interfaces:
Iterable<LdapURL>
,ConnectionStrategy
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
FieldsModifier and TypeFieldDescriptionprivate final AtomicInteger
Usage counter.Custom iterator function.Fields inherited from class org.ldaptive.AbstractConnectionStrategy
ldapURLSet, logger
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Creates a new round robin connection strategy. -
Method Summary
Methods inherited from class org.ldaptive.AbstractConnectionStrategy
failure, getActivateCondition, getRetryCondition, initialize, isInitialized, populate, setRetryCondition, success, toString
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
-
Field Details
-
counter
Usage counter. -
iterFunction
Custom iterator function.
-
-
Constructor Details
-
RoundRobinConnectionStrategy
public RoundRobinConnectionStrategy()Default constructor. -
RoundRobinConnectionStrategy
Creates a new round robin connection strategy.- Parameters:
function
- that produces a custom iterator
-
-
Method Details
-
iterator
-
newInstance
Description copied from interface:ConnectionStrategy
Create a deep copy of this strategy.- Returns:
- new instance of this connection strategy
-