Class AbstractOperation
java.lang.Object
net.messagevortex.router.operation.AbstractOperation
- All Implemented Interfaces:
Serializable,Operation
- Direct Known Subclasses:
AddRedundancy,IdMapOperation,RemoveRedundancy
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleancanRun()Checks if all prerequisiting fields do exist or can be provided by a subsequent operation.abstract int[]execute(int[] id) Executes the operation and sets at least the provided set of id.booleanChecks if the operation is within its usage period.voidsetInternalPayload(InternalPayloadSpace payload) Puts a payload int the workspace.setUsagePeriod(UsagePeriod period) Sets the usage period of the respective operation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.messagevortex.router.operation.Operation
getInputId, getOutputId
-
Constructor Details
-
AbstractOperation
public AbstractOperation()
-
-
Method Details
-
setInternalPayload
Puts a payload int the workspace.
- Specified by:
setInternalPayloadin interfaceOperation- Parameters:
payload- the internal payload of an identity to be registered within its workspace
-
canRun
public abstract boolean canRun()Description copied from interface:OperationChecks if all prerequisiting fields do exist or can be provided by a subsequent operation.
-
getIdentity
- Specified by:
getIdentityin interfaceOperation
-
getUsagePeriod
-
setUsagePeriod
Sets the usage period of the respective operation.
After expiry the accounting layer will remove this operation
- Parameters:
period- the usage period in which the operation is valid- Returns:
- the previously set usage period
-
isInUsagePeriod
public boolean isInUsagePeriod()Checks if the operation is within its usage period.
This method is called by the accounting layer when searching for expired operations.
- Specified by:
isInUsagePeriodin interfaceOperation- Returns:
- true if the operation did not expire yet.
-
execute
public abstract int[] execute(int[] id) Description copied from interface:OperationExecutes the operation and sets at least the provided set of id.
This operation might trigger to execute prerequisiting operations.
-