public class MongoWrapper extends Object implements HelperMongo
EMPTY| Constructor and Description |
|---|
MongoWrapper(MongoDatabaseCredentials credentials) |
| Modifier and Type | Method and Description |
|---|---|
com.mongodb.MongoClient |
getClient()
Gets the client instance backing the datasource
|
com.mongodb.client.MongoDatabase |
getDatabase()
Gets the main database in use by the instance.
|
com.mongodb.client.MongoDatabase |
getDatabase(String name)
Gets a specific database instance
|
org.mongodb.morphia.Morphia |
getMorphia()
Gets the Morphia instance for this datasource
|
org.mongodb.morphia.Datastore |
getMorphiaDatastore()
Gets the main Morphia datastore in use by the instance
|
org.mongodb.morphia.Datastore |
getMorphiaDatastore(String name)
Gets a specific Morphia datastore instance
|
boolean |
terminate() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitusingMongoDbbindWith, close, hasTerminated, ofpublic MongoWrapper(@Nonnull MongoDatabaseCredentials credentials)
@Nonnull public com.mongodb.MongoClient getClient()
HelperMongogetClient in interface HelperMongo@Nonnull public com.mongodb.client.MongoDatabase getDatabase()
HelperMongogetDatabase in interface HelperMongopublic com.mongodb.client.MongoDatabase getDatabase(String name)
HelperMongogetDatabase in interface HelperMongoname - the name of the databasepublic boolean terminate()
terminate in interface Terminablepublic org.mongodb.morphia.Morphia getMorphia()
HelperMongogetMorphia in interface HelperMongopublic org.mongodb.morphia.Datastore getMorphiaDatastore()
HelperMongogetMorphiaDatastore in interface HelperMongopublic org.mongodb.morphia.Datastore getMorphiaDatastore(String name)
HelperMongogetMorphiaDatastore in interface HelperMongoname - the name of the databaseCopyright © 2017. All rights reserved.