Adaptive Framework
0.9.0
|
Files | |
file | afw_adaptor.h |
Header for interface afw_adaptor* helpers. | |
file | afw_adaptor_add.h |
Adaptive Framework adaptor add object. | |
file | afw_adaptor_delete.h |
Adaptive Framework adaptor delete object. | |
file | afw_adaptor_get.h |
Adaptive Framework adaptor get object. | |
file | afw_adaptor_journal.h |
Adaptive Framework adaptor journal. | |
file | afw_adaptor_modify.h |
Adaptive Framework adaptor modify object. | |
file | afw_adaptor_replace.h |
Adaptive Framework adaptor replace object. | |
file | afw_adaptor_retrieve.h |
Adaptive Framework adaptor retrieve objects. | |
Data Structures | |
struct | afw_adaptor_id_anchor_s |
struct | afw_adaptor_modify_entry_s |
Adaptor modify entry. More... | |
Macros | |
#define | AFW_ADAPTOR_MODIFY_ENTRY_TYPE_MAP(XX) |
Adaptor session modify type map. More... | |
Typedefs | |
typedef enum afw_adaptor_modify_entry_type_e | afw_adaptor_modify_entry_type_t |
Adaptor session modify type enum. | |
Enumerations | |
enum | afw_adaptor_modify_entry_type_e { afw_adaptor_modify_entry_type_invalid } |
Adaptor session modify type enum. | |
Functions | |
void | afw_adaptor_context_prepare (const afw_adaptor_t *adaptor, const afw_pool_t *p, afw_xctx_t *xctx) |
Prepare expression evaluation context for adaptor::. More... | |
const afw_adaptor_t * | afw_adaptor_get_reference (const afw_utf8_t *adaptor_id, afw_xctx_t *xctx) |
Get an adaptor and make sure it is started. More... | |
const afw_query_criteria_t * | afw_adaptor_query_criteria_parse_object (const afw_object_t *query_criteria, const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_object_t *journal_entry, const afw_pool_t *p, afw_xctx_t *xctx) |
Parse query criteria object appropriate for an adaptor. More... | |
const afw_query_criteria_t * | afw_adaptor_query_criteria_parse_url_encoded_rql_string (const afw_utf8_t *url_encoded_rql_string, const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_object_t *journal_entry, const afw_pool_t *p, afw_xctx_t *xctx) |
Parse URL encoded RQL query string appropriate for an adaptor. More... | |
void | afw_adaptor_release (const afw_adaptor_t *adaptor, afw_xctx_t *xctx) |
Release an adaptor accessed by afw_adaptor_get_reference(). More... | |
void | afw_adaptor_session_commit_and_release_cache (afw_boolean_t abort, afw_xctx_t *xctx) |
Commit/Abort changes and release cached sessions and objects. More... | |
const afw_adaptor_session_t * | afw_adaptor_session_create (const afw_utf8_t *adaptor_id, afw_xctx_t *xctx) |
Create an adaptor session. More... | |
const afw_adaptor_session_t * | afw_adaptor_session_get_cached (const afw_utf8_t *adaptor_id, afw_boolean_t begin_transaction, afw_xctx_t *xctx) |
Get/create an active cached session for adaptor_id. More... | |
void | afw_adaptor_session_release (const afw_adaptor_session_t *session, afw_xctx_t *xctx) |
Release an adaptor session created by afw_adaptor_session_create(). More... | |
const afw_utf8_t * | afw_adaptor_add_object (const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *suggested_object_id, const afw_object_t *object, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx) |
Call adaptor to add object and remove from cache. More... | |
void | afw_adaptor_delete_object (const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx) |
Delete object from cache and via adaptor. More... | |
const afw_object_t * | afw_adaptor_get_object (const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_options_t *options, const afw_query_criteria_t *criteria, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, const afw_pool_t *p, afw_xctx_t *xctx) |
Get and cache object. More... | |
const afw_object_type_t * | afw_adaptor_get_object_type (const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_object_t *journal_entry, afw_xctx_t *xctx) |
Get and cache AdaptiveObjectType object. More... | |
const afw_object_t * | afw_adaptor_get_object_by_path (const afw_utf8_t *path, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx) |
Get and cache object by path. More... | |
const afw_object_t *const * | afw_adaptor_get_objects_by_paths (const afw_utf8_t *const *paths, const afw_object_t *journal_entry, afw_xctx_t *xctx) |
Get and cache objects by paths. More... | |
const afw_object_t * | afw_adaptor_journal_advance_cursor_for_consumer (const afw_utf8_t *adaptor_id, const afw_utf8_t *consumer_id, afw_size_t limit, const afw_pool_t *p, afw_xctx_t *xctx) |
Journal - advance cursor for consumer. More... | |
const afw_object_t * | afw_adaptor_journal_get_first (const afw_utf8_t *adaptor_id, const afw_pool_t *p, afw_xctx_t *xctx) |
Journal - get first entry. More... | |
const afw_object_t * | afw_adaptor_journal_get_by_cursor (const afw_utf8_t *adaptor_id, const afw_utf8_t *cursor, const afw_pool_t *p, afw_xctx_t *xctx) |
Journal - get entry at cursor. More... | |
const afw_object_t * | afw_adaptor_journal_get_next_after_cursor (const afw_utf8_t *adaptor_id, const afw_utf8_t *cursor, const afw_pool_t *p, afw_xctx_t *xctx) |
Journal - get next entry after cursor. More... | |
const afw_object_t * | afw_adaptor_journal_get_next_for_consumer (const afw_utf8_t *adaptor_id, const afw_utf8_t *consumer_id, afw_size_t limit, const afw_pool_t *p, afw_xctx_t *xctx) |
Journal - get next entry for consumer. More... | |
const afw_object_t * | afw_adaptor_journal_get_next_for_consumer_after_cursor (const afw_utf8_t *adaptor_id, const afw_utf8_t *consumer_id, const afw_utf8_t *cursor, afw_size_t limit, const afw_pool_t *p, afw_xctx_t *xctx) |
Journal - get next entry after cursor for consumer. More... | |
void | afw_adaptor_journal_mark_consumed (const afw_utf8_t *adaptor_id, const afw_utf8_t *consumer_id, const afw_utf8_t *cursor, const afw_pool_t *p, afw_xctx_t *xctx) |
Journal - mark entry consumed by consumer. More... | |
void | afw_adaptor_journal_entry_consume (const afw_adaptor_session_t *session, const afw_utf8_t *object_id, const afw_object_t *update_object, afw_xctx_t *xctx) |
void | afw_adaptor_modify_object (const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_list_t *entries, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx) |
Modify object and remove from cache. More... | |
void | afw_adaptor_modify_using_update_object (const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *update_object, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx) |
Modify using update object and remove from cache. More... | |
afw_adaptor_modify_entry_type_t | afw_adaptor_modify_entry_type (const afw_utf8_t *mnemonic) |
Convert entry type mnemonic to enum. More... | |
const afw_utf8_t * | afw_adaptor_modify_entry_type_mnemonic (afw_adaptor_modify_entry_type_t type) |
Convert entry type enum to mnemonic. More... | |
const afw_value_t * | afw_adaptor_modify_entry_type_value (afw_adaptor_modify_entry_type_t type) |
Convert entry type enum to value. More... | |
const afw_adaptor_modify_entry_t *const * | afw_adaptor_modify_entries_from_list (const afw_list_t *list, const afw_pool_t *p, afw_xctx_t *xctx) |
Create modify entries from list of tuple lists in specified pool. More... | |
const afw_list_t * | afw_adaptor_modify_entries_to_list (const afw_adaptor_modify_entry_t *const *entries, const afw_pool_t *p, afw_xctx_t *xctx) |
Create a list from modify entries in specified pool. More... | |
void | afw_adaptor_modify_entries_apply_to_unnormalized_object (const afw_adaptor_modify_entry_t *const *entries, const afw_object_t *object, afw_xctx_t *xctx) |
Apply modify entries to an unnormalized object. More... | |
void | afw_adaptor_modify_needed_to_reconcile (const afw_utf8_t **adaptor_id, const afw_utf8_t **object_type_id, const afw_utf8_t **object_id, const afw_list_t **entries, const afw_object_t *original, const afw_object_t *modified, const afw_object_t *journal_entry, const afw_pool_t *p, afw_xctx_t *xctx) |
Produce modify needed to reconcile two objects. More... | |
void | afw_adaptor_replace_object (const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *replacement_object, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx) |
Replace object and remove from cache. More... | |
void | afw_adaptor_retrieve_objects (const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_object_options_t *options, const afw_query_criteria_t *criteria, const afw_object_t *journal_entry, void *context, afw_object_cb_t callback, const afw_object_t *adaptor_type_specific, const afw_pool_t *p, afw_xctx_t *xctx) |
Retrieve objects. More... | |
Provide afw_adaptor interface common support.
#define AFW_ADAPTOR_MODIFY_ENTRY_TYPE_MAP | ( | XX | ) |
Adaptor session modify type map.
XX(name, true/false if tuple has value)
Definition at line 31 of file afw_adaptor_modify.h.
const afw_utf8_t* afw_adaptor_add_object | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | object_type_id, | ||
const afw_utf8_t * | suggested_object_id, | ||
const afw_object_t * | object, | ||
const afw_object_t * | journal_entry, | ||
const afw_object_t * | adaptor_type_specific, | ||
afw_xctx_t * | xctx | ||
) |
Call adaptor to add object and remove from cache.
adaptor_id | of adaptor used to add object. |
object_type_id | of object to add. |
suggested_object_id | or NULL. The adaptor has the option to use this id or generate one. |
object | to add. The afw_object_meta_get_object_id() and afw_object_type_get_object_type() methods of the object are used to identify the existing object to add. |
journal_entry | is a memory object where journal entry properties will be added. |
adaptor_type_specific | parameter or NULL. |
xctx | of caller. |
Add an adaptive object via this adaptor.
Definition at line 20 of file afw_adaptor_add.c.
void afw_adaptor_context_prepare | ( | const afw_adaptor_t * | adaptor, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Prepare expression evaluation context for adaptor::.
adaptor | for which the request is being made. |
p | used for result. |
xctx | of caller. |
This is called internally by afw_adaptor_* functions, so it is not usually necessary to call this externally.
Definition at line 20 of file afw_adaptor_context.c.
void afw_adaptor_delete_object | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | object_type_id, | ||
const afw_utf8_t * | object_id, | ||
const afw_object_t * | journal_entry, | ||
const afw_object_t * | adaptor_type_specific, | ||
afw_xctx_t * | xctx | ||
) |
Delete object from cache and via adaptor.
adaptor_id | of adaptor used to delete object. |
object_type_id | of object to delete. |
object_id | of object to delete. |
journal_entry | is a memory object where journal entry properties will be added. |
adaptor_type_specific | parameter or NULL. |
xctx | of caller. |
Delete an existing adaptive object via adaptor. The object will not actually be deleted until method commit() is called.
Definition at line 19 of file afw_adaptor_delete.c.
const afw_object_t* afw_adaptor_get_object | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | object_type_id, | ||
const afw_utf8_t * | object_id, | ||
const afw_object_options_t * | options, | ||
const afw_query_criteria_t * | criteria, | ||
const afw_object_t * | journal_entry, | ||
const afw_object_t * | adaptor_type_specific, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Get and cache object.
adaptor_id | Id of adaptor used to get object. |
object_type_id | Object type of object to get. |
object_id | Object id of object to get. |
options | for object processing or NULL. |
criteria | Query criteria. Only select criteria is applicable. If criteria is NULL, all properties are returned. |
journal_entry | is a memory object where journal entry properties will be added. |
adaptor_type_specific | parameter or NULL. |
p | to use for returned object. |
xctx | of caller. |
If object is already in cache, return it. If not, get object via adaptor and add it to cache.
If criteria->own is false, all of the uncached ancestors of retrieved objects will be retrieved and placed in cache.
Definition at line 45 of file afw_adaptor_get.c.
const afw_object_t* afw_adaptor_get_object_by_path | ( | const afw_utf8_t * | path, |
const afw_object_t * | journal_entry, | ||
const afw_object_t * | adaptor_type_specific, | ||
afw_xctx_t * | xctx | ||
) |
Get and cache object by path.
path | Path of object to get. |
journal_entry | is a memory object where journal entry properties will be added. |
adaptor_type_specific | parameter or NULL. |
xctx | of caller. |
Retrieve a read-only copy of an adaptive object via adaptor.
Definition at line 131 of file afw_adaptor_get.c.
const afw_object_type_t* afw_adaptor_get_object_type | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | object_type_id, | ||
const afw_object_t * | journal_entry, | ||
afw_xctx_t * | xctx | ||
) |
Get and cache AdaptiveObjectType object.
adaptor_id | Id of adaptor used to get object. |
object_type_id | Object type of object to get. |
journal_entry | is a memory object where journal entry properties will be added. |
xctx | of caller. |
If object is already in cache, return it. If not, get object via adaptor and add it to cache.
Definition at line 437 of file afw_adaptor.c.
const afw_object_t* const* afw_adaptor_get_objects_by_paths | ( | const afw_utf8_t *const * | paths, |
const afw_object_t * | journal_entry, | ||
afw_xctx_t * | xctx | ||
) |
Get and cache objects by paths.
paths | NULL terminated list of path pointers of objects to get. |
journal_entry | is a memory object where journal entry properties will be added. |
xctx | of caller. |
Objects are read only. If a path are not found, an error is thrown and no following object path is processed.
const afw_adaptor_t* afw_adaptor_get_reference | ( | const afw_utf8_t * | adaptor_id, |
afw_xctx_t * | xctx | ||
) |
Get an adaptor and make sure it is started.
adaptor_id | Adaptor id. |
xctx | of caller. |
Get a registered adaptor by adaptor id and increment it's reference count. If the adaptor is not already registered, start it if possible and return the adaptor with a reference count of 2.
It is the responsibility of the caller to call afw_adaptor_release() for each call to afw_adaptor_get_reference(). When an adaptor reference count goes to 0, it is unregistered and it's resources released.
Definition at line 143 of file afw_adaptor.c.
const afw_object_t* afw_adaptor_journal_advance_cursor_for_consumer | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | consumer_id, | ||
afw_size_t | limit, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Journal - advance cursor for consumer.
adaptor_id | of journal. |
consumer_id | of associated peer object. |
limit | is number of entries to search to find applicable entry. |
p | is pool for result. |
xctx | of caller |
Definition at line 291 of file afw_adaptor_journal.c.
const afw_object_t* afw_adaptor_journal_get_by_cursor | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | cursor, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Journal - get entry at cursor.
adaptor_id | of journal. |
cursor | of entry to retrieve. |
p | is pool for result. |
xctx | of caller |
Definition at line 161 of file afw_adaptor_journal.c.
const afw_object_t* afw_adaptor_journal_get_first | ( | const afw_utf8_t * | adaptor_id, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Journal - get first entry.
adaptor_id | of journal. |
p | is pool for result. |
xctx | of caller. |
Definition at line 132 of file afw_adaptor_journal.c.
const afw_object_t* afw_adaptor_journal_get_next_after_cursor | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | cursor, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Journal - get next entry after cursor.
adaptor_id | of journal. |
cursor | of entry to get next entry after. |
p | is pool for result. |
xctx | of caller |
Definition at line 192 of file afw_adaptor_journal.c.
const afw_object_t* afw_adaptor_journal_get_next_for_consumer | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | consumer_id, | ||
afw_size_t | limit, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Journal - get next entry for consumer.
adaptor_id | of journal. |
consumer_id | of associated peer object. |
limit | is number of entries to search to find applicable entry. |
p | is pool for result. |
xctx | of caller |
Definition at line 224 of file afw_adaptor_journal.c.
const afw_object_t* afw_adaptor_journal_get_next_for_consumer_after_cursor | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | consumer_id, | ||
const afw_utf8_t * | cursor, | ||
afw_size_t | limit, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Journal - get next entry after cursor for consumer.
adaptor_id | of journal. |
consumer_id | of associated peer object. |
cursor | of entry to get next entry after. |
limit | is number of entries to search to find applicable entry. |
p | is pool for result. |
xctx | of caller |
Definition at line 257 of file afw_adaptor_journal.c.
void afw_adaptor_journal_mark_consumed | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | consumer_id, | ||
const afw_utf8_t * | cursor, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Journal - mark entry consumed by consumer.
adaptor_id | of journal. |
consumer_id | of associated peer object. |
cursor | of entry to get next entry after. |
p | is pool for result. |
xctx | of caller |
Definition at line 323 of file afw_adaptor_journal.c.
void afw_adaptor_modify_entries_apply_to_unnormalized_object | ( | const afw_adaptor_modify_entry_t *const * | entries, |
const afw_object_t * | object, | ||
afw_xctx_t * | xctx | ||
) |
Apply modify entries to an unnormalized object.
entries | pointer to NULL terminated list of entry pointers. |
object | to modify. |
xctx | of caller. |
This function applies changes, in place, to an unnormalized object. The resulting object will also be unnormalized.
The original intent of this function is for use by adaptor implementations that store objects without their data type. When objects are retrieved from this type of adaptor, they are usually normalized which will convert values to their correct data type.
An add_value for a property that has a single value will result in a multi-value property. This may be a consideration when the value is later normalized.
Definition at line 344 of file afw_adaptor_modify.c.
const afw_adaptor_modify_entry_t* const* afw_adaptor_modify_entries_from_list | ( | const afw_list_t * | list, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Create modify entries from list of tuple lists in specified pool.
list | of tuple lists. |
p | Pool for result. |
xctx | of caller. |
The following tuples define property and property value operations that apply to an Object. The "propertyname" can also be a list of names when referring to an embedded object. To reference a.b['c d'] as expressed in adaptive expression syntax, use ["a", "b", "c d"] in a modify entry.
The "add_value" tuple will add "value" to "property3". If the DataType is list, then the new "value" will be appended. If DataType is not list, it will fail if "property3" already has a value; otherwise, it's equivalent to "set_property":
[ "add_value", "propertyname", or ["propertyname", "propertyname", ...], "value" ],
The "remove_property" tuple will remove "property2" and all of it's value(s):
[ "remove_property", "propertyname" or ["propertyname", "propertyname", ...] ],
The "remove_value" tuple will remove "value" from "property4". If DataType is list, then "value" will be removed from the list. If the DataType is not list, then it's equivalent to "remove_property". In either case, an exception is thrown if "value" does not exist in "property4":
[ "remove_value", "propertyname", or ["propertyname", "propertyname", ...], "value" ],
The "set_property" tuple will set "property1" to "value", regardless of what is in the store.
[ "set_property", "propertyname", or ["propertyname", "propertyname", ...], "value" ],
Definition at line 163 of file afw_adaptor_modify.c.
const afw_list_t* afw_adaptor_modify_entries_to_list | ( | const afw_adaptor_modify_entry_t *const * | entries, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Create a list from modify entries in specified pool.
entries | |
p | for result. |
xctx | of caller. |
Definition at line 277 of file afw_adaptor_modify.c.
afw_adaptor_modify_entry_type_t afw_adaptor_modify_entry_type | ( | const afw_utf8_t * | mnemonic | ) |
Convert entry type mnemonic to enum.
mnemonic | of entry type |
Definition at line 123 of file afw_adaptor_modify.c.
const afw_utf8_t* afw_adaptor_modify_entry_type_mnemonic | ( | afw_adaptor_modify_entry_type_t | type | ) |
Convert entry type enum to mnemonic.
type | enum to convert. |
Definition at line 139 of file afw_adaptor_modify.c.
const afw_value_t* afw_adaptor_modify_entry_type_value | ( | afw_adaptor_modify_entry_type_t | type | ) |
Convert entry type enum to value.
type | enum to convert. |
Definition at line 151 of file afw_adaptor_modify.c.
void afw_adaptor_modify_needed_to_reconcile | ( | const afw_utf8_t ** | adaptor_id, |
const afw_utf8_t ** | object_type_id, | ||
const afw_utf8_t ** | object_id, | ||
const afw_list_t ** | entries, | ||
const afw_object_t * | original, | ||
const afw_object_t * | modified, | ||
const afw_object_t * | journal_entry, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Produce modify needed to reconcile two objects.
adaptor_id | return pointer. |
object_type_id | return pointer. |
object_id | return pointer. |
entries | return pointer. |
original | object. |
modified | object. |
journal_entry | is a memory object where journal entry properties will be added. |
p | for result. |
xctx | of caller. |
Parameters adaptor_id, object_type_id, object_id, and entries are pointers to variables that are suitable to pass to the corresponding parameters of afw_adaptor_modify_object().
Definition at line 732 of file afw_adaptor_modify.c.
void afw_adaptor_modify_object | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | object_type_id, | ||
const afw_utf8_t * | object_id, | ||
const afw_list_t * | entries, | ||
const afw_object_t * | journal_entry, | ||
const afw_object_t * | adaptor_type_specific, | ||
afw_xctx_t * | xctx | ||
) |
Modify object and remove from cache.
adaptor_id | of adaptor used to patch object. |
object_type_id | of object to modify. |
object_id | of object to modify. |
entries | for parameters to modify. |
journal_entry | is a memory object where journal entry properties will be added. |
adaptor_type_specific | parameter or NULL. |
xctx | of caller. |
Patch an existing adaptive object via adaptor.
Definition at line 794 of file afw_adaptor_modify.c.
void afw_adaptor_modify_using_update_object | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | object_type_id, | ||
const afw_utf8_t * | object_id, | ||
const afw_object_t * | update_object, | ||
const afw_object_t * | journal_entry, | ||
const afw_object_t * | adaptor_type_specific, | ||
afw_xctx_t * | xctx | ||
) |
Modify using update object and remove from cache.
adaptor_id | Id of adaptor used to update object. |
object_type_id | of object to update. |
object_id | of object to update. |
update_object | containing properties to replace. |
journal_entry | is a memory object where journal entry properties will be added. |
adaptor_type_specific | parameter or NULL. |
xctx | of caller. |
Update an existing adaptive object via adaptor. Existing properties will be removed if they are not present if the updated object.
The values of properties in the update object will completely replace the values of properties in the existing object. The afw_object_meta_get_object_id() and afw_object_type_get_object_type() methods of the update object are used to identify the existing object to update.
This function calls an adaptor modify method after converting the update object to a modify request.
Journal entry.
if (afw_utf8_equal(object_type_id, &AFW_OBJECT_S_OBJECT_TYPE_ID_JOURNAL_ENTRY)) { afw_adaptor_journal_entry_consume(session, object_id, update_object, xctx); return; }
Definition at line 872 of file afw_adaptor_modify.c.
const afw_query_criteria_t* afw_adaptor_query_criteria_parse_object | ( | const afw_object_t * | query_criteria, |
const afw_utf8_t * | adaptor_id, | ||
const afw_utf8_t * | object_type_id, | ||
const afw_object_t * | journal_entry, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Parse query criteria object appropriate for an adaptor.
query_criteria | is an AdaptiveQueryCriteria object. |
adaptor_id | of adaptor. |
object_type_id | of object. |
journal_entry | is a memory object where journal entry properties will be added. |
p | to use for result. |
xctx | of caller. |
See afw_query_criteria_parse_AdaptiveQueryCriteria_object().
Definition at line 173 of file afw_adaptor.c.
const afw_query_criteria_t* afw_adaptor_query_criteria_parse_url_encoded_rql_string | ( | const afw_utf8_t * | url_encoded_rql_string, |
const afw_utf8_t * | adaptor_id, | ||
const afw_utf8_t * | object_type_id, | ||
const afw_object_t * | journal_entry, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Parse URL encoded RQL query string appropriate for an adaptor.
url_encoded_rql_string | URL encoded query string. |
adaptor_id | of adaptor. |
object_type_id | of object. |
journal_entry | is a memory object where journal entry properties will be added. |
p | to use for result. |
xctx | of caller. |
See afw_query_criteria_parse_url_encoded_rql_string().
Definition at line 197 of file afw_adaptor.c.
void afw_adaptor_release | ( | const afw_adaptor_t * | adaptor, |
afw_xctx_t * | xctx | ||
) |
Release an adaptor accessed by afw_adaptor_get_reference().
adaptor | to release. |
xctx | of caller. |
Get adaptor. Start it if necessary and possible.
Definition at line 221 of file afw_adaptor.c.
void afw_adaptor_replace_object | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | object_type_id, | ||
const afw_utf8_t * | object_id, | ||
const afw_object_t * | replacement_object, | ||
const afw_object_t * | journal_entry, | ||
const afw_object_t * | adaptor_type_specific, | ||
afw_xctx_t * | xctx | ||
) |
Replace object and remove from cache.
adaptor_id | Id of adaptor used to patch object. |
object_type_id | of object to update. |
object_id | of object to update. |
replacement_object | Replace an existing object. The values of properties in this updated object will completely replace the values of properties in the existing object. The afw_object_meta_get_object_id() and afw_object_type_get_object_type() methods of the update object are used to identify the existing object to update. |
journal_entry | is a memory object where journal entry properties will be added. |
adaptor_type_specific | parameter or NULL. |
xctx | of caller. |
Completely replace an existing adaptive object via adaptor.
Definition at line 20 of file afw_adaptor_replace.c.
void afw_adaptor_retrieve_objects | ( | const afw_utf8_t * | adaptor_id, |
const afw_utf8_t * | object_type_id, | ||
const afw_object_options_t * | options, | ||
const afw_query_criteria_t * | criteria, | ||
const afw_object_t * | journal_entry, | ||
void * | context, | ||
afw_object_cb_t | callback, | ||
const afw_object_t * | adaptor_type_specific, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Retrieve objects.
adaptor_id | Id of adaptor used to retrieve objects. |
object_type_id | The object type of objects to be retrieved. |
options | for object processing or NULL. |
criteria | Query criteria. |
journal_entry | is a memory object where journal entry properties will be added. |
context | Pointer passed to callback routine. |
callback | Callback function will be called each time an object is retrieved and once with a NULL object pointer when finished. |
adaptor_type_specific | or NULL. |
p | to use for retrieved objects. |
xctx | of caller. |
Retrieve and cache adaptive objects via this adaptor that match criteria.
If criteria->own is false, all of the ancestors of retrieved objects will be retrieved and placed in cache.
Definition at line 44 of file afw_adaptor_retrieve.c.
void afw_adaptor_session_commit_and_release_cache | ( | afw_boolean_t | abort, |
afw_xctx_t * | xctx | ||
) |
Commit/Abort changes and release cached sessions and objects.
abort | changes if true. |
xctx | of caller. |
See afw_adaptor_session_get_cached().
This function will call the commit() method of all active transactions in the reverse order they began, then close all sessions in no particular order.
Definition at line 391 of file afw_adaptor.c.
const afw_adaptor_session_t* afw_adaptor_session_create | ( | const afw_utf8_t * | adaptor_id, |
afw_xctx_t * | xctx | ||
) |
Create an adaptor session.
adaptor_id | Adaptor id. |
xctx | of caller. |
This creates an adaptor session. It is the responsibility of the caller to call afw_adaptor_session_release(). It is also the responsibility of the caller to call afw_adaptor_transaction_commit() and afw_adaptor_transaction_release().
See afw_adaptor_session_get_cached() for using cached session.
Definition at line 265 of file afw_adaptor.c.
const afw_adaptor_session_t* afw_adaptor_session_get_cached | ( | const afw_utf8_t * | adaptor_id, |
afw_boolean_t | begin_transaction, | ||
afw_xctx_t * | xctx | ||
) |
Get/create an active cached session for adaptor_id.
adaptor_id | Adaptor id. |
begin_transaction | if one is not already started. |
xctx | of caller. |
If an active session is cached, return it. If not, create a new session, cache it, begin a transaction (if supported), and return it. If unsuccessful, error thrown.
This session will be released by afw_adaptor_session_commit_and_release_cache().
Definition at line 375 of file afw_adaptor.c.
void afw_adaptor_session_release | ( | const afw_adaptor_session_t * | session, |
afw_xctx_t * | xctx | ||
) |
Release an adaptor session created by afw_adaptor_session_create().
session | to release. |
xctx | of caller. |
Any uncommitted changes are lost.
See afw_adaptor_session_get_cached() for using cached session.
Definition at line 282 of file afw_adaptor.c.