public class UserExistsOperation extends java.lang.Object implements AsyncReadOperation<java.lang.Boolean>, ReadOperation<java.lang.Boolean>
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
databaseName |
private java.lang.String |
userName |
| Constructor and Description |
|---|
UserExistsOperation(java.lang.String databaseName,
java.lang.String userName)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Boolean |
execute(ReadBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncReadBinding binding,
SingleResultCallback<java.lang.Boolean> callback)
General execute which can return anything of type T
|
private BsonDocument |
getCommand() |
private CommandOperationHelper.CommandTransformer<BsonDocument,java.lang.Boolean> |
transformer() |
private CommandOperationHelper.CommandTransformer<QueryResult<BsonDocument>,java.lang.Boolean> |
transformQueryResult() |
private final java.lang.String databaseName
private final java.lang.String userName
public UserExistsOperation(java.lang.String databaseName,
java.lang.String userName)
databaseName - the name of the database for the operation.userName - the name of the user to check if they exist.public java.lang.Boolean execute(ReadBinding binding)
ReadOperationexecute in interface ReadOperation<java.lang.Boolean>binding - the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<java.lang.Boolean> callback)
AsyncReadOperationexecuteAsync in interface AsyncReadOperation<java.lang.Boolean>binding - the binding to execute in the context ofcallback - the callback to be called when the operation has been executedprivate CommandOperationHelper.CommandTransformer<BsonDocument,java.lang.Boolean> transformer()
private CommandOperationHelper.CommandTransformer<QueryResult<BsonDocument>,java.lang.Boolean> transformQueryResult()
private BsonDocument getCommand()