public class CreateUserOperation extends java.lang.Object implements AsyncWriteOperation<java.lang.Void>, WriteOperation<java.lang.Void>
Modifier and Type | Field and Description |
---|---|
private MongoCredential |
credential |
private boolean |
readOnly |
private WriteConcern |
writeConcern |
Constructor and Description |
---|
CreateUserOperation(MongoCredential credential,
boolean readOnly)
Deprecated.
|
CreateUserOperation(MongoCredential credential,
boolean readOnly,
WriteConcern writeConcern)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Void |
execute(WriteBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncWriteBinding binding,
SingleResultCallback<java.lang.Void> callback)
General execute which can return anything of type T
|
private BsonDocument |
getCommand(ConnectionDescription description) |
MongoCredential |
getCredential()
Gets the users credentials.
|
boolean |
isReadOnly()
Returns true if the user is a readOnly user.
|
private final MongoCredential credential
private final boolean readOnly
private final WriteConcern writeConcern
@Deprecated public CreateUserOperation(MongoCredential credential, boolean readOnly)
CreateUserOperation(MongoCredential, boolean, WriteConcern)
credential
- the users credentials.readOnly
- true if the user is a readOnly user.public CreateUserOperation(MongoCredential credential, boolean readOnly, WriteConcern writeConcern)
credential
- the users credentials.readOnly
- true if the user is a readOnly user.writeConcern
- the write concernpublic MongoCredential getCredential()
public boolean isReadOnly()
public java.lang.Void execute(WriteBinding binding)
WriteOperation
execute
in interface WriteOperation<java.lang.Void>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<java.lang.Void> callback)
AsyncWriteOperation
executeAsync
in interface AsyncWriteOperation<java.lang.Void>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executedprivate BsonDocument getCommand(ConnectionDescription description)