public class SocketConnectionFactory extends Object implements ProxiedConnectionFactory
ConnectionFactory to create direct socket connections to the servers.| Constructor and Description |
|---|
SocketConnectionFactory(MongoClientConfiguration config)
Creates a new
SocketConnectionFactory. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Connection |
connect()
Creates a connection to the address provided.
|
Connection |
connect(ServerState server,
MongoClientConfiguration config)
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.
|
public SocketConnectionFactory(MongoClientConfiguration config)
SocketConnectionFactory.config - The MongoDB client configuration.public void close()
Overridden to close the cluster state.
close in interface Closeableclose in interface AutoCloseablepublic Connection connect() throws IOException
Returns a new SocketConnection.
connect in interface ConnectionFactoryIOException - On a failure connecting to the server.ConnectionFactory.connect()public Connection connect(ServerState server, MongoClientConfiguration config) throws IOException
connect in interface ProxiedConnectionFactoryserver - The MongoDB server to connect to.config - The configuration for the Connection to the MongoDB server.IOException - On a failure connecting to the server.public ClusterType getClusterType()
Overridden to return ClusterType.STAND_ALONE cluster type.
getClusterType in interface ConnectionFactorypublic ReconnectStrategy getReconnectStrategy()
Overridden to return a SimpleReconnectStrategy.
getReconnectStrategy in interface ConnectionFactoryCopyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.