Package com.mongodb
Class MongoCursorNotFoundException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.mongodb.MongoException
com.mongodb.MongoServerException
com.mongodb.MongoQueryException
com.mongodb.MongoCursorNotFoundException
- All Implemented Interfaces:
Serializable
Subclass of
MongoException
representing a cursor-not-found exception.- Since:
- 2.12
-
Field Summary
Fields inherited from class com.mongodb.MongoException
TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL
-
Constructor Summary
ConstructorDescriptionMongoCursorNotFoundException
(long cursorId, ServerAddress serverAddress) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionlong
Get the cursor id that wasn't found.The server address where the cursor is.Methods inherited from class com.mongodb.MongoQueryException
getErrorCode, getErrorMessage
Methods inherited from class com.mongodb.MongoServerException
getErrorCodeName
Methods inherited from class com.mongodb.MongoException
addLabel, addLabels, addLabels, fromThrowable, fromThrowableNonNull, getCode, getErrorLabels, hasErrorLabel, removeLabel
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MongoCursorNotFoundException
Construct a new instance.- Parameters:
cursorId
- cursor identifierserverAddress
- server address
-
-
Method Details
-
getCursorId
public long getCursorId()Get the cursor id that wasn't found.- Returns:
- the ID of the cursor
-
getServerAddress
The server address where the cursor is.- Overrides:
getServerAddress
in classMongoServerException
- Returns:
- the ServerAddress representing the server the cursor was on.
-