Package de.caluga.morphium.driver.wire
Class DriverBase
- java.lang.Object
-
- de.caluga.morphium.driver.wire.DriverBase
-
- All Implemented Interfaces:
MorphiumDriver,Closeable,AutoCloseable
- Direct Known Subclasses:
PooledDriver,SingleMongoConnectDriver
public abstract class DriverBase extends Object implements MorphiumDriver
User: Stephan Bösebeck Date: 03.12.15 Time: 22:36Base for custom drivers
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.caluga.morphium.driver.MorphiumDriver
MorphiumDriver.DriverStatsKey
-
-
Constructor Summary
Constructors Constructor Description DriverBase()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.caluga.morphium.driver.MorphiumDriver
abortTransaction, commitTransaction, connect, connect, createAggregator, createBulkContext, exists, getCollStats, getDBStats, getDriverStats, getName, getNumConnectionsByHost, getPrimaryConnection, getReadConnection, getReplsetStatus, isConnected, releaseConnection
-
-
-
-
Method Detail
-
setConnectionUrl
public void setConnectionUrl(String connectionUrl) throws MalformedURLException
- Specified by:
setConnectionUrlin interfaceMorphiumDriver- Throws:
MalformedURLException
-
listCollections
public List<String> listCollections(String db, String regex) throws MorphiumDriverException
- Specified by:
listCollectionsin interfaceMorphiumDriver- Throws:
MorphiumDriverException
-
setHostSeed
public void setHostSeed(String... hosts)
- Specified by:
setHostSeedin interfaceMorphiumDriver
-
getRetriesOnNetworkError
public int getRetriesOnNetworkError()
- Specified by:
getRetriesOnNetworkErrorin interfaceMorphiumDriver
-
setRetriesOnNetworkError
public MorphiumDriver setRetriesOnNetworkError(int r)
- Specified by:
setRetriesOnNetworkErrorin interfaceMorphiumDriver
-
getSleepBetweenErrorRetries
public int getSleepBetweenErrorRetries()
- Specified by:
getSleepBetweenErrorRetriesin interfaceMorphiumDriver
-
setSleepBetweenErrorRetries
public MorphiumDriver setSleepBetweenErrorRetries(int s)
- Specified by:
setSleepBetweenErrorRetriesin interfaceMorphiumDriver
-
setCredentials
public void setCredentials(String db, String login, String pwd)
- Specified by:
setCredentialsin interfaceMorphiumDriver
-
getMaxConnections
public int getMaxConnections()
- Specified by:
getMaxConnectionsin interfaceMorphiumDriver
-
getAuthDb
public String getAuthDb()
-
setAuthDb
public DriverBase setAuthDb(String authDb)
-
getUser
public String getUser()
-
setUser
public DriverBase setUser(String user)
-
getPassword
public String getPassword()
-
setPassword
public DriverBase setPassword(String password)
-
setMaxConnections
public MorphiumDriver setMaxConnections(int maxConnections)
- Specified by:
setMaxConnectionsin interfaceMorphiumDriver
-
getMinConnections
public int getMinConnections()
- Specified by:
getMinConnectionsin interfaceMorphiumDriver
-
setMinConnections
public MorphiumDriver setMinConnections(int minConnections)
- Specified by:
setMinConnectionsin interfaceMorphiumDriver
-
isRetryReads
public boolean isRetryReads()
- Specified by:
isRetryReadsin interfaceMorphiumDriver
-
setRetryReads
public MorphiumDriver setRetryReads(boolean retryReads)
- Specified by:
setRetryReadsin interfaceMorphiumDriver
-
isRetryWrites
public boolean isRetryWrites()
- Specified by:
isRetryWritesin interfaceMorphiumDriver
-
setRetryWrites
public MorphiumDriver setRetryWrites(boolean retryWrites)
- Specified by:
setRetryWritesin interfaceMorphiumDriver
-
getUuidRepresentation
public String getUuidRepresentation()
-
setUuidRepresentation
public void setUuidRepresentation(String uuidRepresentation)
-
getReadTimeout
public int getReadTimeout()
- Specified by:
getReadTimeoutin interfaceMorphiumDriver
-
setReadTimeout
public void setReadTimeout(int readTimeout)
- Specified by:
setReadTimeoutin interfaceMorphiumDriver
-
getMinConnectionsPerHost
public int getMinConnectionsPerHost()
- Specified by:
getMinConnectionsPerHostin interfaceMorphiumDriver
-
setMinConnectionsPerHost
public void setMinConnectionsPerHost(int minConnectionsPerHost)
- Specified by:
setMinConnectionsPerHostin interfaceMorphiumDriver
-
getMaxConnectionsPerHost
public int getMaxConnectionsPerHost()
- Specified by:
getMaxConnectionsPerHostin interfaceMorphiumDriver
-
setMaxConnectionsPerHost
public void setMaxConnectionsPerHost(int maxConnectionsPerHost)
- Specified by:
setMaxConnectionsPerHostin interfaceMorphiumDriver
-
isReplicaset
public boolean isReplicaset()
- Specified by:
isReplicasetin interfaceMorphiumDriver
-
listDatabases
public List<String> listDatabases() throws MorphiumDriverException
- Specified by:
listDatabasesin interfaceMorphiumDriver- Throws:
MorphiumDriverException
-
exists
public boolean exists(String db, String collection) throws MorphiumDriverException
- Specified by:
existsin interfaceMorphiumDriver- Throws:
MorphiumDriverException
-
getHostSeed
public List<String> getHostSeed()
- Specified by:
getHostSeedin interfaceMorphiumDriver
-
getReplicaSetName
public String getReplicaSetName()
- Specified by:
getReplicaSetNamein interfaceMorphiumDriver
-
setReplicaSetName
public void setReplicaSetName(String replicaSetName)
- Specified by:
setReplicaSetNamein interfaceMorphiumDriver
-
getMaxBsonObjectSize
public int getMaxBsonObjectSize()
- Specified by:
getMaxBsonObjectSizein interfaceMorphiumDriver
-
setMaxBsonObjectSize
public void setMaxBsonObjectSize(int maxBsonObjectSize)
- Specified by:
setMaxBsonObjectSizein interfaceMorphiumDriver
-
getMaxMessageSize
public int getMaxMessageSize()
- Specified by:
getMaxMessageSizein interfaceMorphiumDriver
-
setMaxMessageSize
public void setMaxMessageSize(int maxMessageSize)
- Specified by:
setMaxMessageSizein interfaceMorphiumDriver
-
getMaxWriteBatchSize
public int getMaxWriteBatchSize()
- Specified by:
getMaxWriteBatchSizein interfaceMorphiumDriver
-
setMaxWriteBatchSize
public void setMaxWriteBatchSize(int maxWriteBatchSize)
- Specified by:
setMaxWriteBatchSizein interfaceMorphiumDriver
-
isReplicaSet
public boolean isReplicaSet()
- Specified by:
isReplicaSetin interfaceMorphiumDriver
-
setReplicaSet
public void setReplicaSet(boolean replicaSet)
- Specified by:
setReplicaSetin interfaceMorphiumDriver
-
getNextId
public int getNextId()
-
getDefaultJ
public boolean getDefaultJ()
- Specified by:
getDefaultJin interfaceMorphiumDriver
-
getDefaultWriteTimeout
public int getDefaultWriteTimeout()
- Specified by:
getDefaultWriteTimeoutin interfaceMorphiumDriver
-
setDefaultWriteTimeout
public void setDefaultWriteTimeout(int wt)
- Specified by:
setDefaultWriteTimeoutin interfaceMorphiumDriver
-
getMaxWaitTime
public int getMaxWaitTime()
- Specified by:
getMaxWaitTimein interfaceMorphiumDriver
-
setMaxWaitTime
public void setMaxWaitTime(int maxWaitTime)
- Specified by:
setMaxWaitTimein interfaceMorphiumDriver
-
getCredentials
public String[] getCredentials(String db)
- Specified by:
getCredentialsin interfaceMorphiumDriver
-
setHostSeed
public void setHostSeed(List<String> hosts)
- Specified by:
setHostSeedin interfaceMorphiumDriver
-
getMaxConnectionLifetime
public int getMaxConnectionLifetime()
- Specified by:
getMaxConnectionLifetimein interfaceMorphiumDriver
-
setMaxConnectionLifetime
public void setMaxConnectionLifetime(int timeout)
- Specified by:
setMaxConnectionLifetimein interfaceMorphiumDriver
-
getMaxConnectionIdleTime
public int getMaxConnectionIdleTime()
- Specified by:
getMaxConnectionIdleTimein interfaceMorphiumDriver
-
setMaxConnectionIdleTime
public void setMaxConnectionIdleTime(int time)
- Specified by:
setMaxConnectionIdleTimein interfaceMorphiumDriver
-
getConnectionTimeout
public int getConnectionTimeout()
- Specified by:
getConnectionTimeoutin interfaceMorphiumDriver
-
setConnectionTimeout
public void setConnectionTimeout(int timeout)
- Specified by:
setConnectionTimeoutin interfaceMorphiumDriver
-
getDefaultW
public int getDefaultW()
- Specified by:
getDefaultWin interfaceMorphiumDriver
-
setDefaultW
public void setDefaultW(int w)
- Specified by:
setDefaultWin interfaceMorphiumDriver
-
getHeartbeatFrequency
public int getHeartbeatFrequency()
- Specified by:
getHeartbeatFrequencyin interfaceMorphiumDriver
-
setHeartbeatFrequency
public void setHeartbeatFrequency(int heartbeatFrequency)
- Specified by:
setHeartbeatFrequencyin interfaceMorphiumDriver
-
getMaximums
public Maximums getMaximums()
-
getDefaultReadPreference
public ReadPreference getDefaultReadPreference()
- Specified by:
getDefaultReadPreferencein interfaceMorphiumDriver
-
setDefaultReadPreference
public void setDefaultReadPreference(ReadPreference rp)
- Specified by:
setDefaultReadPreferencein interfaceMorphiumDriver
-
getDefaultBatchSize
public int getDefaultBatchSize()
- Specified by:
getDefaultBatchSizein interfaceMorphiumDriver
-
setDefaultBatchSize
public void setDefaultBatchSize(int defaultBatchSize)
- Specified by:
setDefaultBatchSizein interfaceMorphiumDriver
-
isUseSSL
public boolean isUseSSL()
- Specified by:
isUseSSLin interfaceMorphiumDriver
-
setUseSSL
public void setUseSSL(boolean useSSL)
- Specified by:
setUseSSLin interfaceMorphiumDriver
-
isDefaultJ
public boolean isDefaultJ()
- Specified by:
isDefaultJin interfaceMorphiumDriver
-
setDefaultJ
public void setDefaultJ(boolean j)
- Specified by:
setDefaultJin interfaceMorphiumDriver
-
getLocalThreshold
public int getLocalThreshold()
-
setLocalThreshold
public void setLocalThreshold(int thr)
-
heartBeatFrequency
public void heartBeatFrequency(int t)
-
useSsl
public void useSsl(boolean ssl)
-
startTransaction
public MorphiumTransactionContext startTransaction(boolean autoCommit)
- Specified by:
startTransactionin interfaceMorphiumDriver
-
getTransactionContext
public MorphiumTransactionContext getTransactionContext()
- Specified by:
getTransactionContextin interfaceMorphiumDriver
-
setTransactionContext
public void setTransactionContext(MorphiumTransactionContext ctx)
- Specified by:
setTransactionContextin interfaceMorphiumDriver
-
isTransactionInProgress
public boolean isTransactionInProgress()
- Specified by:
isTransactionInProgressin interfaceMorphiumDriver
-
clearTransactionContext
protected void clearTransactionContext()
-
watch
public abstract void watch(WatchCommand settings) throws MorphiumDriverException
- Specified by:
watchin interfaceMorphiumDriver- Throws:
MorphiumDriverException
-
isCapped
public abstract boolean isCapped(String db, String coll) throws MorphiumDriverException
- Specified by:
isCappedin interfaceMorphiumDriver- Throws:
MorphiumDriverException
-
-