public static ConnectionFactory newFailoverConnectionPool(Set<LDAPURL> servers,String username,char[] password,int maxSize,int heartBeatInterval,String heartBeatTimeUnit,Options ldapOptions){
  List<ConnectionFactory> factories=new ArrayList<ConnectionFactory>(servers.size());
  for (  LDAPURL ldapurl : servers) {
    ConnectionFactory cf=Connections.newFixedConnectionPool(newConnectionFactory(ldapurl,username,password,heartBeatInterval,heartBeatTimeUnit,ldapOptions),maxSize);
    factories.add(cf);
  }
  return loadBalanceFactories(factories);
}

public static ConnectionFactory newFailoverConnectionPool ( Set < LDAPURL > servers , String username , char [ ] password , int maxSize , int heartBeatInterval , String heartBeatTimeUnit , Options ldapOptions ) { List < ConnectionFactory > factories = new ArrayList < ConnectionFactory > ( servers . size ( ) ) ; for ( LDAPURL ldapurl : servers ) { ConnectionFactory cf = Connections . newFixedConnectionPool ( newConnectionFactory ( ldapurl , username , password , heartBeatInterval , heartBeatTimeUnit , ldapOptions ) , maxSize ) ; factories . add ( cf ) ; } return loadBalanceFactories ( factories ) ; }
creates a new connection pool that is capable to failover to the servers defined in case there is an error .
