Package com.mongodb.operation
Class CreateIndexesOperation
- java.lang.Object
-
- com.mongodb.operation.CreateIndexesOperation
-
- All Implemented Interfaces:
AsyncWriteOperation<java.lang.Void>,WriteOperation<java.lang.Void>
@Deprecated public class CreateIndexesOperation extends java.lang.Object implements AsyncWriteOperation<java.lang.Void>, WriteOperation<java.lang.Void>
Deprecated.An operation that creates one or more indexes.Multiple index creation is supported starting with MongoDB server version 2.6
- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description CreateIndexesOperation(MongoNamespace namespace, java.util.List<IndexRequest> requests)Deprecated.CreateIndexesOperation(MongoNamespace namespace, java.util.List<IndexRequest> requests, WriteConcern writeConcern)Deprecated.Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Voidexecute(WriteBinding binding)Deprecated.General execute which can return anything of type TvoidexecuteAsync(AsyncWriteBinding binding, SingleResultCallback<java.lang.Void> callback)Deprecated.General execute which can return anything of type Tjava.util.List<java.lang.String>getIndexNames()Deprecated.Gets the index names.longgetMaxTime(java.util.concurrent.TimeUnit timeUnit)Deprecated.Gets the maximum execution time on the server for this operation.java.util.List<IndexRequest>getRequests()Deprecated.Gets the index requests.WriteConcerngetWriteConcern()Deprecated.Gets the write concern.CreateIndexesOperationmaxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)Deprecated.Sets the maximum execution time on the server for this operation.
-
-
-
Constructor Detail
-
CreateIndexesOperation
@Deprecated public CreateIndexesOperation(MongoNamespace namespace, java.util.List<IndexRequest> requests)
Deprecated.Construct a new instance.- Parameters:
namespace- the database and collection namespace for the operation.requests- the index request
-
CreateIndexesOperation
public CreateIndexesOperation(MongoNamespace namespace, java.util.List<IndexRequest> requests, WriteConcern writeConcern)
Deprecated.Construct a new instance.- Parameters:
namespace- the database and collection namespace for the operation.requests- the index requestwriteConcern- the write concern- Since:
- 3.4
-
-
Method Detail
-
getWriteConcern
public WriteConcern getWriteConcern()
Deprecated.Gets the write concern.- Returns:
- the write concern, which may be null
- Since:
- 3.4
-
getRequests
public java.util.List<IndexRequest> getRequests()
Deprecated.Gets the index requests.- Returns:
- the index requests
-
getIndexNames
public java.util.List<java.lang.String> getIndexNames()
Deprecated.Gets the index names.- Returns:
- a list of index names
-
getMaxTime
public long getMaxTime(java.util.concurrent.TimeUnit timeUnit)
Deprecated.Gets the maximum execution time on the server for this operation. The default is 0, which places no limit on the execution time.- Parameters:
timeUnit- the time unit to return the result in- Returns:
- the maximum execution time in the given time unit
- Since:
- 3.6
-
maxTime
public CreateIndexesOperation maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the maximum execution time on the server for this operation.- Parameters:
maxTime- the max timetimeUnit- the time unit, which may not be null- Returns:
- this
- Since:
- 3.6
-
execute
public java.lang.Void execute(WriteBinding binding)
Deprecated.Description copied from interface:WriteOperationGeneral execute which can return anything of type T- Specified by:
executein interfaceWriteOperation<java.lang.Void>- Parameters:
binding- the binding to execute in the context of- Returns:
- T, the result of the execution
-
executeAsync
public void executeAsync(AsyncWriteBinding binding, SingleResultCallback<java.lang.Void> callback)
Deprecated.Description copied from interface:AsyncWriteOperationGeneral execute which can return anything of type T- Specified by:
executeAsyncin interfaceAsyncWriteOperation<java.lang.Void>- Parameters:
binding- the binding to execute in the context ofcallback- the callback to be called when the operation has been executed
-
-