public interface MorphiumDriver
All drivers need to implement this interface. you can add your own drivers to morphium. These are actually not limited to be mongodb drivers. There is also an InMemory implementation.
| Modifier and Type | Field and Description |
|---|---|
static String |
VERSION_NAME |
static final String VERSION_NAME
String getAtlasUrl()
void setAtlasUrl(String atlasUrl)
List<String> listDatabases() throws MorphiumDriverException
MorphiumDriverExceptionboolean isReplicaset()
boolean isDefaultFsync()
void setDefaultFsync(boolean j)
String[] getHostSeed()
void setHostSeed(String... host)
int getMaxConnections()
void setMaxConnections(int maxConnections)
int getMinConnections()
void setMinConnections(int minConnections)
int getMaxConnectionLifetime()
void setMaxConnectionLifetime(int timeout)
int getMaxConnectionIdleTime()
void setMaxConnectionIdleTime(int time)
int getConnectionTimeout()
void setConnectionTimeout(int timeout)
int getDefaultW()
void setDefaultW(int w)
int getHeartbeatFrequency()
void setHeartbeatFrequency(int heartbeatFrequency)
void setDefaultBatchSize(int defaultBatchSize)
boolean isRetryReads()
void setRetryReads(boolean retryReads)
boolean isRetryWrites()
void setRetryWrites(boolean retryWrites)
String getUuidRepresentation()
void setUuidRepresentation(String uuidRepresentation)
boolean isUseSSL()
void setUseSSL(boolean useSSL)
boolean isDefaultJ()
void setDefaultJ(boolean j)
int getLocalThreshold()
void setLocalThreshold(int thr)
int getReadTimeout()
void setReadTimeout(int readTimeout)
void heartBeatFrequency(int t)
void useSsl(boolean ssl)
void connect()
throws MorphiumDriverException
MorphiumDriverExceptionvoid setDefaultReadPreference(ReadPreference rp)
void connect(String replicasetName) throws MorphiumDriverException
MorphiumDriverExceptionMaximums getMaximums()
boolean isConnected()
int getDefaultWriteTimeout()
void setDefaultWriteTimeout(int wt)
int getRetriesOnNetworkError()
void setRetriesOnNetworkError(int r)
int getSleepBetweenErrorRetries()
void setSleepBetweenErrorRetries(int s)
void close()
throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> getReplsetStatus() throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> getDBStats(String db) throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> getCollStats(String db, String coll) throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> getOps(long threshold) throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> runCommand(String db, Map<String,Object> cmd) throws MorphiumDriverException
MorphiumDriverExceptionMorphiumCursor initAggregationIteration(String db, String collection, List<Map<String,Object>> aggregationPipeline, ReadPreference readPreference, Collation collation, int batchSize, Map<String,Object> findMetaData) throws MorphiumDriverException
MorphiumDriverExceptionMorphiumCursor initIteration(String db, String collection, Map<String,Object> query, Map<String,Integer> sort, Map<String,Object> projection, int skip, int limit, int batchSize, ReadPreference readPreference, Collation coll, Map<String,Object> findMetaData) throws MorphiumDriverException
MorphiumDriverExceptionvoid watch(String db, int maxWait, boolean fullDocumentOnUpdate, List<Map<String,Object>> pipeline, DriverTailableIterationCallback cb) throws MorphiumDriverException
MorphiumDriverExceptionvoid watch(String db, String collection, int maxWait, boolean fullDocumentOnUpdate, List<Map<String,Object>> pipeline, DriverTailableIterationCallback cb) throws MorphiumDriverException
MorphiumDriverExceptionvoid tailableIteration(String db, String collection, Map<String,Object> query, Map<String,Integer> sort, Map<String,Object> projection, int skip, int limit, int batchSize, ReadPreference readPreference, int timeout, DriverTailableIterationCallback cb) throws MorphiumDriverException
MorphiumDriverExceptionMorphiumCursor nextIteration(MorphiumCursor crs) throws MorphiumDriverException
MorphiumDriverExceptionvoid closeIteration(MorphiumCursor crs) throws MorphiumDriverException
MorphiumDriverExceptionList<Map<String,Object>> find(String db, String collection, Map<String,Object> query, Map<String,Integer> sort, Map<String,Object> projection, int skip, int limit, int batchSize, ReadPreference readPreference, Collation collation, Map<String,Object> findMetaData) throws MorphiumDriverException
MorphiumDriverExceptionlong count(String db, String collection, Map<String,Object> query, Collation collation, ReadPreference rp) throws MorphiumDriverException
MorphiumDriverExceptionlong estimatedDocumentCount(String db, String collection, ReadPreference rp)
void insert(String db, String collection, List<Map<String,Object>> objs, WriteConcern wc) throws MorphiumDriverException
db - collection - wc - MorphiumDriverExceptionMap<String,Integer> store(String db, String collection, List<Map<String,Object>> objs, WriteConcern wc) throws MorphiumDriverException
db - collection - objs - wc - MorphiumDriverExceptionMap<String,Object> update(String db, String collection, Map<String,Object> query, Map<String,Object> op, boolean multiple, boolean upsert, Collation collation, WriteConcern wc) throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> delete(String db, String collection, Map<String,Object> query, boolean multiple, Collation collation, WriteConcern wc) throws MorphiumDriverException
MorphiumDriverExceptionvoid drop(String db, String collection, WriteConcern wc) throws MorphiumDriverException
MorphiumDriverExceptionvoid drop(String db, WriteConcern wc) throws MorphiumDriverException
MorphiumDriverExceptionboolean exists(String db) throws MorphiumDriverException
MorphiumDriverExceptionList<Object> distinct(String db, String collection, String field, Map<String,Object> filter, Collation collation, ReadPreference rp) throws MorphiumDriverException
MorphiumDriverExceptionboolean exists(String db, String collection) throws MorphiumDriverException
MorphiumDriverExceptionList<Map<String,Object>> getIndexes(String db, String collection) throws MorphiumDriverException
MorphiumDriverExceptionList<String> getCollectionNames(String db) throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> findAndOneAndDelete(String db, String col, Map<String,Object> query, Map<String,Integer> sort, Collation collation) throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> findAndOneAndUpdate(String db, String col, Map<String,Object> query, Map<String,Object> update, Map<String,Integer> sort, Collation collation) throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> findAndOneAndReplace(String db, String col, Map<String,Object> query, Map<String,Object> replacement, Map<String,Integer> sort, Collation collation) throws MorphiumDriverException
MorphiumDriverExceptionList<Map<String,Object>> aggregate(String db, String collection, List<Map<String,Object>> pipeline, boolean explain, boolean allowDiskUse, Collation collation, ReadPreference readPreference) throws MorphiumDriverException
MorphiumDriverExceptionint getMaxWaitTime()
void setMaxWaitTime(int maxWaitTime)
int getServerSelectionTimeout()
void setServerSelectionTimeout(int serverSelectionTimeout)
boolean isCapped(String db, String coll) throws MorphiumDriverException
MorphiumDriverExceptionBulkRequestContext createBulkContext(Morphium m, String db, String collection, boolean ordered, WriteConcern wc)
void createIndex(String db, String collection, Map<String,Object> index, Map<String,Object> options) throws MorphiumDriverException
MorphiumDriverExceptionList<Map<String,Object>> mapReduce(String db, String collection, String mapping, String reducing) throws MorphiumDriverException
MorphiumDriverExceptionList<Map<String,Object>> mapReduce(String db, String collection, String mapping, String reducing, Map<String,Object> query) throws MorphiumDriverException
MorphiumDriverExceptionList<Map<String,Object>> mapReduce(String db, String collection, String mapping, String reducing, Map<String,Object> query, Map<String,Object> sorting, Collation collation) throws MorphiumDriverException
MorphiumDriverExceptionvoid addCommandListener(com.mongodb.event.CommandListener cmd)
void removeCommandListener(com.mongodb.event.CommandListener cmd)
void addClusterListener(com.mongodb.event.ClusterListener cl)
void removeClusterListener(com.mongodb.event.ClusterListener cl)
void addConnectionPoolListener(com.mongodb.event.ConnectionPoolListener cpl)
void removeConnectionPoolListener(com.mongodb.event.ConnectionPoolListener cpl)
List<String> listCollections(String db, String pattern) throws MorphiumDriverException
pattern - regular expression for the collection, might be nullMorphiumDriverExceptionvoid startTransaction()
void commitTransaction()
MorphiumTransactionContext getTransactionContext()
void setTransactionContext(MorphiumTransactionContext ctx)
void abortTransaction()
SSLContext getSslContext()
void setSslContext(SSLContext sslContext)
boolean isSslInvalidHostNameAllowed()
void setSslInvalidHostNameAllowed(boolean sslInvalidHostNameAllowed)
Copyright © 2022. All rights reserved.