Search in sources :

Example 6 with ServerDescription

use of com.mongodb.connection.ServerDescription in project mongo-java-driver by mongodb.

the class CompositeServerSelector method select.

@Override
public List<ServerDescription> select(final ClusterDescription clusterDescription) {
    ClusterDescription curClusterDescription = clusterDescription;
    List<ServerDescription> choices = null;
    for (ServerSelector cur : serverSelectors) {
        choices = cur.select(curClusterDescription);
        curClusterDescription = new ClusterDescription(clusterDescription.getConnectionMode(), clusterDescription.getType(), choices, clusterDescription.getClusterSettings(), clusterDescription.getServerSettings());
    }
    return choices;
}
Also used : ServerDescription(com.mongodb.connection.ServerDescription) ClusterDescription(com.mongodb.connection.ClusterDescription)

Aggregations

ServerDescription (com.mongodb.connection.ServerDescription)6 ClusterDescription (com.mongodb.connection.ClusterDescription)5 ServerAddress (com.mongodb.ServerAddress)3 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 Before (org.junit.Before)1