D - The type of data object in MD-SAL datastore.public abstract class PutDataTask<D extends org.opendaylight.yangtools.yang.binding.DataObject> extends AbstractDataTask<D,VtnUpdateType>
TxTask used to create or
update a data object in the MD-SAL datastore.
This task returns a VtnUpdateType instance that indicates the
result of the task.
VtnUpdateType.CREATED
VtnUpdateType.CHANGED
null
| Constructor and Description |
|---|
PutDataTask(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType store,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<D> path,
D obj,
boolean repl)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected VtnUpdateType |
execute(TxContext ctx)
Create or update a data object in the MD-SAL datastore.
|
protected boolean |
fixMissingParents()
Determine whether missing parent nodes should be created or not.
|
D |
getDataObject()
Return the data object to be submitted.
|
protected void |
onStarted(TxContext ctx,
D current)
Invoked when the MD-SAL datastore transaction has started.
|
void |
setDataObject(D data)
Set the data object to be submitted.
|
getDatastoreType, getTargetPathneedErrorLogaddBackgroundTask, execute, getBackgroundTasks, getMaxRetry, onFailure, onSuccesspublic PutDataTask(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType store,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<D> path,
D obj,
boolean repl)
store - The target type of the MD-SAL datastore.path - The path to the target object.obj - The data object to be submitted.repl - If true, the target object will be replaced with
the given object. Otherwise the given object will be
merged with the target object.public final D getDataObject()
public final void setDataObject(D data)
data - A data object to be submitted.protected boolean fixMissingParents()
true if parent nodes should be created if missing.
Otherwise false.protected void onStarted(TxContext ctx, D current) throws VTNException
ctx - A runtime context for transaction task.current - The current value at the target path in the MD-SAL
datastore. Note that null is passed if the
target data is not present.VTNException - An error occurred.protected final VtnUpdateType execute(TxContext ctx) throws VTNException
execute in class AbstractTxTask<VtnUpdateType>ctx - A runtime context for transaction task.VtnUpdateType instance which indicates the result.
null is returned if the target data object was not
changed.VTNException - An error occurred.Copyright © 2018 OpenDaylight. All rights reserved.