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.
|
ClusterStats |
getClusterStats()
Returns the meta-data on the current cluster.
|
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.ClusterStats getClusterStats()
ClusterType getClusterType()
ReconnectStrategy getReconnectStrategy()
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.