public class MongoDriver extends Object implements MorphiumDriver
VERSION_NAME| Constructor and Description |
|---|
MongoDriver() |
public boolean isReplicaset()
isReplicaset in interface MorphiumDriverpublic void setCredentials(String db, String login, char[] pwd)
setCredentials in interface MorphiumDriverpublic String getAtlasUrl()
getAtlasUrl in interface MorphiumDriverpublic void setAtlasUrl(String atlasUrl)
setAtlasUrl in interface MorphiumDriverpublic List<String> listDatabases() throws MorphiumDriverException
listDatabases in interface MorphiumDriverMorphiumDriverExceptionpublic void addCommandListener(com.mongodb.event.CommandListener cmd)
addCommandListener in interface MorphiumDriverpublic void removeCommandListener(com.mongodb.event.CommandListener cmd)
removeCommandListener in interface MorphiumDriverpublic void addClusterListener(com.mongodb.event.ClusterListener cl)
addClusterListener in interface MorphiumDriverpublic void removeClusterListener(com.mongodb.event.ClusterListener cl)
removeClusterListener in interface MorphiumDriverpublic void addConnectionPoolListener(com.mongodb.event.ConnectionPoolListener cpl)
addConnectionPoolListener in interface MorphiumDriverpublic void removeConnectionPoolListener(com.mongodb.event.ConnectionPoolListener cpl)
removeConnectionPoolListener in interface MorphiumDriverpublic List<String> listCollections(String db, String pattern) throws MorphiumDriverException
MorphiumDriverlistCollections in interface MorphiumDriverpattern - regular expression for the collection, might be nullMorphiumDriverExceptionpublic ReadPreference getDefaultReadPreference()
public void setDefaultReadPreference(ReadPreference defaultReadPreference)
setDefaultReadPreference in interface MorphiumDriverpublic String[] getCredentials(String db)
getCredentials in interface MorphiumDriverpublic boolean isDefaultFsync()
isDefaultFsync in interface MorphiumDriverpublic void setDefaultFsync(boolean j)
setDefaultFsync in interface MorphiumDriverpublic String[] getHostSeed()
getHostSeed in interface MorphiumDriverpublic void setHostSeed(String... host)
setHostSeed in interface MorphiumDriverpublic int getMaxConnections()
getMaxConnections in interface MorphiumDriverpublic void setMaxConnections(int maxConnections)
setMaxConnections in interface MorphiumDriverpublic int getMinConnections()
getMinConnections in interface MorphiumDriverpublic void setMinConnections(int minConnections)
setMinConnections in interface MorphiumDriverpublic int getMaxConnectionLifetime()
getMaxConnectionLifetime in interface MorphiumDriverpublic void setMaxConnectionLifetime(int timeout)
setMaxConnectionLifetime in interface MorphiumDriverpublic int getMaxConnectionIdleTime()
getMaxConnectionIdleTime in interface MorphiumDriverpublic void setMaxConnectionIdleTime(int time)
setMaxConnectionIdleTime in interface MorphiumDriverpublic int getConnectionTimeout()
getConnectionTimeout in interface MorphiumDriverpublic void setConnectionTimeout(int timeout)
setConnectionTimeout in interface MorphiumDriverpublic int getDefaultW()
getDefaultW in interface MorphiumDriverpublic void setDefaultW(int w)
setDefaultW in interface MorphiumDriverpublic int getHeartbeatFrequency()
getHeartbeatFrequency in interface MorphiumDriverpublic void setHeartbeatFrequency(int heartbeatFrequency)
setHeartbeatFrequency in interface MorphiumDriverpublic void setDefaultBatchSize(int defaultBatchSize)
setDefaultBatchSize in interface MorphiumDriverpublic void setCredentials(Map<String,String[]> credentials)
setCredentials in interface MorphiumDriverpublic void setMongo(com.mongodb.client.MongoClient mongo)
public boolean isRetryReads()
isRetryReads in interface MorphiumDriverpublic void setRetryReads(boolean retryReads)
setRetryReads in interface MorphiumDriverpublic boolean isRetryWrites()
isRetryWrites in interface MorphiumDriverpublic void setRetryWrites(boolean retryWrites)
setRetryWrites in interface MorphiumDriverpublic String getUuidRepresentation()
getUuidRepresentation in interface MorphiumDriverpublic void setUuidRepresentation(String uuidRepresentation)
setUuidRepresentation in interface MorphiumDriverpublic boolean isUseSSL()
isUseSSL in interface MorphiumDriverpublic void setUseSSL(boolean useSSL)
setUseSSL in interface MorphiumDriverpublic boolean isDefaultJ()
isDefaultJ in interface MorphiumDriverpublic void setDefaultJ(boolean j)
setDefaultJ in interface MorphiumDriverpublic int getLocalThreshold()
getLocalThreshold in interface MorphiumDriverpublic void setLocalThreshold(int thr)
setLocalThreshold in interface MorphiumDriverpublic void heartBeatFrequency(int t)
heartBeatFrequency in interface MorphiumDriverpublic void useSsl(boolean ssl)
useSsl in interface MorphiumDriverpublic int getReadTimeout()
getReadTimeout in interface MorphiumDriverpublic void setReadTimeout(int readTimeout)
setReadTimeout in interface MorphiumDriverpublic void connect()
throws MorphiumDriverException
connect in interface MorphiumDriverMorphiumDriverExceptionpublic void connect(String replicasetName) throws MorphiumDriverException
connect in interface MorphiumDriverMorphiumDriverExceptionpublic Maximums getMaximums()
getMaximums in interface MorphiumDriverpublic boolean isConnected()
isConnected in interface MorphiumDriverpublic int getDefaultWriteTimeout()
getDefaultWriteTimeout in interface MorphiumDriverpublic void setDefaultWriteTimeout(int wt)
setDefaultWriteTimeout in interface MorphiumDriverpublic void close()
throws MorphiumDriverException
close in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> getReplsetStatus() throws MorphiumDriverException
getReplsetStatus in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> getDBStats(String db) throws MorphiumDriverException
getDBStats in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> getCollStats(String db, String coll) throws MorphiumDriverException
getCollStats in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> getOps(long threshold)
getOps in interface MorphiumDriverpublic Map<String,Object> runCommand(String db, Map<String,Object> cmd) throws MorphiumDriverException
runCommand in interface MorphiumDriverMorphiumDriverExceptionpublic MorphiumCursor initAggregationIteration(String db, String collection, List<Map<String,Object>> aggregationPipeline, ReadPreference readPreference, Collation collation, int batchSize, Map<String,Object> findMetaData) throws MorphiumDriverException
initAggregationIteration in interface MorphiumDriverMorphiumDriverExceptionpublic MorphiumCursor 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 collation, Map<String,Object> findMetaData) throws MorphiumDriverException
initIteration in interface MorphiumDriverMorphiumDriverExceptionpublic void watch(String db, int maxWaitTime, boolean fullDocumentOnUpdate, List<Map<String,Object>> pipeline, DriverTailableIterationCallback cb) throws MorphiumDriverException
watch in interface MorphiumDriverMorphiumDriverExceptionpublic void watch(String db, String collection, int maxWaitTime, boolean fullDocumentOnUpdate, List<Map<String,Object>> pipeline, DriverTailableIterationCallback cb) throws MorphiumDriverException
watch in interface MorphiumDriverMorphiumDriverExceptionpublic void 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
tailableIteration in interface MorphiumDriverMorphiumDriverExceptionpublic MorphiumCursor nextIteration(MorphiumCursor crs) throws MorphiumDriverException
nextIteration in interface MorphiumDriverMorphiumDriverExceptionpublic void closeIteration(MorphiumCursor crs) throws MorphiumDriverException
closeIteration in interface MorphiumDriverMorphiumDriverExceptionpublic List<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
find in interface MorphiumDriverMorphiumDriverExceptionpublic com.mongodb.client.MongoCollection<org.bson.Document> getCollection(com.mongodb.client.MongoDatabase database,
String collection,
ReadPreference readPreference,
WriteConcern wc)
public long count(String db, String collection, Map<String,Object> query, Collation collation, ReadPreference rp)
count in interface MorphiumDriverpublic long estimatedDocumentCount(String db, String collection, ReadPreference rp)
estimatedDocumentCount in interface MorphiumDriverpublic Map<String,Integer> store(String db, String collection, List<Map<String,Object>> objs, WriteConcern wc) throws MorphiumDriverException
MorphiumDriverstore in interface MorphiumDriverMorphiumDriverExceptionpublic void insert(String db, String collection, List<Map<String,Object>> objs, WriteConcern wc) throws MorphiumDriverException
MorphiumDriverinsert in interface MorphiumDriverMorphiumDriverExceptionpublic Map<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
update in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> delete(String db, String collection, Map<String,Object> query, boolean multiple, Collation collation, WriteConcern wc) throws MorphiumDriverException
delete in interface MorphiumDriverMorphiumDriverExceptionpublic void drop(String db, String collection, WriteConcern wc) throws MorphiumDriverException
drop in interface MorphiumDriverMorphiumDriverExceptionpublic void drop(String db, WriteConcern wc) throws MorphiumDriverException
drop in interface MorphiumDriverMorphiumDriverExceptionpublic boolean exists(String db)
exists in interface MorphiumDriverpublic List<Object> distinct(String db, String collection, String field, Map<String,Object> filter, Collation collation, ReadPreference rp) throws MorphiumDriverException
distinct in interface MorphiumDriverMorphiumDriverExceptionpublic boolean exists(String db, String collection) throws MorphiumDriverException
exists in interface MorphiumDriverMorphiumDriverExceptionpublic List<Map<String,Object>> getIndexes(String db, String collection) throws MorphiumDriverException
getIndexes in interface MorphiumDriverMorphiumDriverExceptionpublic List<String> getCollectionNames(String db) throws MorphiumDriverException
getCollectionNames in interface MorphiumDriverMorphiumDriverExceptionpublic Map<String,Object> findAndOneAndDelete(String db, String col, Map<String,Object> query, Map<String,Integer> sort, Collation collation)
findAndOneAndDelete in interface MorphiumDriverpublic Map<String,Object> findAndOneAndUpdate(String db, String col, Map<String,Object> query, Map<String,Object> update, Map<String,Integer> sort, Collation collation)
findAndOneAndUpdate in interface MorphiumDriverpublic Map<String,Object> findAndOneAndReplace(String db, String col, Map<String,Object> query, Map<String,Object> replacement, Map<String,Integer> sort, Collation collation)
findAndOneAndReplace in interface MorphiumDriverpublic List<Map<String,Object>> aggregate(String db, String collection, List<Map<String,Object>> pipeline, boolean explain, boolean allowDiskUse, Collation collation, ReadPreference readPreference)
aggregate in interface MorphiumDriverpublic int getMaxWaitTime()
getMaxWaitTime in interface MorphiumDriverpublic void setMaxWaitTime(int maxWaitTime)
setMaxWaitTime in interface MorphiumDriverpublic int getServerSelectionTimeout()
getServerSelectionTimeout in interface MorphiumDriverpublic void setServerSelectionTimeout(int serverSelectionTimeout)
setServerSelectionTimeout in interface MorphiumDriverpublic int getRetriesOnNetworkError()
getRetriesOnNetworkError in interface MorphiumDriverpublic void setRetriesOnNetworkError(int retriesOnNetworkError)
setRetriesOnNetworkError in interface MorphiumDriverpublic int getSleepBetweenErrorRetries()
getSleepBetweenErrorRetries in interface MorphiumDriverpublic void setSleepBetweenErrorRetries(int sleepBetweenErrorRetries)
setSleepBetweenErrorRetries in interface MorphiumDriverpublic Map<String,Object> getCollectionStats(String db, String coll, int scale, boolean verbose) throws MorphiumDriverException
MorphiumDriverExceptionpublic boolean isCapped(String db, String coll) throws MorphiumDriverException
isCapped in interface MorphiumDriverMorphiumDriverExceptionpublic BulkRequestContext createBulkContext(Morphium m, String db, String collection, boolean ordered, WriteConcern wc)
createBulkContext in interface MorphiumDriverpublic com.mongodb.client.MongoDatabase getDb(String db)
public com.mongodb.client.MongoCollection<org.bson.Document> getCollection(String db, String coll)
public void createIndex(String db, String collection, Map<String,Object> index, Map<String,Object> options) throws MorphiumDriverException
createIndex in interface MorphiumDriverMorphiumDriverExceptionpublic List<Map<String,Object>> mapReduce(String db, String collection, String mapping, String reducing)
mapReduce in interface MorphiumDriverpublic List<Map<String,Object>> mapReduce(String db, String collection, String mapping, String reducing, Map<String,Object> query)
mapReduce in interface MorphiumDriverpublic List<Map<String,Object>> mapReduce(String db, String collection, String mapping, String reducing, Map<String,Object> query, Map<String,Object> sorting, Collation collation)
mapReduce in interface MorphiumDriverpublic void startTransaction()
startTransaction in interface MorphiumDriverpublic void commitTransaction()
commitTransaction in interface MorphiumDriverpublic MorphiumTransactionContext getTransactionContext()
getTransactionContext in interface MorphiumDriverpublic void abortTransaction()
abortTransaction in interface MorphiumDriverpublic void setTransactionContext(MorphiumTransactionContext ctx)
setTransactionContext in interface MorphiumDriverpublic SSLContext getSslContext()
getSslContext in interface MorphiumDriverpublic void setSslContext(SSLContext sslContext)
setSslContext in interface MorphiumDriverpublic boolean isSslInvalidHostNameAllowed()
isSslInvalidHostNameAllowed in interface MorphiumDriverpublic void setSslInvalidHostNameAllowed(boolean sslInvalidHostNameAllowed)
setSslInvalidHostNameAllowed in interface MorphiumDriverCopyright © 2022. All rights reserved.