Folks,
There are some rumblings in the community for a need to query
information and execute methods within the openais executive.
Today we have an object database and I had intended for some time to
have on top of that a general simpler to use system that would provide
real time notification of changes via callbacks. All services would
then completely configure via callbacks and be smart enough to
reconfigure themselves when the object database is modified. The
modification notification is still a work in progress :)
The attached is an API that provides a wrapper around some XML
functionality that has been written into cman. It doesn't export objdb
apis directly but does depend on objdb.
There are two parts in the header file. One part is a general user
library API which provides users with access to configuration
information. The remaining portion of the API is the internal API
available to openais executive plugin developers.
Regards
-steve
/*
* External API exported in a library api
*/
typedef uint64_t dataconf_handle_t;
typedef uint64_t dataconf_iterator_handle_t;
typedef enum {
DATACONF_DISPATCH_ONE,
DATACONF_DISPATCH_ALL,
DATACONF_DISPATCH_BLOCKING
} dataconf_dispatch_t;
typedef void (*dataconf_change_fn_t) (
dataconf_handle_t handle,
void *object,
void *object_len,
void *key,
void *key_len,
void *value,
void *value_len);
dataconf_error_t dataconf_initialize (
dataconf_handle_t *handle,
dataconf_callbacks_t *callbacks);
dataconf_error_t dataconf_finalize (
dataconf_handle_t handle);
dataconf_error_t dataconf_fd_get (
dataconf_handle_t *handle,
int *fd);
dataconf_error_t dataconf_dispatch (
dataconf_handle_t handle,
dataconf_handle_T dispatch_types);
/*
* Set current XML request
* If this is a query for informaiton the callbacks will be called if tracking
* is enabled. If this is a request to execute a method, it will be
* executed immediately.
*/
dataconf_error_t dataconf_request_set (
dataconf_handle_t handle,
char *xml_request);
/*
* Retrieve current XML request
* Useful in callback functions
*/
dataconf_error_t dataconf_request_get (
dataconf_handle_t handle,
char **xml_request);
/*
* Starts the delivery of callbacks for the xml query specified.
* All callbacks are deliverd via the dispatch function
* Depending on track flags, the current values of the xml query could be
* delivered in this callback
*/
dataconf_error_t dataconf_track (
dataconf_handle_t dataconf_handle,
int track_flags);
dataconf_error_t dataconf_trackstop (
dataconf_handle_t dataconf_handle);
dataconf_error_t dataconf_iteraton_initialize (
dataconf_handle_t dataconf_handle,
dataconf_iterator_handle_t *dataconf_iterator_handle);
dataconf_error_t dataconf_iteration_next (
dataconf_iterator_handle_t dataconf_iterator_handle,
void *object,
unsigned int object_len,
void *key,
unsigned int key_len,
void *value,
unsigned int value_len);
dataconf_error_t dataconf_iteraton_finalize (
dataconf_iterator_handle_t dataconf_iterator_handle);
/*
* Internal implementation API used inside the executive
*/
typdef uint64t xml_handle_t;
xml_initialize (xml_handle_t *handle);
xml_finalize (xml_handle_t handle);
xml_track_set (xml_handle_t handle,
(void *callback_fn) (
unsigned int seq_no,
void *object, unsigned int object_len,
void *key, unsigned int key_len,
void *value, unsigned int value_len),
unsigned int track_flags)
xml_request_set (xml_handle_t handle, char *request);
xml_finalize (xml_handle_t handle);
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais