Class ReconciliationTask
- java.lang.Object
-
- org.opendaylight.ovsdb.hwvtepsouthbound.reconciliation.ReconciliationTask
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
ConnectionReconciliationTask
,HwvtepReconciliationTask
public abstract class ReconciliationTask extends Object implements Runnable
Copied from org.opendaylight.ovsdb.southbound.reconciliation.ReconciliationTaskAbstract implementation of a reconciliation task. Each new type of resource configuration reconciliation task should extend this class and implement the abstract methods. Created by Anil Vishnoi (avishnoi@Brocade.com) on 3/9/16.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.opendaylight.yangtools.yang.binding.DataObject
configData
protected HwvtepConnectionManager
connectionManager
protected org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>
nodeIid
protected ReconciliationManager
reconciliationManager
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReconciliationTask(ReconciliationManager reconciliationManager, HwvtepConnectionManager connectionManager, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> nodeIid, org.opendaylight.yangtools.yang.binding.DataObject configData)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
checkReadinessAndProcess()
Extended task should implement the logic that check the readiness of the task for execution.abstract void
doRetry(boolean wasPreviousAttemptSuccessful)
Extended task should implement the logic that decides whether retry for the task is required or not.boolean
equals(Object obj)
int
hashCode()
abstract boolean
reconcileConfiguration(HwvtepConnectionManager connectionManager)
Method contains task reconciliation logic.abstract long
retryDelayInMills()
Method returns the time interval for retrying the failed task.void
run()
String
toString()
-
-
-
Field Detail
-
reconciliationManager
protected final ReconciliationManager reconciliationManager
-
connectionManager
protected final HwvtepConnectionManager connectionManager
-
nodeIid
protected final org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> nodeIid
-
configData
protected final org.opendaylight.yangtools.yang.binding.DataObject configData
-
-
Constructor Detail
-
ReconciliationTask
protected ReconciliationTask(ReconciliationManager reconciliationManager, HwvtepConnectionManager connectionManager, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> nodeIid, org.opendaylight.yangtools.yang.binding.DataObject configData)
-
-
Method Detail
-
reconcileConfiguration
public abstract boolean reconcileConfiguration(HwvtepConnectionManager connectionManager)
Method contains task reconciliation logic. Please refer toConnectionReconciliationTask.reconcileConfiguration(HwvtepConnectionManager)
for example.- Parameters:
connectionManager
- Connection manager to get connection instance of the device- Returns:
- True if reconciliation was successful, else false
-
doRetry
public abstract void doRetry(boolean wasPreviousAttemptSuccessful)
Extended task should implement the logic that decides whether retry for the task is required or not. If retry is required but it does not requires any delay, submit the task immediately usingReconciliationManager.enqueue(ReconciliationTask)
. If retry requires delay, useReconciliationManager.enqueueForRetry(ReconciliationTask)
and specify the delay usingretryDelayInMills()
. If data store operation is required to decide if the task need retry, please implement it as an async operation and submit the task on the callback of the future.Note:Please do not write blocking data store operations
ConnectionReconciliationTask.doRetry(boolean)
- Parameters:
wasPreviousAttemptSuccessful
- Status of the previous attempt
-
checkReadinessAndProcess
public abstract void checkReadinessAndProcess()
Extended task should implement the logic that check the readiness of the task for execution. If task is ready for the execution, submit it for immediate execution usingReconciliationManager.enqueue(ReconciliationTask)
. If task is not ready for execution yet, enqueue it again for delayed execution usingReconciliationManager.enqueueForRetry(ReconciliationTask)
. To check the readiness of the task, if the data store operation is required, please implement it as an async operation and submit the task on the callback of the future.Note:Please do not write blocking data store operations
ConnectionReconciliationTask.doRetry(boolean)
-
retryDelayInMills
public abstract long retryDelayInMills()
Method returns the time interval for retrying the failed task.doRetry(boolean)
- Returns:
- time
-
-