Package com.tailf.dp.annotations
Class ValidateCallbackProxy
Object
com.tailf.dp.annotations.ValidateCallbackProxy
- All Implemented Interfaces:
DpValpointCallback
Callback proxy for Validation Callbacks. Implements the
DpValpointCallback
interface and delegates calls to the registered
callback POJO with annotated methods- Since:
- 3.2.0
-
Constructor Summary
ConstructorDescriptionValidateCallbackProxy
(Object backupObject, String callPoint) Constructor for Callback proxys. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionCapability
(ValidateCBType valCBType) Add action capability from annotated callType used to register capabilities on the servervoid
addActionMethod
(String name, Method method) Add callback action method to proxyRetrieve the callback POJORetrieve the callback callpointstatic ValidateCallbackProxy[]
Get array of proxy objects from registered POJO callback.void
validate
(DpTrans trans, ConfObject[] kp, ConfValue newval) The validate() callback should validate the values and throw aDpCallbackException
if the validation fails.valpoint()
The name of the valpoint.
-
Constructor Details
-
ValidateCallbackProxy
Constructor for Callback proxys. Used internally.- Parameters:
backupObject
- registered callback POJOcallPoint
- string describing the callpoint for this callback
-
-
Method Details
-
getBackupObject
Retrieve the callback POJO- Returns:
- Object registered callback object
-
getCallPoint
Retrieve the callback callpoint- Returns:
- callpoint string
-
addActionMethod
Add callback action method to proxy- Parameters:
name
- canonical action namemethod
- registered callback method
-
addActionCapability
Add action capability from annotated callType used to register capabilities on the server- Parameters:
valCBType
- action type
-
validate
public void validate(DpTrans trans, ConfObject[] kp, ConfValue newval) throws DpCallbackException, DpCallbackWarningException Description copied from interface:DpValpointCallback
The validate() callback should validate the values and throw aDpCallbackException
if the validation fails. There is also a possibility to throw aDpCallbackWarningException
with message set to a string describing the warning. The warnings will get propagated to the transaction engine, and depending on where the transaction originates, ConfD/NCS may or may not act on the warnings. If the transaction originates from the CLI or the Web UI, ConfD/NCS will interactively present the user with a choice - whereby the transaction can be aborted.If the transaction originates from NETCONF - which does not have any interactive capabilities, the warnings are ignored. The warnings are primarily intended to alert inexperienced users that attempt to make - dangerous - configuration changes. There can be multiple warnings from multiple validation points in the same transaction.
- Specified by:
validate
in interfaceDpValpointCallback
- Parameters:
trans
- The transactionkp
- The keypathnewval
- The new value to validate- Throws:
DpCallbackException
- If the validation failsDpCallbackWarningException
- If a warning should be propagated to the originator of the transaction.
-
valpoint
Description copied from interface:DpValpointCallback
The name of the valpoint.- Specified by:
valpoint
in interfaceDpValpointCallback
-
getValidateCallbackProxys
public static ValidateCallbackProxy[] getValidateCallbackProxys(Object obj) throws DpCallbackException Get array of proxy objects from registered POJO callback. Used internally at callback registration- Parameters:
obj
- registered Callback POJO- Returns:
- array of ValidateCallbackProxy
- Throws:
DpCallbackException
-