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

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