Interface OperationFactory
- 
public interface OperationFactoryA factory to create operations that can be batched for execution byKVStore.execute.Each operation created here operates on a single key and matches the corresponding operation defined in KVStore. For example, the Operation generated by the
createPutmethod corresponds to theputmethod. The argument pattern for creating the operation is similar. It differs in the following respects:- 
 The durability argument is not passed, since that argument applies to the
 execution of the entire batch of operations and is passed in to the 
executemethod. - 
 
ReturnValueVersion.Choiceis passed instead ofReturnValueVersion. - 
 An additional argument, 
abortIfUnsuccessfulis passed. 
The return values associated with operations similarly match the descriptions for the corresponding methods described in in
KVStore. They are, however, retrieved differently: the status, return value, previous value and version are packaged together inOperationResult. - 
 The durability argument is not passed, since that argument applies to the
 execution of the entire batch of operations and is passed in to the 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OperationcreateDelete(Key key)Create a Delete operation suitable for use as an argument to theexecutemethod.OperationcreateDelete(Key key, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)Create a Delete operation suitable for use as an argument to theexecutemethod.OperationcreateDeleteIfVersion(Key key, Version version)Create a Delete operation suitable for use as an argument to theexecutemethod.OperationcreateDeleteIfVersion(Key key, Version version, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)Create a Delete operation suitable for use as an argument to theexecutemethod.OperationcreatePut(Key key, Value value)Create a Put operation suitable for use as an argument to theexecutemethod.OperationcreatePut(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)Create a Put operation suitable for use as an argument to theexecutemethod.OperationcreatePutIfAbsent(Key key, Value value)Create a Put operation suitable for use as an argument to theexecutemethod.OperationcreatePutIfAbsent(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)Create a Put operation suitable for use as an argument to theexecutemethod.OperationcreatePutIfPresent(Key key, Value value)Create a Put operation suitable for use as an argument to theexecutemethod.OperationcreatePutIfPresent(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)Create a Put operation suitable for use as an argument to theexecutemethod.OperationcreatePutIfVersion(Key key, Value value, Version version)Create a Put operation suitable for use as an argument to theexecutemethod.OperationcreatePutIfVersion(Key key, Value value, Version version, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)Create a Put operation suitable for use as an argument to theexecutemethod. 
 - 
 
- 
- 
Method Detail
- 
createPut
Operation createPut(Key key, Value value)
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputmethod.The previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult. 
- 
createPut
Operation createPut(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult. 
- 
createPutIfAbsent
Operation createPutIfAbsent(Key key, Value value)
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputIfAbsentmethod.The previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Returns:
 - the created Put operation
 - See Also:
 putIfAbsent,execute
 
- 
createPutIfAbsent
Operation createPutIfAbsent(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputIfAbsentmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Parameters:
 abortIfUnsuccessful- is true if this operation should cause theexecutetransaction to abort when the operation fails, where failure is the condition when theputIfAbsentmethod returns null.- Returns:
 - the created Put operation
 - See Also:
 putIfAbsent,execute
 
- 
createPutIfPresent
Operation createPutIfPresent(Key key, Value value)
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputIfPresentmethod.The previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Returns:
 - the created Put operation
 - See Also:
 putIfPresent,execute
 
- 
createPutIfPresent
Operation createPutIfPresent(Key key, Value value, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputIfPresentmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Parameters:
 abortIfUnsuccessful- is true if this operation should cause theexecutetransaction to abort when the operation fails, where failure is the condition when theputIfPresentmethod returns null.- Returns:
 - the created Put operation
 - See Also:
 putIfPresent,execute
 
- 
createPutIfVersion
Operation createPutIfVersion(Key key, Value value, Version version)
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputIfVersionmethod.The previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Returns:
 - the created Put operation
 - See Also:
 putIfVersion,execute
 
- 
createPutIfVersion
Operation createPutIfVersion(Key key, Value value, Version version, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Put operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation are identical to that of theputIfVersionmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Parameters:
 abortIfUnsuccessful- is true if this operation should cause theexecutetransaction to abort when the operation fails, where failure is the condition when theputIfVersionmethod returns null.- Returns:
 - the created Put operation
 - See Also:
 putIfVersion,execute
 
- 
createDelete
Operation createDelete(Key key)
Create a Delete operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation when executed are identical to that of thedeletemethod.The previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult. 
- 
createDelete
Operation createDelete(Key key, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Delete operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation when executed are identical to that of thedeletemethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult. 
- 
createDeleteIfVersion
Operation createDeleteIfVersion(Key key, Version version)
Create a Delete operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation when executed are identical to that of thedeleteIfVersionmethod.The previous value is not returned by this method and the
abortIfUnsuccessfulproperty is false.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Returns:
 - the created Delete operation
 - See Also:
 deleteIfVersion,execute
 
- 
createDeleteIfVersion
Operation createDeleteIfVersion(Key key, Version version, ReturnValueVersion.Choice prevReturn, boolean abortIfUnsuccessful)
Create a Delete operation suitable for use as an argument to theexecutemethod. The semantics of the returned operation when executed are identical to that of thedeleteIfVersionmethod.The result of evaluating the operation, or the resulting exception, after the call to
executeis available as anOperationResult.- Parameters:
 abortIfUnsuccessful- is true if this operation should cause theexecutetransaction to abort when the operation fails, where failure is the condition when thedeleteIfVersionmethod returns false.- Returns:
 - the created Delete operation
 - See Also:
 deleteIfVersion,execute
 
 - 
 
 -