public class ValidateCallbackProxy extends Object implements DpValpointCallback
DpValpointCallback interface and delegates calls to the registered
callback POJO with annotated methods| Constructor and Description |
|---|
ValidateCallbackProxy(Object backupObject,
String callPoint)
Constructor for Callback proxys.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionCapability(ValidateCBType valCBType)
Add action capability from annotated callType used to register
capabilities on the server
|
void |
addActionMethod(String name,
Method method)
Add callback action method to proxy
|
Object |
getBackupObject()
Retrieve the callback POJO
|
String |
getCallPoint()
Retrieve the callback callpoint
|
static ValidateCallbackProxy[] |
getValidateCallbackProxys(Object obj)
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 a
DpCallbackException if the validation fails. |
String |
valpoint()
The name of the valpoint.
|
public Object getBackupObject()
public String getCallPoint()
public void addActionMethod(String name, Method method)
name - canonical action namemethod - registered callback methodpublic void addActionCapability(ValidateCBType valCBType)
valCBType - action typepublic void validate(DpTrans trans, ConfObject[] kp, ConfValue newval) throws DpCallbackException, DpCallbackWarningException
DpValpointCallbackDpCallbackException if the validation fails. There is also a
possibility to throw a DpCallbackWarningException 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.
validate in interface DpValpointCallbacktrans - The transactionkp - The keypathnewval - The new value to validateDpCallbackException - If the validation failsDpCallbackWarningExceptionpublic String valpoint()
DpValpointCallbackvalpoint in interface DpValpointCallbackpublic static ValidateCallbackProxy[] getValidateCallbackProxys(Object obj) throws DpCallbackException
obj - registered Callback POJODpCallbackException