public class CollectionMongoServerImpl extends Object implements MongoServer, CollectionMongoServer
| Constructor and Description |
|---|
CollectionMongoServerImpl(org.mongodb.morphia.Datastore datastore)
Setup a new datastore to do get/delete/save operations on the database
|
CollectionMongoServerImpl(com.mongodb.MongoClient mongoClient,
String databaseName)
Constructor for the CollectionMongoServer to ensure that everything has been set upon initialization
Any required login credentials should be present in the provided mongoClient
|
CollectionMongoServerImpl(String host,
int port,
String databaseName,
String username,
String password)
Create a new datastore to do get/delete/save operations on the database
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection to the Mongo server
|
String |
findNewCollectionId(String oldCollectionId)
Retrieve the new CollectionId based on the old CollectionID.
|
String |
findOldCollectionId(String newCollectionId)
Retrieve the old CollectionId based on the new CollectionID.
|
org.mongodb.morphia.Datastore |
getDatastore()
Return the datastore.
|
List<Collection> |
retrieveAllCollections()
Retrieve all stored collections
|
void |
saveCollection(Collection collection)
Save a Collection
|
void |
setDatastore(org.mongodb.morphia.Datastore datastore) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringpublic CollectionMongoServerImpl(com.mongodb.MongoClient mongoClient,
String databaseName)
mongoClient - the Mongo Server to connect todatabaseName - the database to connect topublic CollectionMongoServerImpl(org.mongodb.morphia.Datastore datastore)
datastore - public org.mongodb.morphia.Datastore getDatastore()
getDatastore in interface MongoServerpublic void close()
close in interface MongoServerpublic String findNewCollectionId(String oldCollectionId)
CollectionMongoServerfindNewCollectionId in interface CollectionMongoServeroldCollectionId - The old Collection IDpublic String findOldCollectionId(String newCollectionId)
CollectionMongoServerfindOldCollectionId in interface CollectionMongoServerpublic void saveCollection(Collection collection)
CollectionMongoServersaveCollection in interface CollectionMongoServercollection - The collection to savepublic List<Collection> retrieveAllCollections()
CollectionMongoServerretrieveAllCollections in interface CollectionMongoServerpublic void setDatastore(org.mongodb.morphia.Datastore datastore)
setDatastore in interface CollectionMongoServerCopyright © 2017 Europeana Foundation. All rights reserved.