S
- Concrete ClientSession typepublic interface MongoContext<S extends com.mongodb.session.ClientSession>
extends com.holonplatform.core.ExpressionResolver.ExpressionResolverProvider
Modifier and Type | Method and Description |
---|---|
Optional<S> |
getClientSession()
Get the current client session, if available.
|
org.bson.codecs.configuration.CodecRegistry |
getDatabaseCodecRegistry()
Get the
CodecRegistry bound to the current database. |
EnumCodecStrategy |
getDefaultEnumCodecStrategy()
Get the default
EnumCodecStrategy . |
Optional<com.mongodb.ReadConcern> |
getDefaultReadConcern()
Get the default
ReadConcern to declare the read operations isolation level. |
Optional<com.mongodb.ReadPreference> |
getDefaultReadPreference()
Get the default
ReadPreference for query or data read operations. |
Optional<com.mongodb.WriteConcern> |
getDefaultWriteConcern()
Get the default
WriteConcern to use with write operations. |
DocumentIdResolver |
getDocumentIdResolver()
Get the
DocumentIdResolver of this context. |
default String |
toJson(org.bson.conversions.Bson bson)
Serialize given
Bson value to JSON using the database codec registry. |
default String |
toJson(org.bson.Document document)
Serialize given document to JSON using the database codec registry.
|
default String |
toJson(List<org.bson.Document> documents)
Serialize given documents to JSON using the database codec registry.
|
default void |
trace(String title,
org.bson.Document document)
Trace given JSON Document.
|
default void |
trace(String title,
List<org.bson.Document> documents)
Trace given JSON Documents.
|
default void |
trace(String title,
String json)
Trace given JSON expression.
|
void |
trace(String title,
Supplier<String> json)
Trace given JSON expression.
|
Optional<S> getClientSession()
DocumentIdResolver getDocumentIdResolver()
DocumentIdResolver
of this context.DocumentIdResolver
org.bson.codecs.configuration.CodecRegistry getDatabaseCodecRegistry()
CodecRegistry
bound to the current database.CodecRegistry
EnumCodecStrategy getDefaultEnumCodecStrategy()
EnumCodecStrategy
.EnumCodecStrategy
sOptional<com.mongodb.ReadPreference> getDefaultReadPreference()
ReadPreference
for query or data read operations.ReadPreference
Optional<com.mongodb.ReadConcern> getDefaultReadConcern()
ReadConcern
to declare the read operations isolation level.ReadConcern
Optional<com.mongodb.WriteConcern> getDefaultWriteConcern()
WriteConcern
to use with write operations.WriteConcern
default String toJson(org.bson.Document document)
document
- The document to serializedefault String toJson(List<org.bson.Document> documents)
documents
- The documents to serializedefault String toJson(org.bson.conversions.Bson bson)
Bson
value to JSON using the database codec registry.bson
- The Bson value to serializevoid trace(String title, Supplier<String> json)
If tracing is enabled, the JSON expression is logged using the INFO
level, otherwise it is logged
using the DEBUG
level.
title
- Optional titlejson
- JSON to tracedefault void trace(String title, String json)
If tracing is enabled, the JSON expression is logged using the INFO
level, otherwise it is logged
using the DEBUG
level.
title
- Optional titlejson
- JSON to tracedefault void trace(String title, org.bson.Document document)
If tracing is enabled, the JSON expression is logged using the INFO
level, otherwise it is logged
using the DEBUG
level.
title
- Optional titledocument
- Document to traceCopyright © 2019 The Holon Platform. All rights reserved.