org.ldaptive.provider
Class ConnectionStrategies.RoundRobinConnectionStrategy

java.lang.Object
  extended by org.ldaptive.provider.ConnectionStrategies.RoundRobinConnectionStrategy
All Implemented Interfaces:
ConnectionStrategy
Enclosing class:
ConnectionStrategies

public static class ConnectionStrategies.RoundRobinConnectionStrategy
extends Object
implements ConnectionStrategy

Round Robin strategy.


Field Summary
 
Fields inherited from interface org.ldaptive.provider.ConnectionStrategy
ACTIVE_PASSIVE, DEFAULT, RANDOM, ROUND_ROBIN
 
Constructor Summary
ConnectionStrategies.RoundRobinConnectionStrategy()
          Creates a new round robin connection strategy.
ConnectionStrategies.RoundRobinConnectionStrategy(boolean b)
          Creates a new round robin connection strategy.
 
Method Summary
protected  int getCount(int connectionCount)
          Returns the supplied connection count if useConnectionCount is true.
 String[] getLdapUrls(ConnectionFactoryMetadata metadata)
          Return a list of URLs that cycles the list order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionStrategies.RoundRobinConnectionStrategy

public ConnectionStrategies.RoundRobinConnectionStrategy()
Creates a new round robin connection strategy.


ConnectionStrategies.RoundRobinConnectionStrategy

public ConnectionStrategies.RoundRobinConnectionStrategy(boolean b)
Creates a new round robin connection strategy.

Parameters:
b - whether getLdapUrls(ConnectionFactoryMetadata) should used the connectionCount parameter
Method Detail

getLdapUrls

public String[] getLdapUrls(ConnectionFactoryMetadata metadata)
Return a list of URLs that cycles the list order. The first entry is moved to the end of the list for each invocation.

Specified by:
getLdapUrls in interface ConnectionStrategy
Parameters:
metadata - which can be used to produce the URL list
Returns:
list of URLs to attempt connections to

getCount

protected int getCount(int connectionCount)
Returns the supplied connection count if useConnectionCount is true. Otherwise returns invocationCount.

Parameters:
connectionCount - as reported by the connection
Returns:
count used to reorder the URL list


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.