yumapro  20.10-10
YumaPro SDK
Transaction Hooks

Transaction hooks allow advanced access to an edit transaction. More...

Collaboration diagram for Transaction Hooks:

Functions

void sil_sa_hooks_clean_added_edits (dlq_hdr_t *added_editQ)
 Clean the added edits from the profile. More...
 
val_value_tsil_sa_hooks_make_added_edit_payload (sil_sa_cb_t *sacb, status_t *res)
 Make the <transaction-response> message return-value. More...
 
status_t sil_sa_hooks_add_edit (sil_sa_cb_t *sil_sa_cb, const xmlChar *defpath, val_value_t *edit_value, const xmlChar *edit_operation, const xmlChar *insert_where, const xmlChar *insert_point, boolean skip_cb)
 Add an edit to the current transaction from SIL-SA. More...
 
status_t sil_sa_hooks_send_get_request (sil_sa_cb_t *sil_sa_cb, ncx_cfg_t cfg_id, const xmlChar *defpath)
 Send the <hook-get-request> message. More...
 
status_t sil_sa_hook_handle_get_request (sil_sa_cb_t *sil_sa_cb, val_value_t *msgbody, ycontrol_msgbody_t msgbody_type)
 Handles incoming <payload> from server for the <hook-get-request> More...
 

Detailed Description

Transaction hooks allow advanced access to an edit transaction.

Special callbacks can be called at various points in the transaction process.

All functions in this module are user APIs for subsystem use only!

Function Documentation

status_t sil_sa_hook_handle_get_request ( sil_sa_cb_t sil_sa_cb,
val_value_t msgbody,
ycontrol_msgbody_t  msgbody_type 
)

Handles incoming <payload> from server for the <hook-get-request>

Parameters
sil_sa_cbsil_sa control block to use
msgbody<payload> node in normal repsonse
msgbody_typemessage body type (Error, payload, etc)
Returns
status

Here is the call graph for this function:

status_t sil_sa_hooks_add_edit ( sil_sa_cb_t sil_sa_cb,
const xmlChar *  defpath,
val_value_t edit_value,
const xmlChar *  edit_operation,
const xmlChar *  insert_where,
const xmlChar *  insert_point,
boolean  skip_cb 
)

Add an edit to the current transaction from SIL-SA.

This is the real add_edit function. The sil_sa_add_edit function calls this function.

Save an added edit in the SIL-SA Control block for further hook-response processing

Move or insertion OP available. Skip callbacks for added edits option is available.

Only allowed for Set Hooks or Post Set Hook, the rest are ignored.

Parameters
sil_sa_cbsil_sa control block to use
defpathXPath path of object instance
edit_valueval_value_t representing newnode in transaction
only needed for create, merge, replace, not delete
edit_operation<operation string>="">
  • "create"
  • "delete"
  • "insert"
  • "merge"
  • "move"
  • "replace"
  • "remove"
insert_where<insert enum="" string>=""> (NULL if not used)
  • "before"
  • "after"
  • "first"
  • "last"
  • Will be used only if the operations are "move" or "insert".
    Ignored otherwise.
insert_pointis a XPath encoded string like the defpath. Only for 'before' or 'after' insert_where paramter. The insert_where must be set to 'before' or 'after' if insert_point specified. Will be used only if the operations are "move" or "insert".
Ignored otherwise.
E.g: "/test3[string.1='entry2'][uint32.1='2']"
skip_cbTRUE if DO NOT invoke callbacks for an edded edit if any. FALSE if SKIP any callback for added edit including Transaction, EDIT1, EDIT2 callbacks Only when target=running
Returns
status
See also
db_api_edit_full2
sil_sa_add_edit

Here is the call graph for this function:

Here is the caller graph for this function:

void sil_sa_hooks_clean_added_edits ( dlq_hdr_t *  added_editQ)

Clean the added edits from the profile.

added_editQ Q of edits to clean

Here is the call graph for this function:

val_value_t* sil_sa_hooks_make_added_edit_payload ( sil_sa_cb_t sacb,
status_t res 
)

Make the <transaction-response> message return-value.

Parameters
sacbSIL-SA control block to use
resaddress of return status
Return values
*resreturn status
Returns
Malloced and filled in val_value_t
Need to free with val_free_value

Here is the call graph for this function:

status_t sil_sa_hooks_send_get_request ( sil_sa_cb_t sil_sa_cb,
ncx_cfg_t  cfg_id,
const xmlChar *  defpath 
)

Send the <hook-get-request> message.

Get the val_value based on Xpath of object instance This function will return value only if there is existing node in the datastore or there is defaults for the node.

The <hook-get-request> message is sent and state changed to SIL_SA_ST_WAIT_HOOK_GETDATA

Parameters
sil_sa_cbsil_sa control block to use
cfg_idconfiguration datastore ID to use
defpathXPath path of object instance
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function: