public class PersistenceMongoDB
extends org.gcube.documentstore.persistence.PersistenceBackend
| Modifier and Type | Field and Description |
|---|---|
static String |
COLLECTION_NAME |
protected String |
collectionName |
protected org.gcube.documentstore.persistence.PersistenceBackendConfiguration |
configuration |
static String |
DB_NAME |
protected static com.mongodb.MongoClientOptions |
MONGO_CLIENT_OPTIONS |
protected com.mongodb.MongoClient |
mongoClient |
protected com.mongodb.MongoClientOptions |
mongoClientOptions |
protected com.mongodb.client.MongoDatabase |
mongoDatabase |
static String |
PASSWORD_PROPERTY_KEY |
protected static com.mongodb.ReadPreference |
READ_PREFERENCE |
static String |
URL_PROPERTY_KEY |
static String |
USERNAME_PROPERTY_KEY |
| Constructor and Description |
|---|
PersistenceMongoDB() |
| Modifier and Type | Method and Description |
|---|---|
static org.bson.codecs.configuration.CodecRegistry |
addCoded(org.bson.codecs.configuration.CodecRegistry cr,
org.bson.codecs.Codec<?>[] codecs) |
protected void |
checkSerializability(org.gcube.documentstore.records.Record record) |
void |
close() |
protected void |
createItem(org.bson.Document document) |
protected static com.mongodb.MongoClientOptions |
createMongoClientOptions(org.bson.codecs.configuration.CodecRegistry cr) |
static List<? extends org.bson.codecs.Codec<?>> |
discoverAdditionalCodecs() |
protected static org.gcube.documentstore.records.Record |
documentToUsageRecord(org.bson.Document document) |
protected static List<org.bson.codecs.Codec> |
findMissingCodecs(org.bson.codecs.configuration.CodecRegistry cr,
org.gcube.documentstore.records.Record record) |
protected void |
prepareConnection(org.gcube.documentstore.persistence.PersistenceBackendConfiguration configuration) |
protected void |
reallyAccount(org.gcube.documentstore.records.Record record) |
static org.bson.Document |
usageRecordToDocument(org.gcube.documentstore.records.Record record) |
public static final String URL_PROPERTY_KEY
public static final String USERNAME_PROPERTY_KEY
public static final String PASSWORD_PROPERTY_KEY
public static final String DB_NAME
public static final String COLLECTION_NAME
protected String collectionName
protected static final com.mongodb.ReadPreference READ_PREFERENCE
protected static final com.mongodb.MongoClientOptions MONGO_CLIENT_OPTIONS
protected org.gcube.documentstore.persistence.PersistenceBackendConfiguration configuration
protected com.mongodb.MongoClient mongoClient
protected com.mongodb.MongoClientOptions mongoClientOptions
protected com.mongodb.client.MongoDatabase mongoDatabase
public static org.bson.codecs.configuration.CodecRegistry addCoded(org.bson.codecs.configuration.CodecRegistry cr,
org.bson.codecs.Codec<?>[] codecs)
protected static com.mongodb.MongoClientOptions createMongoClientOptions(org.bson.codecs.configuration.CodecRegistry cr)
public void close()
throws Exception
close in class org.gcube.documentstore.persistence.PersistenceBackendExceptionpublic static List<? extends org.bson.codecs.Codec<?>> discoverAdditionalCodecs()
protected void prepareConnection(org.gcube.documentstore.persistence.PersistenceBackendConfiguration configuration)
throws Exception
prepareConnection in class org.gcube.documentstore.persistence.PersistenceBackendExceptionprotected static List<org.bson.codecs.Codec> findMissingCodecs(org.bson.codecs.configuration.CodecRegistry cr, org.gcube.documentstore.records.Record record)
protected void checkSerializability(org.gcube.documentstore.records.Record record)
throws Exception
Exceptionprotected void reallyAccount(org.gcube.documentstore.records.Record record)
throws Exception
reallyAccount in class org.gcube.documentstore.persistence.PersistenceBackendExceptionpublic static org.bson.Document usageRecordToDocument(org.gcube.documentstore.records.Record record)
throws Exception
ExceptionCopyright © 2016. All Rights Reserved.