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
List<String> listDatabases() throws MorphiumDriverException
MorphiumDriverExceptionboolean isReplicaset()
boolean isDefaultFsync()
void setDefaultFsync(boolean j)
String[] getHostSeed()
void setHostSeed(String... host)
int getMaxConnectionsPerHost()
void setMaxConnectionsPerHost(int mx)
int getMinConnectionsPerHost()
void setMinConnectionsPerHost(int mx)
int getMaxConnectionLifetime()
void setMaxConnectionLifetime(int timeout)
int getMaxConnectionIdleTime()
void setMaxConnectionIdleTime(int time)
int getSocketTimeout()
void setSocketTimeout(int timeout)
int getConnectionTimeout()
void setConnectionTimeout(int timeout)
int getDefaultW()
void setDefaultW(int w)
int getMaxBlockintThreadMultiplier()
int getHeartbeatFrequency()
void setHeartbeatFrequency(int heartbeatFrequency)
void setDefaultBatchSize(int defaultBatchSize)
int getHeartbeatSocketTimeout()
void setHeartbeatSocketTimeout(int heartbeatSocketTimeout)
boolean isUseSSL()
void setUseSSL(boolean useSSL)
boolean isDefaultJ()
void setDefaultJ(boolean j)
int getWriteTimeout()
void setWriteTimeout(int writeTimeout)
int getLocalThreshold()
void setLocalThreshold(int thr)
void setMaxBlockingThreadMultiplier(int m)
void heartBeatFrequency(int t)
void heartBeatSocketTimeout(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> getOps(long threshold) throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> runCommand(String db, Map<String,Object> cmd) 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, Map<String,Object> findMetaData) throws MorphiumDriverException
MorphiumDriverExceptionvoid watch(String db, int maxWait, boolean fullDocumentOnUpdate, DriverTailableIterationCallback cb) throws MorphiumDriverException
MorphiumDriverExceptionvoid watch(String db, String collection, int maxWait, boolean fullDocumentOnUpdate, 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 rp, Map<String,Object> findMetaData) throws MorphiumDriverException
MorphiumDriverExceptionlong count(String db, String collection, Map<String,Object> query, ReadPreference rp) throws MorphiumDriverException
MorphiumDriverExceptionvoid insert(String db, String collection, List<Map<String,Object>> objs, WriteConcern wc) throws MorphiumDriverException
db - collection - objs - wc - MorphiumDriverExceptionMap<String,Object> 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, WriteConcern wc) throws MorphiumDriverException
MorphiumDriverExceptionMap<String,Object> delete(String db, String collection, Map<String,Object> query, boolean multiple, 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, 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> group(String db, String coll, Map<String,Object> query, Map<String,Object> initial, String jsReduce, String jsFinalize, ReadPreference rp, String... keys) throws MorphiumDriverException
MorphiumDriverExceptionList<Map<String,Object>> aggregate(String db, String collection, List<Map<String,Object>> pipeline, boolean explain, boolean allowDiskUse, ReadPreference readPreference) throws MorphiumDriverException
MorphiumDriverExceptionboolean isSocketKeepAlive()
void setSocketKeepAlive(boolean socketKeepAlive)
int getHeartbeatConnectTimeout()
void setHeartbeatConnectTimeout(int heartbeatConnectTimeout)
int getMaxWaitTime()
void setMaxWaitTime(int maxWaitTime)
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) throws MorphiumDriverException
MorphiumDriverExceptionList<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()
Copyright © 2019. All rights reserved.