public class CreateIndexesOperation extends Object implements AsyncWriteOperation<Void>, WriteOperation<Void>
Multiple index creation is supported starting with MongoDB server version 2.6
| Constructor and Description | 
|---|
| CreateIndexesOperation(MongoNamespace namespace,
                      List<IndexRequest> requests)Deprecated. 
 | 
| CreateIndexesOperation(MongoNamespace namespace,
                      List<IndexRequest> requests,
                      WriteConcern writeConcern)Construct a new instance. | 
| Modifier and Type | Method and 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. | 
| List<IndexRequest> | getRequests()Gets the index requests. | 
| WriteConcern | getWriteConcern()Gets the write concern. | 
@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 Void execute(WriteBinding binding)
WriteOperationexecute in interface WriteOperation<Void>binding - the binding to execute in the context ofpublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<Void> callback)
AsyncWriteOperationexecuteAsync in interface AsyncWriteOperation<Void>binding - the binding to execute in the context ofcallback - the callback to be called when the operation has been executed