Package de.caluga.morphium.driver
Interface MorphiumDriver
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DriverBase,InMemoryDriver,PooledDriver,SingleMongoConnectDriver
public interface MorphiumDriver extends Closeable
Morphium driver interfaceAll 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMorphiumDriver.DriverStatsKey
-
Method Summary
-
-
-
Method Detail
-
getName
String getName()
-
getMaxBsonObjectSize
int getMaxBsonObjectSize()
-
setMaxBsonObjectSize
void setMaxBsonObjectSize(int maxBsonObjectSize)
-
getMaxMessageSize
int getMaxMessageSize()
-
setMaxMessageSize
void setMaxMessageSize(int maxMessageSize)
-
getMaxWriteBatchSize
int getMaxWriteBatchSize()
-
setMaxWriteBatchSize
void setMaxWriteBatchSize(int maxWriteBatchSize)
-
isReplicaSet
boolean isReplicaSet()
-
setReplicaSet
void setReplicaSet(boolean replicaSet)
-
getDefaultJ
boolean getDefaultJ()
-
getDefaultWriteTimeout
int getDefaultWriteTimeout()
-
setDefaultWriteTimeout
void setDefaultWriteTimeout(int wt)
-
getMaxWaitTime
int getMaxWaitTime()
-
setMaxWaitTime
void setMaxWaitTime(int maxWaitTime)
-
setHostSeed
void setHostSeed(String... host)
-
setConnectionUrl
void setConnectionUrl(String connectionUrl) throws MalformedURLException
- Throws:
MalformedURLException
-
connect
void connect() throws MorphiumDriverException- Throws:
MorphiumDriverException
-
connect
void connect(String replicaSetName) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
isConnected
boolean isConnected()
-
isReplicaset
boolean isReplicaset()
-
createAggregator
<T,R> Aggregator<T,R> createAggregator(Morphium morphium, Class<? extends T> type, Class<? extends R> resultType)
-
listDatabases
List<String> listDatabases() throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
listCollections
List<String> listCollections(String db, String pattern) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getReplicaSetName
String getReplicaSetName()
-
setReplicaSetName
void setReplicaSetName(String replicaSetName)
-
getRetriesOnNetworkError
int getRetriesOnNetworkError()
-
setRetriesOnNetworkError
MorphiumDriver setRetriesOnNetworkError(int r)
-
getSleepBetweenErrorRetries
int getSleepBetweenErrorRetries()
-
setSleepBetweenErrorRetries
MorphiumDriver setSleepBetweenErrorRetries(int s)
-
getMaxConnections
int getMaxConnections()
-
setMaxConnections
MorphiumDriver setMaxConnections(int maxConnections)
-
getMinConnections
int getMinConnections()
-
setMinConnections
MorphiumDriver setMinConnections(int minConnections)
-
isRetryReads
boolean isRetryReads()
-
setRetryReads
MorphiumDriver setRetryReads(boolean retryReads)
-
isRetryWrites
boolean isRetryWrites()
-
setRetryWrites
MorphiumDriver setRetryWrites(boolean retryWrites)
-
getReadTimeout
int getReadTimeout()
-
setReadTimeout
void setReadTimeout(int readTimeout)
-
getMinConnectionsPerHost
int getMinConnectionsPerHost()
-
setMinConnectionsPerHost
void setMinConnectionsPerHost(int minConnectionsPerHost)
-
getMaxConnectionsPerHost
int getMaxConnectionsPerHost()
-
setMaxConnectionsPerHost
void setMaxConnectionsPerHost(int maxConnectionsPerHost)
-
isCapped
boolean isCapped(String db, String coll) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
startTransaction
MorphiumTransactionContext startTransaction(boolean autoCommit)
-
isTransactionInProgress
boolean isTransactionInProgress()
-
commitTransaction
void commitTransaction() throws MorphiumDriverException- Throws:
MorphiumDriverException
-
getTransactionContext
MorphiumTransactionContext getTransactionContext()
-
setTransactionContext
void setTransactionContext(MorphiumTransactionContext ctx)
-
abortTransaction
void abortTransaction() throws MorphiumDriverException- Throws:
MorphiumDriverException
-
getReplsetStatus
Map<String,Object> getReplsetStatus() throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getDBStats
Map<String,Object> getDBStats(String db) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getCollStats
Map<String,Object> getCollStats(String db, String coll) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getMaxConnectionLifetime
int getMaxConnectionLifetime()
-
setMaxConnectionLifetime
void setMaxConnectionLifetime(int timeout)
-
getMaxConnectionIdleTime
int getMaxConnectionIdleTime()
-
setMaxConnectionIdleTime
void setMaxConnectionIdleTime(int time)
-
getConnectionTimeout
int getConnectionTimeout()
-
setConnectionTimeout
void setConnectionTimeout(int timeout)
-
getDefaultW
int getDefaultW()
-
setDefaultW
void setDefaultW(int w)
-
getHeartbeatFrequency
int getHeartbeatFrequency()
-
setHeartbeatFrequency
void setHeartbeatFrequency(int heartbeatFrequency)
-
getDefaultReadPreference
ReadPreference getDefaultReadPreference()
-
setDefaultReadPreference
void setDefaultReadPreference(ReadPreference rp)
-
getDefaultBatchSize
int getDefaultBatchSize()
-
setDefaultBatchSize
void setDefaultBatchSize(int defaultBatchSize)
-
isUseSSL
boolean isUseSSL()
-
setUseSSL
void setUseSSL(boolean useSSL)
-
isDefaultJ
boolean isDefaultJ()
-
setDefaultJ
void setDefaultJ(boolean j)
-
watch
void watch(WatchCommand settings) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getReadConnection
MongoConnection getReadConnection(ReadPreference rp)
-
getPrimaryConnection
MongoConnection getPrimaryConnection(WriteConcern wc) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
releaseConnection
void releaseConnection(MongoConnection con)
-
exists
boolean exists(String db, String coll) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
exists
boolean exists(String db) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
createBulkContext
BulkRequestContext createBulkContext(Morphium m, String db, String collection, boolean ordered, WriteConcern wc)
-
getDriverStats
Map<MorphiumDriver.DriverStatsKey,Double> getDriverStats()
-
-