Package com.mongodb
Class MongoSecurityException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.mongodb.MongoException
-
- com.mongodb.MongoClientException
-
- com.mongodb.MongoSecurityException
-
- All Implemented Interfaces:
Serializable
public class MongoSecurityException extends MongoClientException
This exception is thrown when there is an error reported by the underlying client authentication mechanism.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.mongodb.MongoException
TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL
-
-
Constructor Summary
Constructors Constructor Description MongoSecurityException(MongoCredential credential, String message)
Construct an instanceMongoSecurityException(MongoCredential credential, String message, Throwable cause)
Construct an instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MongoCredential
getCredential()
The credential being authenticated.-
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 Detail
-
MongoSecurityException
public MongoSecurityException(MongoCredential credential, String message, Throwable cause)
Construct an instance- Parameters:
credential
- the credentialmessage
- the messagecause
- the cause
-
MongoSecurityException
public MongoSecurityException(MongoCredential credential, String message)
Construct an instance- Parameters:
credential
- the credentialmessage
- the message
-
-
Method Detail
-
getCredential
public MongoCredential getCredential()
The credential being authenticated.- Returns:
- the credential
-
-