Package de.caluga.morphium.driver.wire
Class SingleMongoConnection
- java.lang.Object
-
- de.caluga.morphium.driver.wire.SingleMongoConnection
-
- All Implemented Interfaces:
MongoConnection,Closeable,AutoCloseable
public class SingleMongoConnection extends Object implements MongoConnection
-
-
Constructor Summary
Constructors Constructor Description SingleMongoConnection()
-
Method Summary
-
-
-
Method Detail
-
setCredentials
public void setCredentials(String authDb, String userName, String password)
- Specified by:
setCredentialsin interfaceMongoConnection
-
connect
public HelloResult connect(MorphiumDriver drv, String host, int port) throws MorphiumDriverException
- Specified by:
connectin interfaceMongoConnection- Throws:
MorphiumDriverException
-
getDriver
public MorphiumDriver getDriver()
- Specified by:
getDriverin interfaceMongoConnection
-
setDriver
public SingleMongoConnection setDriver(MorphiumDriver d)
-
getStats
public Map<MorphiumDriver.DriverStatsKey,Double> getStats()
-
getConnectedTo
public String getConnectedTo()
- Specified by:
getConnectedToin interfaceMongoConnection
-
getConnectedToHost
public String getConnectedToHost()
- Specified by:
getConnectedToHostin interfaceMongoConnection
-
getConnectedToPort
public int getConnectedToPort()
- Specified by:
getConnectedToPortin interfaceMongoConnection
-
closeIteration
public void closeIteration(MorphiumCursor crs) throws MorphiumDriverException
- Specified by:
closeIterationin interfaceMongoConnection- Throws:
MorphiumDriverException
-
killCursors
public Map<String,Object> killCursors(String db, String coll, long... ids) throws MorphiumDriverException
- Specified by:
killCursorsin interfaceMongoConnection- Throws:
MorphiumDriverException
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceMongoConnection
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceMongoConnection
-
release
public void release()
- Specified by:
releasein interfaceMongoConnection
-
replyAvailableFor
public boolean replyAvailableFor(int msgId)
- Specified by:
replyAvailableForin interfaceMongoConnection
-
getReplyFor
public OpMsg getReplyFor(int msgid, long timeout) throws MorphiumDriverException
- Specified by:
getReplyForin interfaceMongoConnection- Throws:
MorphiumDriverException
-
sendQuery
public void sendQuery(OpMsg q) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
sendAndWaitForReply
public OpMsg sendAndWaitForReply(OpMsg q) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
readSingleAnswer
public Map<String,Object> readSingleAnswer(int id) throws MorphiumDriverException
- Specified by:
readSingleAnswerin interfaceMongoConnection- Throws:
MorphiumDriverException
-
sendCommand
public int sendCommand(MongoCommand cmd) throws MorphiumDriverException
- Specified by:
sendCommandin interfaceMongoConnection- Throws:
MorphiumDriverException
-
getSourcePort
public int getSourcePort()
- Specified by:
getSourcePortin interfaceMongoConnection
-
watch
public void watch(WatchCommand command) throws MorphiumDriverException
- Specified by:
watchin interfaceMongoConnection- Throws:
MorphiumDriverException
-
readAnswerFor
public List<Map<String,Object>> readAnswerFor(int queryId) throws MorphiumDriverException
- Specified by:
readAnswerForin interfaceMongoConnection- Throws:
MorphiumDriverException
-
getAnswerFor
public MorphiumCursor getAnswerFor(int queryId, int batchSize) throws MorphiumDriverException
- Specified by:
getAnswerForin interfaceMongoConnection- Throws:
MorphiumDriverException
-
readAnswerFor
public List<Map<String,Object>> readAnswerFor(MorphiumCursor crs) throws MorphiumDriverException
- Specified by:
readAnswerForin interfaceMongoConnection- Throws:
MorphiumDriverException
-
-