Package step.core.accessors
Class MongoClientSession
- java.lang.Object
-
- step.core.accessors.MongoClientSession
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class MongoClientSession extends Object implements Closeable
-
-
Field Summary
Fields Modifier and Type Field Description protected ch.exense.commons.app.Configuration
configuration
protected String
db
protected com.mongodb.MongoClient
mongoClient
-
Constructor Summary
Constructors Constructor Description MongoClientSession(ch.exense.commons.app.Configuration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
org.jongo.MongoCollection
getJongoCollection(String collectionName)
com.mongodb.client.MongoDatabase
getMongoDatabase()
protected void
initMongoClient()
-
-
-
Field Detail
-
mongoClient
protected com.mongodb.MongoClient mongoClient
-
db
protected String db
-
configuration
protected ch.exense.commons.app.Configuration configuration
-
-
Method Detail
-
initMongoClient
protected void initMongoClient()
-
getMongoDatabase
public com.mongodb.client.MongoDatabase getMongoDatabase()
-
getJongoCollection
public org.jongo.MongoCollection getJongoCollection(String collectionName)
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-