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
Operationunmarshall in interface OperationmFormat - The byte[] representation of the operation.ds.funnel.data.format.FormatExceptionpublic void marshall(ds.funnel.data.format.FormatWriter mFormat)
throws ds.funnel.data.format.FormatException
marshall in interface ds.funnel.data.format.FormatMarshallerds.funnel.data.format.FormatExceptionpublic String getDomain()
Operationpublic ExecutionProfile getExecutionProfile()
OperationgetExecutionProfile in interface Operationpublic String getOperationIdentifier()
OperationgetOperationIdentifier in interface Operationpublic void setOperationIdentifier(String operationIdentifier)
OperationConfigurationsetOperationIdentifier in interface OperationConfigurationpublic void setInstanceIdentifier(String instanceIdentifier)
OperationConfigurationsetInstanceIdentifier in interface OperationConfigurationpublic String getInstanceIdentifier()
OperationgetInstanceIdentifier in interface Operationpublic Properties getProcessingDirectives()
OperationgetProcessingDirectives in interface Operationpublic void setProcessingDirectives(Properties processingDirectives)
OperationConfigurationsetProcessingDirectives in interface OperationConfigurationpublic long getVersionInformation()
OperationgetVersionInformation in interface Operationpublic abstract void initialize(Properties providedDirectives) throws ProcessingException
Operationinitialize in interface OperationprovidedDirectives - The specified processing directivesProcessingException - If there are problems initializing based on the specified
processing directives.public abstract void execute()
throws ProcessingException
Operationexecute in interface OperationProcessingException - If there are problems executing the operation in question.public void dispose()
Operationpublic boolean hasExecutionProfile()
OperationhasExecutionProfile in interface Operationtrue if the operation has an execution profile;
false otherwise.public boolean hasProcessingDirectives()
OperationhasProcessingDirectives in interface Operationtrue if the operation has processing directives;
false otherwise.public boolean terminationConditionReached()
OperationterminationConditionReached in interface Operationtrue if the operation has reached its termination
condition; false otherwise.public boolean isInitialized()
OperationisInitialized in interface Operationtrue if the operation has been initialized;
false otherwise.public void markInitializationAsComplete()
public boolean needsInitialization()
OperationneedsInitialization in interface Operationtrue if the operation has needs to be initialized;
false otherwise.public String toString()
Operationpublic DatasetCollection getDatasetCollection()
OperationgetDatasetCollection in interface Operationpublic boolean hasDatasetCollection()
OperationhasDatasetCollection in interface Operationtrue if the operation has an underlying dataset
collection; false otherwise.public void setDatasetCollection(DatasetCollection datasetCollection)
OperationConfigurationsetDatasetCollection in interface OperationConfigurationpublic void setDomain(String domain)
OperationConfigurationsetDomain in interface OperationConfigurationpublic void setInitializationComplete()
OperationConfigurationsetInitializationComplete in interface OperationConfigurationpublic void setInitializationNeeded(boolean needsInitialization)
OperationConfigurationsetInitializationNeeded in interface OperationConfigurationpublic void setTeminationConditionReached()
OperationConfigurationsetTeminationConditionReached in interface OperationConfigurationpublic void setVersionInformation(long versionInformation)
OperationConfigurationsetVersionInformation in interface OperationConfigurationpublic void setAsExecuteFixedNumberOfTimes(int numOfTimes)
OperationConfigurationsetAsExecuteFixedNumberOfTimes in interface OperationConfigurationpublic void setAsExecuteOnce()
OperationConfigurationsetAsExecuteOnce in interface OperationConfigurationpublic void setAsExecutePeriodically(long executionInterval)
OperationConfigurationsetAsExecutePeriodically in interface OperationConfigurationpublic void setAsStayAlive()
OperationConfigurationsetAsStayAlive in interface OperationConfigurationpublic void setAsExecuteWhenDataAvailable()
OperationConfigurationsetAsExecuteWhenDataAvailable in interface OperationConfigurationpublic void setAsExecuteContinuously()
OperationConfigurationsetAsExecuteContinuously in interface OperationConfigurationprotected 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.