Package com.mongodb.connection
Interface Server
Deprecated.
A logical connection to a MongoDB server.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Gets a connection to this server.void
Deprecated.Gets a connection to this server asynchronously.Deprecated.Gets the description of this server.
-
Method Details
-
getDescription
ServerDescription getDescription()Deprecated.Gets the description of this server. Implementations of this method should not block if the server has not yet been successfully contacted, but rather return immediately a @code{ServerDescription} in a @code{ServerConnectionState.CONNECTING} state.- Returns:
- the description of this server
-
getConnection
Connection getConnection()Deprecated.Gets a connection to this server. The connection should be released after the caller is done with it.
Implementations of this method are allowed to block while waiting for a free connection from a pool of available connection.
Implementations of this method will likely pool the underlying connection, so the effect of closing the returned connection will be to return the connection to the pool.
- Returns:
- a connection this server
-
getConnectionAsync
Deprecated.Gets a connection to this server asynchronously. The connection should be released after the caller is done with it.
Implementations of this method will likely pool the underlying connection, so the effect of closing the returned connection will be to return the connection to the pool.
- Parameters:
callback
- the callback to execute when the connection is available or an error occurs
-