Package de.caluga.morphium.driver.wire
Interface MongoConnection
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
InMemoryDriver,SingleMongoConnection
public interface MongoConnection extends Closeable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()voidcloseIteration(MorphiumCursor crs)HelloResultconnect(MorphiumDriver drv, String host, int port)MorphiumCursorgetAnswerFor(int queryId, int batchsize)StringgetConnectedTo()StringgetConnectedToHost()intgetConnectedToPort()MorphiumDrivergetDriver()OpMsggetReplyFor(int msgid, long timeout)intgetSourcePort()booleanisConnected()Map<String,Object>killCursors(String db, String coll, long... ids)List<Map<String,Object>>readAnswerFor(int queryId)List<Map<String,Object>>readAnswerFor(MorphiumCursor crs)Map<String,Object>readSingleAnswer(int id)voidrelease()booleanreplyAvailableFor(int msgId)intsendCommand(MongoCommand cmd)voidsetCredentials(String authDb, String userName, String password)voidwatch(WatchCommand settings)
-
-
-
Method Detail
-
connect
HelloResult connect(MorphiumDriver drv, String host, int port) throws IOException, MorphiumDriverException
- Throws:
IOExceptionMorphiumDriverException
-
getDriver
MorphiumDriver getDriver()
-
getSourcePort
int getSourcePort()
-
close
void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
release
void release()
-
isConnected
boolean isConnected()
-
getConnectedTo
String getConnectedTo()
-
getConnectedToHost
String getConnectedToHost()
-
getConnectedToPort
int getConnectedToPort()
-
closeIteration
void closeIteration(MorphiumCursor crs) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
killCursors
Map<String,Object> killCursors(String db, String coll, long... ids) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
replyAvailableFor
boolean replyAvailableFor(int msgId)
-
getReplyFor
OpMsg getReplyFor(int msgid, long timeout) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
readSingleAnswer
Map<String,Object> readSingleAnswer(int id) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
watch
void watch(WatchCommand settings) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
readAnswerFor
List<Map<String,Object>> readAnswerFor(int queryId) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
getAnswerFor
MorphiumCursor getAnswerFor(int queryId, int batchsize) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
readAnswerFor
List<Map<String,Object>> readAnswerFor(MorphiumCursor crs) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
sendCommand
int sendCommand(MongoCommand cmd) throws MorphiumDriverException
- Throws:
MorphiumDriverException
-
-