Package de.caluga.morphium.driver.wire
Class SingleMongoConnectDriver
- java.lang.Object
-
- de.caluga.morphium.driver.wire.DriverBase
-
- de.caluga.morphium.driver.wire.SingleMongoConnectDriver
-
- All Implemented Interfaces:
MorphiumDriver,Closeable,AutoCloseable
public class SingleMongoConnectDriver extends DriverBase
User: Stephan Bösebeck Date: 02.12.15 Time: 23:47connects to one node only!
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.caluga.morphium.driver.MorphiumDriver
MorphiumDriver.DriverStatsKey
-
-
Field Summary
Fields Modifier and Type Field Description static StringdriverName
-
Constructor Summary
Constructors Constructor Description SingleMongoConnectDriver()
-
Method Summary
-
Methods inherited from class de.caluga.morphium.driver.wire.DriverBase
clearTransactionContext, exists, getAuthDb, getConnectionTimeout, getCredentials, getDefaultBatchSize, getDefaultJ, getDefaultReadPreference, getDefaultW, getDefaultWriteTimeout, getHeartbeatFrequency, getHostSeed, getLocalThreshold, getMaxBsonObjectSize, getMaxConnectionIdleTime, getMaxConnectionLifetime, getMaxConnections, getMaxConnectionsPerHost, getMaximums, getMaxMessageSize, getMaxWaitTime, getMaxWriteBatchSize, getMinConnections, getMinConnectionsPerHost, getNextId, getPassword, getReadTimeout, getReplicaSetName, getRetriesOnNetworkError, getSleepBetweenErrorRetries, getTransactionContext, getUser, getUuidRepresentation, heartBeatFrequency, isDefaultJ, isReplicaset, isReplicaSet, isRetryReads, isRetryWrites, isTransactionInProgress, isUseSSL, listCollections, listDatabases, setAuthDb, setConnectionTimeout, setCredentials, setDefaultBatchSize, setDefaultJ, setDefaultReadPreference, setDefaultW, setDefaultWriteTimeout, setHeartbeatFrequency, setHostSeed, setHostSeed, setLocalThreshold, setMaxBsonObjectSize, setMaxConnectionIdleTime, setMaxConnectionLifetime, setMaxConnections, setMaxConnectionsPerHost, setMaxMessageSize, setMaxWaitTime, setMaxWriteBatchSize, setMinConnections, setMinConnectionsPerHost, setPassword, setReadTimeout, setReplicaSet, setReplicaSetName, setRetriesOnNetworkError, setRetryReads, setRetryWrites, setSleepBetweenErrorRetries, setTransactionContext, setUser, setUseSSL, setUuidRepresentation, startTransaction, useSsl
-
-
-
-
Field Detail
-
driverName
public static final String driverName
- See Also:
- Constant Field Values
-
-
Method Detail
-
createAggregator
public <T,R> Aggregator<T,R> createAggregator(Morphium morphium, Class<? extends T> type, Class<? extends R> resultType)
-
getDriverStats
public Map<MorphiumDriver.DriverStatsKey,Double> getDriverStats()
-
getConnection
public MongoConnection getConnection()
-
getConnectionType
public ConnectionType getConnectionType()
-
setConnectionType
public SingleMongoConnectDriver setConnectionType(ConnectionType connectionType)
-
connect
public void connect() throws MorphiumDriverException- Throws:
MorphiumDriverException
-
connect
public void connect(String replSet) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
startHeartbeat
protected void startHeartbeat()
-
watch
public void watch(WatchCommand settings) throws MorphiumDriverException
- Specified by:
watchin interfaceMorphiumDriver- Specified by:
watchin classDriverBase- Throws:
MorphiumDriverException
-
releaseConnection
public void releaseConnection(MongoConnection con)
-
getReadConnection
public MongoConnection getReadConnection(ReadPreference rp)
-
getPrimaryConnection
public MongoConnection getPrimaryConnection(WriteConcern wc)
-
close
public void close()
-
getName
public String getName()
-
setConnectionUrl
public void setConnectionUrl(String connectionUrl)
- Specified by:
setConnectionUrlin interfaceMorphiumDriver- Overrides:
setConnectionUrlin classDriverBase
-
isConnected
public boolean isConnected()
-
commitTransaction
public void commitTransaction() throws MorphiumDriverException- Throws:
MorphiumDriverException
-
abortTransaction
public void abortTransaction() throws MorphiumDriverException- Throws:
MorphiumDriverException
-
getCollStats
public Map<String,Object> getCollStats(String db, String coll) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getReplsetStatus
public Map<String,Object> getReplsetStatus() throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getDBStats
public Map<String,Object> getDBStats(String db) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
currentOp
public List<Map<String,Object>> currentOp(int threshold) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
createBulkContext
public BulkRequestContext createBulkContext(Morphium m, String db, String collection, boolean ordered, WriteConcern wc)
-
closeIteration
public void closeIteration(MorphiumCursor crs) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
killCursors
protected void killCursors(String db, String coll, long... ids) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
exists
public boolean exists(String db) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getDbStats
public Map<String,Object> getDbStats(String db) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getDbStats
public Map<String,Object> getDbStats(String db, boolean withStorage) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
isCapped
public boolean isCapped(String db, String coll) throws MorphiumDriverException
- Specified by:
isCappedin interfaceMorphiumDriver- Specified by:
isCappedin classDriverBase- Throws:
MorphiumDriverException
-
-