public interface ConnectionFactory extends Closeable
SocketConnection
but there are several connection facades to intelligently connect to Replica
Sets and Shard configurations.
The BootstrapConnectionFactory
can be used to boot strap the
appropriate type of connection factory. It will use a single connection to a
MongoDB process to perform a series of commands to determine the server
configuration type (Sharded, Replica Set, Standalone) and the setup the
appropriate delegate connection factory.
Modifier and Type | Method and Description |
---|---|
Connection |
connect()
Creates a connection to the address provided.
|
ClusterType |
getClusterType()
Returns the type of cluster the connection factory connects to.
|
ReconnectStrategy |
getReconnectStrategy()
Returns the reconnection strategy for the type of connections.
|
Connection connect() throws IOException
IOException
- On a failure connecting to the server.ClusterType getClusterType()
ReconnectStrategy getReconnectStrategy()
Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.