Data Delivery C API Library Reference  2.0
Typedefs | Functions
ddca_edgeap.h File Reference

Typedefs

typedef int ddca_edgeap_context_t
 Edge Application context variable type for DDCA Edge Application API.

Functions

int ddca_edgeap_context_create (ddca_edgeap_context_t **context)
 create connection context for edge application
int ddca_edgeap_init (const ddca_edgeap_context_t *context, const char *edgeap_profile_name)
 initialize connection for edge application
int ddca_edgeap_emit (const ddca_event_t *event)
 emit given event data to Data Delivery Core
int ddca_edgeap_emit_with_data_type (const ddca_event_t *event)
 emit given event data with data type to Data Delivery Core
int ddca_edgeap_register_event_cb (int(*AP_EVENT_CB)(ddca_event_t *event))
 register the event callback function
int ddca_edgeap_start (void)
 start to receive the event callback request
int ddca_edgeap_stop (void)
 stop to receive the event callback request
int ddca_edgeap_join (void)
 join the event callback receive thread
int ddca_edgeap_destroy (void)
 destroy the context
int ddca_edgeap_register_process_cb (int(*AP_PROCESS_CB)(const ddca_event_t *request, ddca_event_t *response))
 register the process callback function
int ddca_edgeap_register_filter_cb (ddca_bool_t(*AP_FILTER_CB)(const ddca_event_t *event))
 register the filter callback function
int ddca_edgeap_register_transform_cb (int(*AP_TRANSFORM_CB)(ddca_event_t *event))
 register the transform callback function
int ddca_edgeap_register_operation_cb (int(*AP_OPERATION_CB)(ddca_event_t *event))
 register the operation callback function
int ddca_edgeap_register_notification_cb (int(*NOTIFICATION_CB)(const ddca_event_t *event))
 register the notification callback function
int ddca_edgeap_respond (const char *op_id, const ddca_bool_t success)
 send an acknowledgement of the message from REST API to the backend
int ddca_edgeap_get_profile (ddca_conf_profile_t **profile)
 get a registered profile
int ddca_edgeap_update_profile (void)
 update profile

Detailed Description


Typedef Documentation

typedef int ddca_edgeap_context_t

Edge Application context variable type for DDCA Edge Application API.

This variable type is used to store the connection context between the edge application and data delivery core process.


Function Documentation

create connection context for edge application

This function creates the connection context for connection between an edge application and data delivery core.

Parameters:
[out]**contextconnection context
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_destroy ( void  )

destroy the context

This function destroys the context of connection. The function must be called before the end of the program to exit cleanly.

Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_emit ( const ddca_event_t event)

emit given event data to Data Delivery Core

This function emits the given event data to Data Delivery Core indicated by the context.

Parameters:
[in]*eventdata to be emitted
Return values:
DDCA_SUCCESSoperation success
othersoperation failure

emit given event data with data type to Data Delivery Core

This function emits the given event data with data type to Data Delivery Core indicated by the context.

Parameters:
[in]*eventdata to be emitted
Return values:
DDCA_SUCCESSoperation success
othersoperation failure

get a registered profile

This function returns a pointer to a registered profile.

Parameters:
[out]**profilea regitered profile
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_init ( const ddca_edgeap_context_t context,
const char *  edgeap_profile_name 
)

initialize connection for edge application

This function initializes the connection for a given edge application to Edge delivery core using a context given as a parameter.

Parameters:
[in]*contextconnection context
[in]*edgeap_profile_namefile name of edge application profile
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_join ( void  )

join the event callback receive thread

This function waits to join to the event callback receive thread. The function must be called between the call of ddca_edgeap_start and ddca_edgeap_destroy to terminate the program cleanly.

Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_register_event_cb ( int(*)(ddca_event_t *event)  AP_EVENT_CB)

register the event callback function

This function marks the given function as the event callback function. This event callback function will be called when the new event is notified to this Edge Application. The one which can be registered is one of only 1 of event callback, process callback, filter callback or transform callback.

Parameters:
[in]*AP_EVENT_CBfunction pointer to be marked as the event callback function
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_register_filter_cb ( ddca_bool_t(*)(const ddca_event_t *event)  AP_FILTER_CB)

register the filter callback function

This function marks the given function as the filter callback function. This filter callback function will be called when the new event is notified to this Edge Application. This filter callback function is used to choose whether a received event is forwarded. The one which can be registered is one of only 1 of event callback, process callback, filter callback or transform callback.

Parameters:
[in]*AP_FILTER_CBthe pointer which indicates the filter callback function
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_register_notification_cb ( int(*)(const ddca_event_t *event)  NOTIFICATION_CB)

register the notification callback function

This function marks the given function as the operation callback function. This operation callback function will be called when the operation message is delivered from REST API to this edge application via ICE Core. This operation callback function is used to receive the ddca_event_t variable as the command from REST and expected to act following to its context. ddca_edgeap_respond API is available to respond an acknowledgement to the backend in the callback function.

Parameters:
[in]*NOTIFICATION_CBthe pointer which indicates the operation callback function
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_register_operation_cb ( int(*)(ddca_event_t *event)  AP_OPERATION_CB)

register the operation callback function

This function marks the given function as the operation callback function. This operation callback function will be called when the operation message is delivered from REST API to this edge application via ICE Core. This operation callback function is used to receive the ddca_event_t variable as the command from REST and expected to act following to its context. ddca_edgeap_respond API is available to respond an acknowledgement to the backend in the callback function.

Parameters:
[in]*AP_OPERATION_CBthe pointer which indicates the operation callback function
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_register_process_cb ( int(*)(const ddca_event_t *request, ddca_event_t *response)  AP_PROCESS_CB)

register the process callback function

This function marks the given function as the process callback function. This process callback function will be called when the new event is notified to this Edge Application. This process callback function is used to process event and return response. The one which can be registered is one of only 1 of event callback, process callback, filter callback or transform callback.

Parameters:
[in]*AP_PROCESS_CBthe pointer which indicates the process callback function
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_register_transform_cb ( int(*)(ddca_event_t *event)  AP_TRANSFORM_CB)

register the transform callback function

This function marks the given function as the transform callback function. This transform callback function will be called when the new event is notified to this Edge Application. This transform callback function is used to edit and forward a received event. The one which can be registered is one of only 1 of event callback, process callback, filter callback or transform callback.

Parameters:
[in]*AP_TRANSFORM_CBthe pointer which indicates the transform callback function
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_respond ( const char *  op_id,
const ddca_bool_t  success 
)

send an acknowledgement of the message from REST API to the backend

This function sends an acknowledgement of the message from REST API to the backend. The response can be associated with the message with an op_id and accumulated to the database on the backend. This function is intended to use to the case that to tell the REST API operator the published message is delivered to the application properly which do not return any result, or which return the result after a while. This functoin can be called only once by an operation.

Parameters:
[in]*op_idoperation id to be reported with the result
[in]successresult to be reported
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_start ( void  )

start to receive the event callback request

This function starts to receive the event callback request. The event callback request will be delivered after this function is called.

Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_edgeap_stop ( void  )

stop to receive the event callback request

This function stops to receive the event callback request. The event callback request will not be delivered after this function is called.

Return values:
DDCA_SUCCESSoperation success
othersoperation failure

update profile

This function notifies C API of renewing a profile. A profile is read in C API, and it's re-registered.

Return values:
DDCA_SUCCESSoperation success
othersoperation failure
 All Data Structures Files Functions Variables Typedefs Defines