public abstract class OperationBase extends Object implements Operation, OperationConfiguration
Operation
and
OperationConfiguration
interfaces. This is an abstract class,
and the only method that classes extending this class need to implement is
the execute()
method.Operation.OperationType
Constructor and Description |
---|
OperationBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
changeToExecuteFixedNumberOfTimes(int numOfTimes)
This is a protected method, which allows only the sub-classes of
Operation to change the execution profile of the operation appropriately.
|
protected void |
changeToExecuteOnce()
This is a protected method, which allows only the sub-classes of
Operation to change the execution profile of the operation appropriately.
|
protected void |
changeToExecutePeriodically(long executionInterval)
This is a protected method, which allows only the sub-classes of
Operation to change the execution profile of the operation appropriately.
|
protected void |
changeToExecuteWhenDataAvailable()
This is a protected method, which allows only the sub-classes of
Operation to change the execution profile of the operation appropriately.
|
protected void |
changeToStayAlive()
This is a protected method, which allows only the sub-classes of
Operation to change the execution profile of the operation appropriately.
|
void |
dispose()
Reclaim resources if any prior to exiting ...
|
abstract void |
execute()
Execute the operation.
|
DatasetCollection |
getDatasetCollection()
Retrieve the dataset that is associated with this particular operation.
|
String |
getDomain()
Get information about the domain for this operation
|
ExecutionProfile |
getExecutionProfile()
Retrieve the execution profile associated with this operation
|
String |
getInstanceIdentifier()
Retrieve the instance identifier for this operation.
|
String |
getOperationIdentifier()
Retrieve the identifier associated with this operation.
|
Properties |
getProcessingDirectives()
These properties encapsulate the set of processing directives that are
needed to initialize the operation in question.
|
long |
getVersionInformation()
A monotonically increasing version number needs to be associated with the
operations.
|
boolean |
hasDatasetCollection()
Returns true if this operation operates on an underlying dataset
collection.
|
boolean |
hasExecutionProfile()
Check to see if this operation has an execution profile
|
boolean |
hasProcessingDirectives()
Checks to see if the operation has processing directives
|
abstract void |
initialize(Properties providedDirectives)
Initialize the operation based on the specified processing directives.
|
boolean |
isInitialized()
Check if the operation has been initialized
|
void |
markInitializationAsComplete() |
void |
marshall(ds.funnel.data.format.FormatWriter mFormat) |
boolean |
needsInitialization()
Returns an indicator that indicates if the initialization needs to be
performed.
|
void |
setAsExecuteContinuously()
Sets the operation to execute continuously as and when it is scheduled.
|
void |
setAsExecuteFixedNumberOfTimes(int numOfTimes)
Sets the operation as being executable a fixed number of times.
|
void |
setAsExecuteOnce()
Sets the operation as being executable exactly once.
|
void |
setAsExecutePeriodically(long executionInterval)
Sets the operation as being executable periodically at the specified
intervals.
|
void |
setAsExecuteWhenDataAvailable()
Sets the operation as being executable when data is available
|
void |
setAsStayAlive()
Sets the operation as being stayAlive.
|
void |
setDatasetCollection(DatasetCollection datasetCollection)
Establish the dataset needed by the application in question
|
void |
setDomain(String domain)
Sets the domain for this operation
|
void |
setInitializationComplete()
Mark the initialization of the application as having completed
|
void |
setInitializationNeeded(boolean needsInitialization)
Set/Unset whether this operation needs initialization.
|
void |
setInstanceIdentifier(String instanceIdentifier)
Sets the instance identifier associated with a given operation.
|
void |
setOperationIdentifier(String operationIdentifier)
This method sets the operation identifier for a given operation
|
void |
setProcessingDirectives(Properties processingDirectives)
Set the processing directives for the operation
|
void |
setTeminationConditionReached()
Mark the termination condition of this operation as having reached.
|
void |
setVersionInformation(long versionInformation)
Sets the version information for this operation.
|
boolean |
terminationConditionReached()
This indicates if the operation has completed or not.
|
String |
toString()
A summarized String-based representation of the operation
|
void |
unmarshall(ds.funnel.data.format.FormatReader mFormat)
Unmarshall the operation from a set of marshalled bytes.
|
public void unmarshall(ds.funnel.data.format.FormatReader mFormat) throws ds.funnel.data.format.FormatException
Operation
unmarshall
in interface Operation
mFormat
- The byte[] representation of the operation.ds.funnel.data.format.FormatException
public void marshall(ds.funnel.data.format.FormatWriter mFormat) throws ds.funnel.data.format.FormatException
marshall
in interface ds.funnel.data.format.FormatMarshaller
ds.funnel.data.format.FormatException
public String getDomain()
Operation
public ExecutionProfile getExecutionProfile()
Operation
getExecutionProfile
in interface Operation
public String getOperationIdentifier()
Operation
getOperationIdentifier
in interface Operation
public void setOperationIdentifier(String operationIdentifier)
OperationConfiguration
setOperationIdentifier
in interface OperationConfiguration
public void setInstanceIdentifier(String instanceIdentifier)
OperationConfiguration
setInstanceIdentifier
in interface OperationConfiguration
public String getInstanceIdentifier()
Operation
getInstanceIdentifier
in interface Operation
public Properties getProcessingDirectives()
Operation
getProcessingDirectives
in interface Operation
public void setProcessingDirectives(Properties processingDirectives)
OperationConfiguration
setProcessingDirectives
in interface OperationConfiguration
public long getVersionInformation()
Operation
getVersionInformation
in interface Operation
public abstract void initialize(Properties providedDirectives) throws ProcessingException
Operation
initialize
in interface Operation
providedDirectives
- The specified processing directivesProcessingException
- If there are problems initializing based on the specified
processing directives.public abstract void execute() throws ProcessingException
Operation
execute
in interface Operation
ProcessingException
- If there are problems executing the operation in question.public void dispose()
Operation
public boolean hasExecutionProfile()
Operation
hasExecutionProfile
in interface Operation
true
if the operation has an execution profile;
false
otherwise.public boolean hasProcessingDirectives()
Operation
hasProcessingDirectives
in interface Operation
true
if the operation has processing directives;
false
otherwise.public boolean terminationConditionReached()
Operation
terminationConditionReached
in interface Operation
true
if the operation has reached its termination
condition; false
otherwise.public boolean isInitialized()
Operation
isInitialized
in interface Operation
true
if the operation has been initialized;
false
otherwise.public void markInitializationAsComplete()
public boolean needsInitialization()
Operation
needsInitialization
in interface Operation
true
if the operation has needs to be initialized;
false
otherwise.public String toString()
Operation
public DatasetCollection getDatasetCollection()
Operation
getDatasetCollection
in interface Operation
public boolean hasDatasetCollection()
Operation
hasDatasetCollection
in interface Operation
true
if the operation has an underlying dataset
collection; false
otherwise.public void setDatasetCollection(DatasetCollection datasetCollection)
OperationConfiguration
setDatasetCollection
in interface OperationConfiguration
public void setDomain(String domain)
OperationConfiguration
setDomain
in interface OperationConfiguration
public void setInitializationComplete()
OperationConfiguration
setInitializationComplete
in interface OperationConfiguration
public void setInitializationNeeded(boolean needsInitialization)
OperationConfiguration
setInitializationNeeded
in interface OperationConfiguration
public void setTeminationConditionReached()
OperationConfiguration
setTeminationConditionReached
in interface OperationConfiguration
public void setVersionInformation(long versionInformation)
OperationConfiguration
setVersionInformation
in interface OperationConfiguration
public void setAsExecuteFixedNumberOfTimes(int numOfTimes)
OperationConfiguration
setAsExecuteFixedNumberOfTimes
in interface OperationConfiguration
public void setAsExecuteOnce()
OperationConfiguration
setAsExecuteOnce
in interface OperationConfiguration
public void setAsExecutePeriodically(long executionInterval)
OperationConfiguration
setAsExecutePeriodically
in interface OperationConfiguration
public void setAsStayAlive()
OperationConfiguration
setAsStayAlive
in interface OperationConfiguration
public void setAsExecuteWhenDataAvailable()
OperationConfiguration
setAsExecuteWhenDataAvailable
in interface OperationConfiguration
public void setAsExecuteContinuously()
OperationConfiguration
setAsExecuteContinuously
in interface OperationConfiguration
protected void changeToExecuteFixedNumberOfTimes(int numOfTimes)
numOfTimes
- The number of times the operation should be executed.protected void changeToExecuteOnce()
protected void changeToExecutePeriodically(long executionInterval)
executionInterval
- The intervals at which the operation should be executed.protected void changeToStayAlive()
protected void changeToExecuteWhenDataAvailable()
Copyright © 2015. All rights reserved.