Package com.mongodb
Class MongoUpdatedEncryptedFieldsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.mongodb.MongoException
com.mongodb.MongoClientException
com.mongodb.MongoUpdatedEncryptedFieldsException
- All Implemented Interfaces:
Serializable
An exception thrown by methods that may automatically create data encryption keys
where needed based on the
encryptedFields configuration.- Since:
- 4.9
- See Also:
-
Field Summary
Fields inherited from class com.mongodb.MongoException
TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL -
Constructor Summary
ConstructorsConstructorDescriptionMongoUpdatedEncryptedFieldsException(org.bson.BsonDocument encryptedFields, String msg, Throwable cause) Not part of the public API. -
Method Summary
Modifier and TypeMethodDescriptionorg.bson.BsonDocumentTheencryptedFieldsdocument that allows inferring which data keys are known to be created beforethisexception happened by comparing this document with the originalencryptedFieldsconfiguration.Methods inherited from class com.mongodb.MongoException
addLabel, addLabels, addLabels, fromThrowable, fromThrowableNonNull, getCode, getErrorLabels, hasErrorLabel, removeLabelMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MongoUpdatedEncryptedFieldsException
public MongoUpdatedEncryptedFieldsException(org.bson.BsonDocument encryptedFields, String msg, Throwable cause) Not part of the public API.- Parameters:
encryptedFields- The (partially) updatedencryptedFieldsdocument, which allows users to infer which data keys are known to be created before the exception happened (seegetEncryptedFields()for more details). Reporting this back to a user may be helpful because creation of a data key includes persisting it in the key vault.msg- The message.cause- The cause.
-
-
Method Details
-
getEncryptedFields
public org.bson.BsonDocument getEncryptedFields()TheencryptedFieldsdocument that allows inferring which data keys are known to be created beforethisexception happened by comparing this document with the originalencryptedFieldsconfiguration. Creation of a data key includes persisting it in the key vault.Note that the returned
encryptedFieldsdocument is not guaranteed to contain information about all the data keys that may be created, only about those that the driver is certain about. For example, if persisting a data key times out, the driver does not know whether it can be considered created or not, and does not include the information about the key in theencryptedFieldsdocument. You can analyze whether the cause is a definite or indefinite error, and rely on the returnedencryptedFieldsto be containing information on all created keys only if the error is definite.- Returns:
- The updated
encryptedFieldsdocument.
-