create
public Cluster create(ClusterSettings settings,
ServerSettings serverSettings,
ConnectionPoolSettings connectionPoolSettings,
StreamFactory streamFactory,
StreamFactory heartbeatStreamFactory,
List<MongoCredential> credentialList,
ClusterListener clusterListener,
ConnectionPoolListener connectionPoolListener,
ConnectionListener connectionListener)
Creates a cluster with the given settings. The cluster mode will be based on the mode from the settings.
- Specified by:
create
in interface ClusterFactory
- Parameters:
settings
- the cluster settingsserverSettings
- the server settingsconnectionPoolSettings
- the connection pool settingsstreamFactory
- the stream factoryheartbeatStreamFactory
- the heartbeat stream factorycredentialList
- the credential listclusterListener
- an optional listener for cluster-related eventsconnectionPoolListener
- an optional listener for connection pool-related eventsconnectionListener
- an optional listener for connection-related events
- Returns:
- the cluster