SimpleMongoClientDbFactory.@Deprecated public class SimpleMongoDbFactory extends MongoDbFactorySupport<com.mongodb.MongoClient> implements DisposableBean
MongoDatabase instances from a MongoClient instance.| Constructor and Description |
|---|
SimpleMongoDbFactory(com.mongodb.MongoClient mongoClient,
String databaseName)
Deprecated.
Creates a new
SimpleMongoDbFactory instance from the given MongoClient. |
SimpleMongoDbFactory(com.mongodb.MongoClientURI uri)
Deprecated.
Creates a new
SimpleMongoDbFactory instance from the given MongoClientURI. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeClient()
Deprecated.
Close the client instance.
|
protected com.mongodb.client.MongoDatabase |
doGetMongoDatabase(String dbName)
Deprecated.
Get the actual
MongoDatabase from the client. |
com.mongodb.DB |
getLegacyDb()
Deprecated.
Get the legacy database entry point.
|
com.mongodb.client.ClientSession |
getSession(com.mongodb.ClientSessionOptions options)
Deprecated.
Obtain a
ClientSession for given ClientSessionOptions. |
destroy, getDb, getDb, getDefaultDatabaseName, getExceptionTranslator, getMongoClient, setWriteConcern, withSessionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroygetCodecRegistry, isTransactionActive, withSessiongetCodecFor, hasCodecForpublic SimpleMongoDbFactory(com.mongodb.MongoClientURI uri)
SimpleMongoDbFactory instance from the given MongoClientURI.uri - coordinates for a database connection. Must contain a database name and must not be null.public SimpleMongoDbFactory(com.mongodb.MongoClient mongoClient,
String databaseName)
SimpleMongoDbFactory instance from the given MongoClient.mongoClient - must not be null.databaseName - must not be null or empty.public com.mongodb.DB getLegacyDb()
MongoDbFactoryMongoDbFactory.getDb() instead.getLegacyDb in interface MongoDbFactorypublic com.mongodb.client.ClientSession getSession(com.mongodb.ClientSessionOptions options)
MongoDbFactoryClientSession for given ClientSessionOptions.getSession in interface MongoDbFactorygetSession in interface MongoSessionProvideroptions - must not be null.protected void closeClient()
MongoDbFactorySupportcloseClient in class MongoDbFactorySupport<com.mongodb.MongoClient>protected com.mongodb.client.MongoDatabase doGetMongoDatabase(String dbName)
MongoDbFactorySupportMongoDatabase from the client.doGetMongoDatabase in class MongoDbFactorySupport<com.mongodb.MongoClient>dbName - must not be null or empty.Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.