public interface MutableNode extends Node
Node that allows changing the configuration data.
Methods in this interface are similar to those in MutableNodeConfig.
This is normal since what is mutable is the configuration data, which
MutableNode simply exposes. Note however that only
NodeConfigTransferObject is exposed, and not MutableNodeConfig itself.
This could allow a MutableNode implementation to not be based on
MutableNodeConfig, although the inverse is generally the case.
OptimisticLockHandle is used to handle optimistic locking. Support for
optimistic locking is not required. But if not supported, implementations must
respect the contract imposed by OptimisticLockHandle and the methods that use
it, doing as if the lock was always valid.
Optimistic lock management is generally delegated to the similar methods in
MutableNodeConfig on which a Node is generally based.
MutableModel| Modifier and Type | Method and Description |
|---|---|
OptimisticLockHandle |
createOptimisticLockHandle(boolean indLock)
Creates an
OptimisticLockHandle. |
void |
delete()
Deletes the MutableNode.
|
NodeConfigTransferObject |
getNodeConfigTransferObject(OptimisticLockHandle optimisticLockHandle)
Returns the
NodeConfigTransferObject. |
boolean |
isDeleted()
Indicates if the MutableNode has been deleted.
|
boolean |
isNew()
|
boolean |
isOptimisticLockValid(OptimisticLockHandle optimisticLockHandle)
Verifies if the lock held by the an
OptimisticLockHandle is valid,
meaning that its state corresponds to the state of the data it represents. |
void |
setNodeConfigTransferObject(NodeConfigTransferObject nodeConfigTransferObject,
OptimisticLockHandle optimisticLockHandle)
Sets the
NodeConfigTransferObject. |
getClassificationNodeParent, getListPluginId, getModel, getName, getNodePath, getNodePlugin, getNodeType, getProperty, isCreatedDynamically, isNodePluginExists, raiseNodeEvent, registerListenerboolean isNew()
setNodeConfigTransferObject(org.azyva.dragom.model.config.NodeConfigTransferObject, org.azyva.dragom.model.config.OptimisticLockHandle) has not been called yet.OptimisticLockHandle createOptimisticLockHandle(boolean indLock)
indLock - Indicates if the OptimisticLockHandle must be initially locked.boolean isOptimisticLockValid(OptimisticLockHandle optimisticLockHandle)
OptimisticLockHandle is valid,
meaning that its state corresponds to the state of the data it represents.
See MutableNodeConfig.isOptimisticLockValid(org.azyva.dragom.model.config.OptimisticLockHandle).
optimisticLockHandle - OptimisticLockHandle.NodeConfigTransferObject getNodeConfigTransferObject(OptimisticLockHandle optimisticLockHandle) throws OptimisticLockException
NodeConfigTransferObject.
See MutableNodeConfig.getNodeConfigTransferObject(org.azyva.dragom.model.config.OptimisticLockHandle).
optimisticLockHandle - OptimisticLockHandle. Can be null.OptimisticLockException - This is a RuntimeException that may be of
interest to the caller.void setNodeConfigTransferObject(NodeConfigTransferObject nodeConfigTransferObject, OptimisticLockHandle optimisticLockHandle) throws OptimisticLockException, DuplicateNodeException
NodeConfigTransferObject.
nodeConfigTransferObject - NodeConfigTransferObject.optimisticLockHandle - OptimisticLockHandle. Can be null.OptimisticLockException - This is a RuntimeException that may be of
interest to the caller.DuplicateNodeException - This is a RuntimeException that may be of
interest to the caller.void delete()
boolean isDeleted()
A MutableNode can be deleted only if delete() is called. Specifically an
implementation must not rely on removing MutableNode's from internal caches to
force their recreation when changes to configuration data could affect their
state. Instead, the implementation must ensure that created MutableNode's
remain valid, but can reset their internal state if required.
delete could be called, followed by the recreation of the MutableNode. But delete is an interface method and is intended to be called by an external caller, not by the implementation itself.
A special case exists. If the MutableNode has been created dynamically using
NodeBuilder and is converted into one based on
MutableNodeConfig, the former can be deleted. This is getting close to
a hack since this case is hard to handle cleanly. In general, it is expected
that an application allowing to manage persistent MutableConfig data
will not include tasks that would cause the dynamic creation of MutableNode's,
so this case would not occur. And tasks which can benefit from the dynamic
creation of Node's are expected to be tools that consume the
Config data to perform jobs on reference graphs and in turn, these do
not modify the Config, so this case would not occur either.
Copyright © 2015–2017 AZYVA INC.. All rights reserved.