public interface MutableNodeConfig extends NodeConfig
NodeConfig that allows changing the configuration data.
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.
If optimistic locking is supported, it generally is by including a last modification timestamp or unique revision number in the OptimisticLockHandle implementation.
MutableConfig| Modifier and Type | Method and Description |
|---|---|
OptimisticLockHandle |
createOptimisticLockHandle(boolean indLock)
Creates an
OptimisticLockHandle. |
void |
delete()
Deletes the MutableNodeConfig.
|
NodeConfigTransferObject |
getNodeConfigTransferObject(OptimisticLockHandle optimisticLockHandle)
Returns the
NodeConfigTransferObject. |
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. |
getListPluginDefConfig, getListPropertyDefConfig, getName, getNodeType, getPluginDefConfig, getPropertyDefConfig, isPluginDefConfigExists, isPropertyExistsboolean isNew()
setNodeConfigTransferObject(org.azyva.dragom.model.config.NodeConfigTransferObject, org.azyva.dragom.model.config.OptimisticLockHandle) has not been called yet.OptimisticLockHandle createOptimisticLockHandle(boolean indLock)
OptimisticLockHandle.
Implementations which do not support optimistic lock management should return an OptimisticLockHandle that reports being in the requested state, with no relation to the state of any data.
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.
Implementations which do not support optimistic lock management should return true.
optimisticLockHandle - OptimisticLockHandle.NodeConfigTransferObject getNodeConfigTransferObject(OptimisticLockHandle optimisticLockHandle) throws OptimisticLockException
NodeConfigTransferObject.
If optimisticLockHandle is null, no optimistic lock is managed.
If optimisticLockHandle is not null and is locked
(OptimisticLockHandle.isLocked()), its state must correspond to the state
of the data it represents, otherwise OptimisticLockException is thrown.
If optimisticLockHandle is not null and is not locked, it is simply locked to the current state of the data.
Implementations which do not support optimistic lock management simply change
the state of the OptimisticLockHandle to locked if optimisticLockHandle
is not null.
optimisticLockHandle - OptimisticLockHandle. Can be null.NodeConfigTransferObject.OptimisticLockException - Can be thrown only if optimisticLockHandle is
not null and is locked. This is a RuntimeException that may be of interest to
the caller.void setNodeConfigTransferObject(NodeConfigTransferObject nodeConfigTransferObject, OptimisticLockHandle optimisticLockHandle) throws OptimisticLockException, DuplicateNodeException
NodeConfigTransferObject.
If the instance has a parent object (i.e., it is a child of
MutableClassificationNodeConfig or the root
MutableClassificationNodeConfig of MutableConfig), it must ensure the
parent is adjusted.
If the instance is new (isNew()), it is finalized and installed within
the parent, if appropriate.
If optimisticLockHandle is null, no optimistic lock is managed.
If optimisticLockHandle is not null, it must be locked
(OptimisticLockHandle.isLocked()) and its state must correspond to the
state of the data it represents, otherwise OptimisticLockException is
thrown. Upon return, it must be updated to correspond to the new state of the
data it represents.
Implementations which do not support optimistic lock management can simply ignore optimisticLockHandle, or better, validate that if it is not null, it is locked.
nodeConfigTransferObject - NodeConfigTransferObject.optimisticLockHandle - OptimisticLockHandle. Can be null.OptimisticLockException - Can be thrown only if optimisticLockHandle is
not null. This is a RuntimeException that may be of interest to
the caller.DuplicateNodeException - When the new configuration data would introduce
a duplicate MutableNode within the parent. This is a RuntimeException
that may be of interest to the caller.void delete()
If the instance has a parent object (i.e., it is a child of
MutableClassificationNodeConfig or the root
MutableClassificationNodeConfig of MutableConfig), it must ensure the
parent is adjusted.
Once deleted, a MutableNodeConfig must not be used anymore.
Copyright © 2015–2017 AZYVA INC.. All rights reserved.