messif.operations.data
Class InsertOperation

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

public class InsertOperation
extends AbstractOperation

Operation for inserting an object. The operation keeps one abstract object that is going to be inserted into 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
protected  LocalAbstractObject insertedObject
          Inserted object
 
Fields inherited from class messif.operations.AbstractOperation
errValue, operID, suppData
 
Constructor Summary
InsertOperation(LocalAbstractObject insertedObject)
          Creates a new instance of InsertOperation.
 
Method Summary
 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 getInsertedObject()
          Returns the object being inserted.
 java.lang.String toString()
          Return a string representation of this 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, updateFrom
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

insertedObject

protected final LocalAbstractObject insertedObject
Inserted object

Constructor Detail

InsertOperation

public InsertOperation(LocalAbstractObject insertedObject)
Creates a new instance of InsertOperation.

Parameters:
insertedObject - the object to insert by this operation
Method Detail

getInsertedObject

public LocalAbstractObject getInsertedObject()
Returns the object being inserted.

Returns:
the object being inserted

getArgument

public java.lang.Object getArgument(int index)
                             throws java.lang.IndexOutOfBoundsException
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 - 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()
Returns number of arguments that were passed while constructing this instance.

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

wasSuccessful

public boolean wasSuccessful()
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()
End operation successfully

Specified by:
endOperation in class AbstractOperation

toString

public java.lang.String toString()
Return a string representation of this operation.

Overrides:
toString in class AbstractOperation
Returns:
a string representation of this operation

clearSurplusData

public void clearSurplusData()
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)
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()
Returns a hash code value for the data of this operation.

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