Package | Description |
---|---|
com.mongodb |
The core mongodb package
|
com.mongodb.binding |
This package contains classes that manage binding to MongoDB servers for various operations.
|
com.mongodb.client |
This package contains classes for the new client api for MongoDatabase and MongoCollection
|
com.mongodb.connection |
Contains classes that manage connecting to MongoDB servers.
|
com.mongodb.connection.netty |
This package contains netty specific classes
|
com.mongodb.internal.connection | |
com.mongodb.management |
Contains classes for monitoring the server/driver via Java Management Extensions (JMX).
|
com.mongodb.operation |
The core of the MongoDB driver works via operations, using the command pattern.
|
com.mongodb.selector |
Contains classes that determine how to select the server to connect to in order to send commands or queries.
|
Modifier and Type | Class and Description |
---|---|
class |
DBAddress
Deprecated.
This class is no longer needed, as the driver does not rely on it for anything anymore. Use
ServerAddress instead. |
Modifier and Type | Field and Description |
---|---|
private ServerAddress |
CommandResult.address |
private ServerAddress |
ServerCursor.address |
private ServerAddress |
BulkWriteException.serverAddress |
private ServerAddress |
MongoSocketException.serverAddress |
private ServerAddress |
MongoServerException.serverAddress |
private ServerAddress |
MongoCursorNotFoundException.serverAddress |
private ServerAddress |
MongoBulkWriteException.serverAddress |
Modifier and Type | Method and Description |
---|---|
ServerAddress |
Mongo.getAddress()
Gets the address of the current master
|
ServerAddress |
ServerCursor.getAddress()
Gets the server address.
|
ServerAddress |
ReplicaSetStatus.getMaster()
Gets the ServerAddress of the master server in this replica set.
|
ServerAddress |
MongoMappingCursor.getServerAddress() |
ServerAddress |
MongoCursorAdapter.getServerAddress() |
ServerAddress |
MongoBatchCursorAdapter.getServerAddress() |
ServerAddress |
DBCursor.getServerAddress() |
ServerAddress |
Cursor.getServerAddress()
Gets the address of the server that data is pulled from.
|
ServerAddress |
MongoSocketException.getServerAddress()
Gets the server address for this exception.
|
ServerAddress |
MongoServerException.getServerAddress()
Gets the address of the server.
|
ServerAddress |
MongoCursorNotFoundException.getServerAddress()
The server address where the cursor is.
|
ServerAddress |
MongoBulkWriteException.getServerAddress()
The address of the server which performed the bulk write operation.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<ServerAddress> |
Mongo.getAllAddress()
Gets a list of all server addresses used when this Mongo was created
|
java.util.List<ServerAddress> |
Mongo.getServerAddressList()
Gets the list of server addresses currently seen by this client.
|
Modifier and Type | Method and Description |
---|---|
private static Cluster |
Mongo.createCluster(ServerAddress serverAddress,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options,
MongoDriverInformation mongoDriverInformation) |
boolean |
ReplicaSetStatus.isMaster(ServerAddress serverAddress)
Checks to see if a given server is the primary server in this replica set.
|
Modifier and Type | Method and Description |
---|---|
private static Cluster |
Mongo.createCluster(java.util.List<ServerAddress> seedList,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options,
MongoDriverInformation mongoDriverInformation) |
private static ClusterSettings |
Mongo.getClusterSettings(java.util.List<ServerAddress> seedList,
MongoClientOptions options,
ClusterConnectionMode clusterConnectionMode) |
Constructor and Description |
---|
BulkWriteException(BulkWriteResult writeResult,
java.util.List<BulkWriteError> writeErrors,
WriteConcernError writeConcernError,
ServerAddress serverAddress)
Constructs a new instance.
|
CommandResult(BsonDocument response,
ServerAddress address) |
DuplicateKeyException(BsonDocument response,
ServerAddress address,
WriteConcernResult writeConcernResult)
Construct an instance.
|
Mongo(ServerAddress address)
Deprecated.
Replaced by
MongoClient.MongoClient(ServerAddress) |
Mongo(ServerAddress serverAddress,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options) |
Mongo(ServerAddress serverAddress,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options,
MongoDriverInformation mongoDriverInformation) |
Mongo(ServerAddress serverAddress,
MongoClientOptions options) |
Mongo(ServerAddress address,
MongoOptions options)
Deprecated.
|
Mongo(ServerAddress left,
ServerAddress right)
Deprecated.
Please use
MongoClient.MongoClient(java.util.List) instead. |
Mongo(ServerAddress left,
ServerAddress right,
MongoOptions options)
Deprecated.
Please use
MongoClient.MongoClient(java.util.List, MongoClientOptions) instead. |
MongoBulkWriteException(BulkWriteResult writeResult,
java.util.List<BulkWriteError> writeErrors,
WriteConcernError writeConcernError,
ServerAddress serverAddress)
Constructs a new instance.
|
MongoClient(ServerAddress addr)
Creates a Mongo instance based on a (single) mongodb node
|
MongoClient(ServerAddress addr,
java.util.List<MongoCredential> credentialsList)
Creates a Mongo instance based on a (single) mongodb node and a list of credentials
|
MongoClient(ServerAddress addr,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options)
Creates a Mongo instance based on a (single) mongo node using a given ServerAddress and default options.
|
MongoClient(ServerAddress addr,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options,
MongoDriverInformation mongoDriverInformation)
Creates a MongoClient to a single node using a given ServerAddress.
|
MongoClient(ServerAddress addr,
MongoClientOptions options)
Creates a Mongo instance based on a (single) mongo node using a given ServerAddress and default options.
|
MongoCommandException(BsonDocument response,
ServerAddress address)
Construct a new instance with the CommandResult from a failed command
|
MongoCursorNotFoundException(long cursorId,
ServerAddress serverAddress)
Construct a new instance.
|
MongoNodeIsRecoveringException(ServerAddress serverAddress)
Construct an instance.
|
MongoNotPrimaryException(ServerAddress serverAddress)
Construct an instance.
|
MongoQueryException(ServerAddress address,
int errorCode,
java.lang.String errorMessage)
Construct an instance.
|
MongoServerException(int code,
java.lang.String message,
ServerAddress serverAddress)
Construct a new instance.
|
MongoServerException(java.lang.String message,
ServerAddress serverAddress)
Construct a new instance.
|
MongoSocketClosedException(java.lang.String message,
ServerAddress address)
Construct an instance.
|
MongoSocketException(java.lang.String message,
ServerAddress serverAddress)
Construct a new instance.
|
MongoSocketException(java.lang.String msg,
ServerAddress serverAddress,
java.lang.Throwable e) |
MongoSocketOpenException(java.lang.String message,
ServerAddress address,
java.lang.Throwable cause)
Construct an instance.
|
MongoSocketReadException(java.lang.String message,
ServerAddress address)
Construct a new instance.
|
MongoSocketReadException(java.lang.String message,
ServerAddress address,
java.lang.Throwable cause)
Construct a new instance.
|
MongoSocketReadTimeoutException(java.lang.String message,
ServerAddress address,
java.lang.Throwable cause)
Construct a new instance
|
MongoSocketWriteException(java.lang.String message,
ServerAddress address,
java.lang.Throwable cause)
Construct a new instance.
|
MongoWriteConcernException(WriteConcernError writeConcernError,
ServerAddress serverAddress)
Construct an instance.
|
MongoWriteConcernException(WriteConcernError writeConcernError,
WriteConcernResult writeConcernResult,
ServerAddress serverAddress)
Construct an instance.
|
MongoWriteException(WriteError error,
ServerAddress serverAddress)
Construct an instance
|
ServerCursor(long id,
ServerAddress address)
Construct an instance.
|
WriteConcernException(BsonDocument response,
ServerAddress address,
WriteConcernResult writeConcernResult)
Construct a new instance.
|
Constructor and Description |
---|
Mongo(java.util.List<ServerAddress> seeds)
Deprecated.
Replaced by
MongoClient.MongoClient(java.util.List) |
Mongo(java.util.List<ServerAddress> seedList,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options) |
Mongo(java.util.List<ServerAddress> seedList,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options,
MongoDriverInformation mongoDriverInformation) |
Mongo(java.util.List<ServerAddress> seedList,
MongoClientOptions options) |
Mongo(java.util.List<ServerAddress> seeds,
MongoOptions options)
Deprecated.
|
MongoClient(java.util.List<ServerAddress> seeds)
Creates an instance based on a list of replica set members or mongos servers.
|
MongoClient(java.util.List<ServerAddress> seeds,
java.util.List<MongoCredential> credentialsList)
Creates an instance based on a list of replica set members or mongos servers.
|
MongoClient(java.util.List<ServerAddress> seeds,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options)
Creates an instance based on a list of replica set members or mongos servers.
|
MongoClient(java.util.List<ServerAddress> seeds,
java.util.List<MongoCredential> credentialsList,
MongoClientOptions options,
MongoDriverInformation mongoDriverInformation)
Creates a MongoClient
|
MongoClient(java.util.List<ServerAddress> seeds,
MongoClientOptions options)
Construct an instance based on a list of replica set members or mongos servers.
|
Modifier and Type | Field and Description |
---|---|
private ServerAddress |
SingleServerBinding.serverAddress |
Constructor and Description |
---|
SingleServerBinding(Cluster cluster,
ServerAddress serverAddress)
Creates an instance, defaulting to
ReadPreference.primary() for reads. |
SingleServerBinding(Cluster cluster,
ServerAddress serverAddress,
ReadPreference readPreference)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
ServerAddress |
MongoCursor.getServerAddress()
Returns the server address
|
Modifier and Type | Field and Description |
---|---|
private ServerAddress |
SocketStream.address |
private ServerAddress |
SocketChannelStream.address |
private ServerAddress |
ServerId.address |
private ServerAddress |
ServerDescription.address |
private ServerAddress |
ServerDescription.Builder.address |
private ServerAddress |
ResponseCallback.serverAddress |
private ServerAddress |
QueryResult.serverAddress |
private ServerAddress |
BulkWriteBatchCombiner.serverAddress |
private ServerAddress |
AsynchronousSocketChannelStream.serverAddress |
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.ConcurrentMap<ServerAddress,MultiServerCluster.ServerTuple> |
MultiServerCluster.addressToServerTupleMap |
private java.util.List<ServerAddress> |
ClusterSettings.hosts |
private java.util.List<ServerAddress> |
ClusterSettings.Builder.hosts |
Modifier and Type | Method and Description |
---|---|
ServerAddress |
Stream.getAddress()
The address that this stream is connected to.
|
ServerAddress |
SocketStream.getAddress() |
ServerAddress |
SocketChannelStream.getAddress() |
ServerAddress |
ServerId.getAddress()
Gets the server address.
|
ServerAddress |
ServerDescription.getAddress()
Gets the address of this server
|
ServerAddress |
QueryResult.getAddress()
Gets the server address.
|
ServerAddress |
AsynchronousSocketChannelStream.getAddress() |
protected ServerAddress |
ResponseCallback.getServerAddress() |
private ServerAddress |
InternalStreamConnection.getServerAddress() |
ServerAddress |
ConnectionDescription.getServerAddress()
Gets the server address.
|
Modifier and Type | Method and Description |
---|---|
private java.util.Set<ServerAddress> |
MultiServerCluster.getAllServerAddresses(ServerDescription serverDescription) |
java.util.List<ServerAddress> |
ClusterSettings.getHosts()
Gets the seed list of hosts for the cluster.
|
Modifier and Type | Method and Description |
---|---|
ServerDescription.Builder |
ServerDescription.Builder.address(ServerAddress address)
Sets the address of the server.
|
private void |
MultiServerCluster.addServer(ServerAddress serverAddress) |
Stream |
StreamFactory.create(ServerAddress serverAddress)
Create a Stream to the given address
|
Stream |
SocketStreamFactory.create(ServerAddress serverAddress) |
Stream |
AsynchronousSocketChannelStreamFactory.create(ServerAddress serverAddress) |
ClusterableServer |
DefaultClusterableServerFactory.create(ServerAddress serverAddress,
ServerListener serverListener) |
ClusterableServer |
ClusterableServerFactory.create(ServerAddress serverAddress,
ServerListener serverListener) |
protected javax.security.sasl.SaslClient |
ScramSha1Authenticator.createSaslClient(ServerAddress serverAddress) |
protected abstract javax.security.sasl.SaslClient |
SaslAuthenticator.createSaslClient(ServerAddress serverAddress) |
protected javax.security.sasl.SaslClient |
PlainAuthenticator.createSaslClient(ServerAddress serverAddress) |
protected javax.security.sasl.SaslClient |
GSSAPIAuthenticator.createSaslClient(ServerAddress serverAddress) |
protected ClusterableServer |
BaseCluster.createServer(ServerAddress serverAddress,
ServerListener serverListener) |
(package private) static ServerDescription |
DescriptionHelper.createServerDescription(ServerAddress serverAddress,
BsonDocument isMasterResult,
ServerVersion serverVersion,
long roundTripTime) |
private static MongoException |
ProtocolHelper.createSpecialException(BsonDocument response,
ServerAddress serverAddress,
java.lang.String errorMessageFieldName) |
(package private) static MongoBulkWriteException |
WriteCommandResultHelper.getBulkWriteException(WriteRequest.Type type,
BsonDocument result,
ServerAddress serverAddress) |
ServerDescription |
ClusterDescription.getByServerAddress(ServerAddress serverAddress)
Deprecated.
Replace with a filter on ServerDescription in the caller
|
(package private) static MongoException |
ProtocolHelper.getCommandFailureException(BsonDocument response,
ServerAddress serverAddress) |
private ServerDescription |
MultiServerCluster.getConnectingServerDescription(ServerAddress serverAddress) |
private java.lang.String |
GSSAPIAuthenticator.getHostName(ServerAddress serverAddress) |
(package private) static MongoException |
ProtocolHelper.getQueryFailureException(BsonDocument errorDocument,
ServerAddress serverAddress) |
protected ClusterableServer |
SingleServerCluster.getServer(ServerAddress serverAddress) |
protected ClusterableServer |
MultiServerCluster.getServer(ServerAddress serverAddress) |
protected abstract ClusterableServer |
BaseCluster.getServer(ServerAddress serverAddress)
Return the server at the given address.
|
(package private) static WriteConcernResult |
ProtocolHelper.getWriteResult(BsonDocument result,
ServerAddress serverAddress) |
(package private) static void |
SocketStreamHelper.initialize(java.net.Socket socket,
ServerAddress address,
SocketSettings settings,
SslSettings sslSettings) |
private void |
MultiServerCluster.invalidateOldPrimaries(ServerAddress newPrimary) |
private boolean |
MultiServerCluster.isNotAlreadyPrimary(ServerAddress address) |
private void |
MultiServerCluster.removeServer(ServerAddress serverAddress) |
private static void |
ProtocolHelper.throwWriteException(BsonDocument result,
ServerAddress serverAddress) |
Modifier and Type | Method and Description |
---|---|
private void |
MultiServerCluster.addHostsToSet(java.util.Set<java.lang.String> hosts,
java.util.Set<ServerAddress> retVal) |
ClusterSettings.Builder |
ClusterSettings.Builder.hosts(java.util.List<ServerAddress> hosts)
Sets the hosts for the cluster.
|
Constructor and Description |
---|
AsynchronousSocketChannelStream(ServerAddress serverAddress,
SocketSettings settings,
BufferProvider bufferProvider) |
BulkWriteBatchCombiner(ServerAddress serverAddress,
boolean ordered,
WriteConcern writeConcern)
Construct an instance.
|
CommandResultBaseCallback(Decoder<T> decoder,
long requestId,
ServerAddress serverAddress) |
CommandResultCallback(SingleResultCallback<T> callback,
Decoder<T> decoder,
long requestId,
ServerAddress serverAddress) |
QueryResult(MongoNamespace namespace,
java.util.List<T> results,
long cursorId,
ServerAddress serverAddress)
Construct an instance.
|
QueryResult(MongoNamespace namespace,
ReplyMessage<T> replyMessage,
ServerAddress address)
Construct an instance.
|
ResponseCallback(long requestId,
ServerAddress serverAddress) |
ServerId(ClusterId clusterId,
ServerAddress address)
Construct an instance.
|
SocketChannelStream(ServerAddress address,
SocketSettings settings,
SslSettings sslSettings,
BufferProvider bufferProvider) |
SocketStream(ServerAddress address,
SocketSettings settings,
SslSettings sslSettings,
javax.net.SocketFactory socketFactory,
BufferProvider bufferProvider) |
Modifier and Type | Field and Description |
---|---|
private ServerAddress |
NettyStream.address |
Modifier and Type | Method and Description |
---|---|
ServerAddress |
NettyStream.getAddress() |
Modifier and Type | Method and Description |
---|---|
Stream |
NettyStreamFactory.create(ServerAddress serverAddress) |
Constructor and Description |
---|
NettyStream(ServerAddress address,
SocketSettings settings,
SslSettings sslSettings,
io.netty.channel.EventLoopGroup workerGroup,
java.lang.Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass,
io.netty.buffer.ByteBufAllocator allocator) |
Modifier and Type | Method and Description |
---|---|
static void |
SslHelper.enableSni(ServerAddress address,
javax.net.ssl.SSLParameters sslParameters)
Enable SNI if running on Java 8 or later.
|
void |
SniSslHelper.enableSni(ServerAddress address,
javax.net.ssl.SSLParameters sslParameters)
Enable SNI.
|
void |
Java8SniSslHelper.enableSni(ServerAddress address,
javax.net.ssl.SSLParameters sslParameters) |
Modifier and Type | Field and Description |
---|---|
private ServerAddress |
ConnectionPoolStatistics.serverAddress |
Modifier and Type | Method and Description |
---|---|
ServerAddress |
QueryBatchCursor.getServerAddress() |
ServerAddress |
ListCollectionsOperation.ProjectingBatchCursor.getServerAddress() |
ServerAddress |
BatchCursor.getServerAddress()
Returns the server address
|
Modifier and Type | Method and Description |
---|---|
R |
CommandOperationHelper.CommandTransformer.apply(T t,
ServerAddress serverAddress)
Yield an appropriate result object for the input object.
|
T |
CommandOperationHelper.IdentityTransformer.apply(T t,
ServerAddress serverAddress) |
java.lang.Void |
CommandOperationHelper.VoidTransformer.apply(T t,
ServerAddress serverAddress) |
(package private) static <T> AsyncBatchCursor<T> |
OperationHelper.createEmptyAsyncBatchCursor(MongoNamespace namespace,
ServerAddress serverAddress) |
(package private) static <T> QueryBatchCursor<T> |
OperationHelper.createEmptyBatchCursor(MongoNamespace namespace,
Decoder<T> decoder,
ServerAddress serverAddress,
int batchSize) |
private QueryResult<T> |
ParallelCollectionScanOperation.createQueryResult(BsonDocument cursorDocument,
ServerAddress serverAddress) |
(package private) static MongoWriteConcernException |
WriteConcernHelper.createWriteConcernError(BsonDocument result,
ServerAddress serverAddress) |
(package private) static <T> QueryResult<T> |
OperationHelper.cursorDocumentToQueryResult(BsonDocument cursorDocument,
ServerAddress serverAddress) |
private static <T> QueryResult<T> |
OperationHelper.cursorDocumentToQueryResult(BsonDocument cursorDocument,
ServerAddress serverAddress,
java.lang.String fieldNameContainingBatch) |
private QueryResult<T> |
FindOperation.documentToQueryResult(BsonDocument result,
ServerAddress serverAddress) |
(package private) static <T> QueryResult<T> |
OperationHelper.getMoreCursorDocumentToQueryResult(BsonDocument cursorDocument,
ServerAddress serverAddress) |
(package private) static void |
WriteConcernHelper.throwOnWriteConcernError(BsonDocument result,
ServerAddress serverAddress) |
Modifier and Type | Field and Description |
---|---|
private ServerAddress |
ServerAddressSelector.serverAddress |
Modifier and Type | Method and Description |
---|---|
ServerAddress |
ServerAddressSelector.getServerAddress()
Gets the server address.
|
Constructor and Description |
---|
ServerAddressSelector(ServerAddress serverAddress)
Constructs a new instance.
|