public enum TransCBType extends Enum<TransCBType>
This enumeration defines the different callbacks that can be registered for a transaction. There may be multiple sources of data for the device configuration. In order to orchestrate transactions with multiple sources of data, that participate in a transaction. Each northbound NETCONF operation will be an individual transaction. These transactions are typically very short lived. Transactions originating from the CLI or the Web UI have longer life. The transaction can be viewed as a conceptual state machine where the different phases of the transaction are different states and the invocations of the callback functions are state transitions. The following ASCII art depicts the state machine.
+-------+ | START | +-------+ | init() | v read() +------+ finish() ------> | READ | --------------------> START +------+ ^ | trans_unlock() | | trans_lock() | v read() +----------+ finish() ------> | VALIDATE | -----------------> START +----------+ | write_start() | v write() +-------+ finish() -------> | WRITE | -------------------> START +-------+ | prepare() | v +----------+ commit() +-----------+ | PREPARED | -----------> | COMMITTED | +----------+ +-----------+ | abort() | | | finish() v | +---------+ v | ABORTED | START +---------+ | finish() | v START
kind of storages.
Conf.DB_CANDIDATE If the system has been configured so that the external database owns the candidate data share, we will have to execute candidate transactions here. Usually the system owns the candidate and in that case the external database will never see any DB_CANDIDATE transactions.
Conf.DB_RUNNING This is a transaction towards the actual running configuration of the device. All write operations in a DB_RUNNING transaction must be propagated to the individual subsystems that use this configuration data.
Conf.DB_STARTUP If the system has ben configured to support the NETCONF startup capability, this is a transaction towards the startup database.
Which type we have is indicated through the dbName field in the DpTrans object. A transaction, regardless of whether it originates from the NETCONF agent, the CLI or the Web UI, has several distinct phases:
Enum Constant and Description |
---|
ABORT
Bit flag for the
DpTransCallback.abort(DpTrans) method. |
COMMIT
Bit flag for the
DpTransCallback.commit(DpTrans) method. |
FINISH
Bit flag for the
DpTransCallback.finish(DpTrans) method. |
INIT
Bit flag for the
DpTransCallback.init(DpTrans) method. |
PREPARE
Bit flag for the
DpTransCallback.prepare(DpTrans) method. |
TRANS_LOCK
Bit flag for the
DpTransCallback.transLock(DpTrans) method. |
TRANS_UNLOCK
Bit flag for the
DpTransCallback.transUnlock(DpTrans) method. |
WRITE_START
Bit flag for the
DpTransCallback.writeStart(DpTrans) method. |
Modifier and Type | Method and Description |
---|---|
int |
getValue()
get integer value for enum
|
static TransCBType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TransCBType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TransCBType ABORT
DpTransCallback.abort(DpTrans)
method.public static final TransCBType COMMIT
DpTransCallback.commit(DpTrans)
method.public static final TransCBType FINISH
DpTransCallback.finish(DpTrans)
method.public static final TransCBType INIT
DpTransCallback.init(DpTrans)
method.public static final TransCBType PREPARE
DpTransCallback.prepare(DpTrans)
method.public static final TransCBType TRANS_LOCK
DpTransCallback.transLock(DpTrans)
method.public static final TransCBType TRANS_UNLOCK
DpTransCallback.transUnlock(DpTrans)
method.public static final TransCBType WRITE_START
DpTransCallback.writeStart(DpTrans)
method.public int getValue()
public static TransCBType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic static TransCBType[] values()
for (TransCBType c : TransCBType.values()) System.out.println(c);