messif.operations.data
Class DeleteOperation

java.lang.Object
  extended by messif.operations.AbstractOperation
      extended by messif.operations.data.DeleteOperation
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Clearable

public class DeleteOperation
extends AbstractOperation

Operation for deleting an object. The operation keeps one abstract object. All the objects that are data equal to this specified object are deleted from an index structure.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class messif.operations.AbstractOperation
AbstractOperation.DataEqualOperation, AbstractOperation.OperationConstructor, AbstractOperation.OperationName
 
Field Summary
 
Fields inherited from class messif.operations.AbstractOperation
errValue, operID, suppData
 
Constructor Summary
DeleteOperation(LocalAbstractObject deletedObject)
          Creates a new instance of DeleteOperation.
DeleteOperation(LocalAbstractObject deletedObject, int deleteLimit)
          Creates a new instance of DeleteOperation.
DeleteOperation(LocalAbstractObject deletedObject, int deleteLimit, boolean checkLocator)
          Creates a new instance of DeleteOperation.
 
Method Summary
 void addDeletedObject(LocalAbstractObject deletedObject)
          Mark the specified object as deleted by this operation.
 void clearSurplusData()
          Clear non-messif data stored in operation.
protected  boolean dataEqualsImpl(AbstractOperation obj)
          Indicates whether some other operation has the same data as this one.
 int dataHashCode()
          Returns a hash code value for the data of this operation.
 void endOperation()
          End operation successfully.
 java.lang.Object getArgument(int index)
          Returns argument that was passed while constructing instance.
 int getArgumentCount()
          Returns number of arguments that were passed while constructing this instance.
 LocalAbstractObject getDeletedObject()
          Returns the object against which to match the deleted objects.
 int getDeleteLimit()
          Returns the maximal number of deleted objects.
 java.util.List<LocalAbstractObject> getObjects()
          Returns the list of all actually deleted objects.
 boolean isCheckingLocator()
          Returns the flag whether to check that the deleted object's locator is equal to deletedObject's locator.
 void updateFrom(AbstractOperation operation)
          Update the error code of this operation from another operation.
 boolean wasSuccessful()
          Returns true if this operation has finished successfuly.
 
Methods inherited from class messif.operations.AbstractOperation
appendArguments, appendErrorCode, clone, createOperation, dataEquals, endOperation, equals, getAnnotatedConstructor, getAnnotatedConstructor, getConstructorArgumentDescriptions, getConstructorArgumentDescriptions, getConstructorArguments, getConstructorArguments, getConstructorDescription, getErrorCode, getName, getName, getOperationID, hashCode, isFinished, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeleteOperation

public DeleteOperation(LocalAbstractObject deletedObject,
                       int deleteLimit,
                       boolean checkLocator)
Creates a new instance of DeleteOperation.

Parameters:
deletedObject - the object to match the data against
deleteLimit - the maximal number of deleted objects (zero means unlimited)
checkLocator - flag whether to check that the deleted object's locator is equal to deletedObject's locator

DeleteOperation

public DeleteOperation(LocalAbstractObject deletedObject,
                       int deleteLimit)
Creates a new instance of DeleteOperation.

Parameters:
deletedObject - the object to match the data against
deleteLimit - the maximal number of deleted objects (zero means unlimited)

DeleteOperation

public DeleteOperation(LocalAbstractObject deletedObject)
Creates a new instance of DeleteOperation.

Parameters:
deletedObject - the object to match the data against
Method Detail

getDeletedObject

public LocalAbstractObject getDeletedObject()
Returns the object against which to match the deleted objects.

Returns:
the object against which to match the deleted objects

getDeleteLimit

public int getDeleteLimit()
Returns the maximal number of deleted objects. Zero means unlimited.

Returns:
the maximal number of deleted objects.

isCheckingLocator

public boolean isCheckingLocator()
Returns the flag whether to check that the deleted object's locator is equal to deletedObject's locator.

Returns:
the flag whether to check the locator when deleting

getObjects

public java.util.List<LocalAbstractObject> getObjects()
Returns the list of all actually deleted objects.

Returns:
the list of all actually deleted objects

addDeletedObject

public void addDeletedObject(LocalAbstractObject deletedObject)
Mark the specified object as deleted by this operation.

Parameters:
deletedObject - the object that was deleted

getArgument

public java.lang.Object getArgument(int index)
                             throws java.lang.IndexOutOfBoundsException
Description copied from class: AbstractOperation
Returns argument that was passed while constructing instance. If the argument is not stored within operation, null is returned.

Overrides:
getArgument in class AbstractOperation
Parameters:
index - zero-based index of an argument passed to constructor
Returns:
argument that was passed while constructing instance
Throws:
java.lang.IndexOutOfBoundsException - if index parameter is out of range

getArgumentCount

public int getArgumentCount()
Description copied from class: AbstractOperation
Returns number of arguments that were passed while constructing this instance. Negative number is returned if this operation doesn't support construction argument retrieval.

Overrides:
getArgumentCount in class AbstractOperation
Returns:
number of arguments that were passed while constructing this instance

wasSuccessful

public boolean wasSuccessful()
Description copied from class: AbstractOperation
Returns true if this operation has finished successfuly. Otherwise, false is returned - the operation was either unsuccessful or is has not finished yet.

Specified by:
wasSuccessful in class AbstractOperation
Returns:
true if this operation has finished successfuly

endOperation

public void endOperation()
Description copied from class: AbstractOperation
End operation successfully.

Specified by:
endOperation in class AbstractOperation

updateFrom

public void updateFrom(AbstractOperation operation)
Description copied from class: AbstractOperation
Update the error code of this operation from another operation.

Overrides:
updateFrom in class AbstractOperation
Parameters:
operation - the source operation from which to get the update

clearSurplusData

public void clearSurplusData()
Description copied from class: AbstractOperation
Clear non-messif data stored in operation. This method is intended to be called whenever the operation is sent back to client in order to minimize problems with unknown classes after deserialization.

Specified by:
clearSurplusData in interface Clearable
Overrides:
clearSurplusData in class AbstractOperation

dataEqualsImpl

protected boolean dataEqualsImpl(AbstractOperation obj)
Description copied from class: AbstractOperation
Indicates whether some other operation has the same data as this one.

Specified by:
dataEqualsImpl in class AbstractOperation
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object has the same data as the obj argument; false otherwise.

dataHashCode

public int dataHashCode()
Description copied from class: AbstractOperation
Returns a hash code value for the data of this operation. Override this method if the operation has its own data.

Specified by:
dataHashCode in class AbstractOperation
Returns:
a hash code value for the data of this operation