org.ehcache.impl.internal.loaderwriter.writebehind.operations
Class DeleteOperation<K,V>

java.lang.Object
  extended by org.ehcache.impl.internal.loaderwriter.writebehind.operations.DeleteOperation<K,V>
All Implemented Interfaces:
KeyBasedOperation<K>, SingleOperation<K,V>

public class DeleteOperation<K,V>
extends java.lang.Object
implements SingleOperation<K,V>

Implements the delete operation for write behind


Constructor Summary
DeleteOperation(K key)
          Create a new delete operation for a particular entry
DeleteOperation(K key, long creationTime)
          Create a new delete operation for a particular entry and creation time
 
Method Summary
 BatchOperation<K,V> createBatchOperation(java.util.List<? extends SingleOperation<K,V>> operations)
          Creates a batch operation that corresponds to the operation type of this single operation.
 boolean equals(java.lang.Object other)
           
 long getCreationTime()
          Retrieves the moment when the operation was created.
 K getKey()
          Retrieves the element key for this operation.
 int hashCode()
           
 void performSingleOperation(CacheLoaderWriter<K,V> cacheLoaderWriter)
          Perform this operation as a single execution with the provided cache writer
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteOperation

public DeleteOperation(K key)
Create a new delete operation for a particular entry


DeleteOperation

public DeleteOperation(K key,
                       long creationTime)
Create a new delete operation for a particular entry and creation time

Method Detail

performSingleOperation

public void performSingleOperation(CacheLoaderWriter<K,V> cacheLoaderWriter)
                            throws java.lang.Exception
Description copied from interface: SingleOperation
Perform this operation as a single execution with the provided cache writer

Specified by:
performSingleOperation in interface SingleOperation<K,V>
Throws:
java.lang.Exception

createBatchOperation

public BatchOperation<K,V> createBatchOperation(java.util.List<? extends SingleOperation<K,V>> operations)
Description copied from interface: SingleOperation
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 CacheWriter that will be used to execute the batch operation.

Specified by:
createBatchOperation in interface SingleOperation<K,V>

getKey

public K getKey()
Description copied from interface: KeyBasedOperation
Retrieves the element key for this operation.

Specified by:
getKey in interface KeyBasedOperation<K>
Returns:
the key of the element that is concerned by the operation.

getCreationTime

public long getCreationTime()
Description copied from interface: KeyBasedOperation
Retrieves the moment when the operation was created.

Specified by:
getCreationTime in interface KeyBasedOperation<K>
Returns:
the creation time in milliseconds

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object