AsyncWriteOperation<Void>
, WriteOperation<Void>
public class CreateIndexesOperation extends Object implements AsyncWriteOperation<Void>, WriteOperation<Void>
Multiple index creation is supported starting with MongoDB server version 2.6
Constructor | Description |
---|---|
CreateIndexesOperationโ(MongoNamespace namespace,
List<IndexRequest> requests) |
Deprecated.
|
CreateIndexesOperationโ(MongoNamespace namespace,
List<IndexRequest> requests,
WriteConcern writeConcern) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
Void |
executeโ(WriteBinding binding) |
General execute which can return anything of type T
|
void |
executeAsyncโ(AsyncWriteBinding binding,
SingleResultCallback<Void> callback) |
General execute which can return anything of type T
|
List<String> |
getIndexNamesโ() |
Gets the index names.
|
long |
getMaxTimeโ(TimeUnit timeUnit) |
Gets the maximum execution time on the server for this operation.
|
List<IndexRequest> |
getRequestsโ() |
Gets the index requests.
|
WriteConcern |
getWriteConcernโ() |
Gets the write concern.
|
CreateIndexesOperation |
maxTimeโ(long maxTime,
TimeUnit timeUnit) |
Sets the maximum execution time on the server for this operation.
|
@Deprecated public CreateIndexesOperationโ(MongoNamespace namespace, List<IndexRequest> requests)
CreateIndexesOperation(MongoNamespace, List, WriteConcern)
namespace
- the database and collection namespace for the operation.requests
- the index requestpublic CreateIndexesOperationโ(MongoNamespace namespace, List<IndexRequest> requests, WriteConcern writeConcern)
namespace
- the database and collection namespace for the operation.requests
- the index requestwriteConcern
- the write concernpublic WriteConcern getWriteConcernโ()
public List<IndexRequest> getRequestsโ()
public List<String> getIndexNamesโ()
public long getMaxTimeโ(TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic CreateIndexesOperation maxTimeโ(long maxTime, TimeUnit timeUnit)
maxTime
- the max timetimeUnit
- the time unit, which may not be nullpublic Void executeโ(WriteBinding binding)
WriteOperation
execute
in interface WriteOperation<Void>
binding
- the binding to execute in the context ofpublic void executeAsyncโ(AsyncWriteBinding binding, SingleResultCallback<Void> callback)
AsyncWriteOperation
executeAsync
in interface AsyncWriteOperation<Void>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed