Class DeleteOperation
- java.lang.Object
-
- net.sf.ehcache.writer.writebehind.operations.DeleteOperation
-
- All Implemented Interfaces:
KeyBasedOperation,SingleOperation
public class DeleteOperation extends java.lang.Object implements SingleOperation
Implements the delete operation for write behind- Version:
- $Id$
- Author:
- Geert Bevin
-
-
Constructor Summary
Constructors Constructor Description DeleteOperation(CacheEntry entry)Create a new delete operation for a particular entryDeleteOperation(CacheEntry entry, long creationTime)Create a new delete operation for a particular entry and creation time
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BatchOperationcreateBatchOperation(java.util.List<? extends SingleOperation> operations)Creates a batch operation that corresponds to the operation type of this single operation.booleanequals(java.lang.Object other)longgetCreationTime()Retrieves the moment when the operation was created.CacheEntrygetEntry()Retrieves the entry that will be used for this operationjava.lang.ObjectgetKey()Retrieves the element key for this operation.SingleOperationTypegetType()Returns a stable identifier for the type this operation can be classified in.inthashCode()voidperformSingleOperation(CacheWriter cacheWriter)Perform this operation as a single execution with the provided cache writervoidthrowAway(CacheWriter cacheWriter, java.lang.RuntimeException e)Called when all retries have failed
-
-
-
Constructor Detail
-
DeleteOperation
public DeleteOperation(CacheEntry entry)
Create a new delete operation for a particular entry- Parameters:
entry- the entry to delete
-
DeleteOperation
public DeleteOperation(CacheEntry entry, long creationTime)
Create a new delete operation for a particular entry and creation time- Parameters:
entry- the entry to deletecreationTime- the creation time of the operation
-
-
Method Detail
-
performSingleOperation
public void performSingleOperation(CacheWriter cacheWriter)
Perform this operation as a single execution with the provided cache writer- Specified by:
performSingleOperationin interfaceSingleOperation- Parameters:
cacheWriter- the cache writer this operation should be performed upon
-
createBatchOperation
public BatchOperation createBatchOperation(java.util.List<? extends SingleOperation> operations)
Creates a batch operation that corresponds to the operation type of this single operation.This batch operation will not be stored in the queue anymore and is solely used for structuring. The data from the single operation will already be processed in the final form that will be expected by the
CacheWriterthat will be used to execute the batch operation.- Specified by:
createBatchOperationin interfaceSingleOperation- Parameters:
operations- the single operations that need to be regrouped in the batch operation- Returns:
- the created batch operation
-
getKey
public java.lang.Object getKey()
Retrieves the element key for this operation.- Specified by:
getKeyin interfaceKeyBasedOperation- Returns:
- the key of the element that is concerned by the operation.
-
getCreationTime
public long getCreationTime()
Retrieves the moment when the operation was created.- Specified by:
getCreationTimein interfaceKeyBasedOperation- Returns:
- the creation time in milliseconds
-
getEntry
public CacheEntry getEntry()
Retrieves the entry that will be used for this operation
-
getType
public SingleOperationType getType()
Returns a stable identifier for the type this operation can be classified in. This is used to group and order batched operations.- Specified by:
getTypein interfaceSingleOperation- Returns:
- the identifier for this operation type
-
throwAway
public void throwAway(CacheWriter cacheWriter, java.lang.RuntimeException e)
Called when all retries have failed- Specified by:
throwAwayin interfaceSingleOperation- Parameters:
cacheWriter- the CacheWriter to delegate toe- the last exception encountered
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
-