yumapro  20.10-14
YumaPro SDK

Database API for subsystems. More...

Collaboration diagram for DB-API:

Functions

status_t agt_db_api_init (void)
 Initialize the DB-API module. More...
 
void agt_db_api_cleanup (void)
 Cleanup the DB-API Module. More...
 
void agt_db_api_check_load_config (void)
 Check if the deferred load_config check is needed. More...
 
status_t agt_db_lock_init (void)
 Initialize the DB-Edit-Lock subsysystem handler. More...
 
void agt_db_lock_cleanup (void)
 Cleanup the DB-Edit-Lock Module. More...
 
status_t agt_db_lock_set_owner (const xmlChar *subsys_id, int subsys_fd)
 Set the subsystem that owns the DB-Edit-Lock. More...
 
boolean agt_db_lock_needed (void)
 Check if lock is needed. More...
 
status_t agt_db_lock_request (agt_cfg_transaction_t *txcb)
 Request the DB-Edit-Lock. More...
 
status_t agt_db_lock_release (void)
 Release the DB-Edit-Lock. More...
 
status_t agt_db_lock_handle_response (uint32 msgid, const xmlChar *subsys_id, ycontrol_msgbody_t msgbody_type, val_value_t *msgbody)
 Handle the db-lock response. More...
 
void agt_db_lock_subsys_gone (const xmlChar *subsys_id)
 Called when the subsystem is gone to cleanup any db-lock state in progress. More...
 
boolean agt_db_lock_init_waiting (void)
 Check if db-lock is stuck in init-waiting state. More...
 

Detailed Description

Database API for subsystems.

Uses YControl protocol to maintain DB-API sessions initiated by a subsystem. Proves access to server functionality such as edit, get, invoke rpc

Function Documentation

◆ agt_db_api_check_load_config()

void agt_db_api_check_load_config ( void  )

Check if the deferred load_config check is needed.

PTHREADS ONLY!!

Here is the call graph for this function:

◆ agt_db_api_cleanup()

void agt_db_api_cleanup ( void  )

Cleanup the DB-API Module.

Called by the server during shutdown.

◆ agt_db_api_init()

status_t agt_db_api_init ( void  )

Initialize the DB-API module.

Returns
status of the initialization procedure
Here is the call graph for this function:

◆ agt_db_lock_cleanup()

void agt_db_lock_cleanup ( void  )

Cleanup the DB-Edit-Lock Module.

Called by server during shutdown

◆ agt_db_lock_handle_response()

status_t agt_db_lock_handle_response ( uint32  msgid,
const xmlChar *  subsys_id,
ycontrol_msgbody_t  msgbody_type,
val_value_t msgbody 
)

Handle the db-lock response.

Parameters
msgidmessage ID
subsys_idsubsystem identifier
msgbody_typePAYLOAD, OK, or ERROR
msgbodyval_value_t representing the <ycontrol> container
Returns
status of the operation
ERR_NCX_SKIPPED if the GET transaction ID not found
Here is the call graph for this function:

◆ agt_db_lock_init()

status_t agt_db_lock_init ( void  )

Initialize the DB-Edit-Lock subsysystem handler.

Called after the CLI parameters are set and before any load-config

Returns
status
Here is the call graph for this function:

◆ agt_db_lock_init_waiting()

boolean agt_db_lock_init_waiting ( void  )

Check if db-lock is stuck in init-waiting state.

Returns
TRUE if db-lock enabled and currently waiting for the DB-API subsystem to send a <db-lock-init> message; FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_db_lock_needed()

boolean agt_db_lock_needed ( void  )

Check if lock is needed.

Returns
TRUE if needed; FALSE if not
Here is the caller graph for this function:

◆ agt_db_lock_release()

status_t agt_db_lock_release ( void  )

Release the DB-Edit-Lock.

Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_db_lock_request()

status_t agt_db_lock_request ( agt_cfg_transaction_t txcb)

Request the DB-Edit-Lock.

Parameters
txcbtransaction in progress
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_db_lock_set_owner()

status_t agt_db_lock_set_owner ( const xmlChar *  subsys_id,
int  subsys_fd 
)

Set the subsystem that owns the DB-Edit-Lock.

Parameters
subsys_idID string of the DB-Edit-Lock owner
subsys_fdfile descriptor number for this subsys
Returns
status
Here is the call graph for this function:

◆ agt_db_lock_subsys_gone()

void agt_db_lock_subsys_gone ( const xmlChar *  subsys_id)

Called when the subsystem is gone to cleanup any db-lock state in progress.

Parameters
subsys_idsubsystem identifier that is gone
Here is the call graph for this function: