T
- The type of target virtual node.C
- The type of configuration container in the target virtual node.I
- The type of the identifier for the target virtual node.public abstract class UpdateVirtualNodeTask<T extends org.opendaylight.yangtools.yang.binding.DataObject,C extends org.opendaylight.yangtools.yang.binding.DataObject,I extends VNodeIdentifier<T>> extends AbstractRpcTask<VtnUpdateType>
TxTask
used to create or
update a virtual node in the MD-SAL datastore.
This task returns a VtnUpdateType
instance that indicates the
result of the task.
VtnUpdateType.CREATED
VtnUpdateType.CHANGED
null
Modifier | Constructor and Description |
---|---|
protected |
UpdateVirtualNodeTask(I ident,
VnodeUpdateMode mode,
VtnUpdateOperationType op)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
checkParent(TxContext ctx)
Ensure that the parent node is present.
|
protected abstract void |
create(TxContext ctx,
I ident,
C cfg)
Create a new virtual node.
|
protected abstract C |
createConfig()
Create a new virtual node configuration as specified by the RPC.
|
protected abstract boolean |
equalsConfig(C cur,
C cfg)
Determine whether the given two virtual node configurations are
identical or not.
|
protected VtnUpdateType |
execute(TxContext ctx)
Create or update the specified virtual node in the MD-SAL datastore.
|
protected abstract C |
getConfig(T vnode)
Return the virtual node configuration in the given virtual node.
|
protected abstract org.opendaylight.yangtools.yang.binding.InstanceIdentifier<C> |
getConfigPath(I ident)
Return the instance identifier for the configuration container in the
target virtual node.
|
I |
getIdentifier()
Return the identifier for the target data object.
|
protected abstract C |
mergeConfig(C cur)
Merge the virtual node configuration specified by the RPC with the
current configuration.
|
protected void |
onUpdated(TxContext ctx)
Invoked when the configuration for the target virtual node has been
changed.
|
needErrorLog
addBackgroundTask, execute, getBackgroundTasks, getMaxRetry, onFailure, onSuccess
protected UpdateVirtualNodeTask(I ident, VnodeUpdateMode mode, VtnUpdateOperationType op) throws RpcException
ident
- The identifier for the target virtual node.mode
- A VnodeUpdateMode
instance.op
- A VtnUpdateOperationType
instance.RpcException
- 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 virtual node was not
changed.VTNException
- An error occurred.public final I getIdentifier()
protected void onUpdated(TxContext ctx) throws VTNException
This method of this class does nothing. Subclass may override this method.
ctx
- A runtime context for transaction task.VTNException
- An error occurred.protected abstract void checkParent(TxContext ctx) throws VTNException
ctx
- A runtime context for transaction task.VTNException
- An error occurred.protected abstract C createConfig() throws RpcException
RpcException
- The configuration specified by the RPC is invalid.protected abstract C mergeConfig(C cur) throws RpcException
cur
- The current configuration of the target virtual node.RpcException
- The configuration specified by the RPC is invalid.protected abstract C getConfig(T vnode)
vnode
- The virtual node.protected abstract org.opendaylight.yangtools.yang.binding.InstanceIdentifier<C> getConfigPath(I ident)
ident
- The identifier for the target virtual node.protected abstract boolean equalsConfig(C cur, C cfg)
cur
- The current configuration.cfg
- The configuration that is going to be applied.true
only if the given two configurations are
identical.protected abstract void create(TxContext ctx, I ident, C cfg) throws VTNException
ctx
- A runtime context for transaction task.ident
- The identifier for the new virtual node.cfg
- The configuration for the new virtual node.VTNException
- An error occurred.Copyright © 2018 OpenDaylight. All rights reserved.