Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Files | Data Structures | Macros | Typedefs | Enumerations | Functions

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_tafw_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_tafw_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_tafw_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_tafw_adaptor_session_create (const afw_utf8_t *adaptor_id, afw_xctx_t *xctx)
 Create an adaptor session. More...
 
const afw_adaptor_session_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_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_tafw_adaptor_modify_entry_type_mnemonic (afw_adaptor_modify_entry_type_t type)
 Convert entry type enum to mnemonic. More...
 
const afw_value_tafw_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_tafw_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...
 

Detailed Description

Provide afw_adaptor interface common support.

Macro Definition Documentation

◆ AFW_ADAPTOR_MODIFY_ENTRY_TYPE_MAP

#define AFW_ADAPTOR_MODIFY_ENTRY_TYPE_MAP (   XX)
Value:
XX(add_value, true) \
XX(remove_property, false) \
XX(remove_value, true) \
XX(set_property, true) \

Adaptor session modify type map.

XX(name, true/false if tuple has value)

Definition at line 31 of file afw_adaptor_modify.h.

Function Documentation

◆ afw_adaptor_add_object()

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.

Parameters
adaptor_idof adaptor used to add object.
object_type_idof object to add.
suggested_object_idor NULL. The adaptor has the option to use this id or generate one.
objectto 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_entryis a memory object where journal entry properties will be added.
adaptor_type_specificparameter or NULL.
xctxof caller.
Returns
Id of added object.

Add an adaptive object via this adaptor.

Definition at line 20 of file afw_adaptor_add.c.

◆ afw_adaptor_context_prepare()

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::.

Parameters
adaptorfor which the request is being made.
pused for result.
xctxof caller.
Returns
AdaptiveAuthorizationResult object.

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.

◆ afw_adaptor_delete_object()

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.

Parameters
adaptor_idof adaptor used to delete object.
object_type_idof object to delete.
object_idof object to delete.
journal_entryis a memory object where journal entry properties will be added.
adaptor_type_specificparameter or NULL.
xctxof caller.
Returns

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.

◆ afw_adaptor_get_object()

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.

Parameters
adaptor_idId of adaptor used to get object.
object_type_idObject type of object to get.
object_idObject id of object to get.
optionsfor object processing or NULL.
criteriaQuery criteria. Only select criteria is applicable. If criteria is NULL, all properties are returned.
journal_entryis a memory object where journal entry properties will be added.
adaptor_type_specificparameter or NULL.
pto use for returned object.
xctxof caller.
Returns
Pointer to the instance of the object in store session. NULL is returned if object is not found.

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.

◆ afw_adaptor_get_object_by_path()

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.

Parameters
pathPath of object to get.
journal_entryis a memory object where journal entry properties will be added.
adaptor_type_specificparameter or NULL.
xctxof caller.
Returns
Pointer to the instance of the object in store session. NULL is returned if object is not found.

Retrieve a read-only copy of an adaptive object via adaptor.

Definition at line 131 of file afw_adaptor_get.c.

◆ afw_adaptor_get_object_type()

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.

Parameters
adaptor_idId of adaptor used to get object.
object_type_idObject type of object to get.
journal_entryis a memory object where journal entry properties will be added.
xctxof caller.
Returns
Pointer to object type instance.

If object is already in cache, return it. If not, get object via adaptor and add it to cache.

Todo:
FIXME: This may change so that object types are reused unless changed.

Definition at line 437 of file afw_adaptor.c.

◆ afw_adaptor_get_objects_by_paths()

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.

Parameters
pathsNULL terminated list of path pointers of objects to get.
journal_entryis a memory object where journal entry properties will be added.
xctxof caller.
Returns
NULL terminated list of pointers to the instances of the object in store session.

Objects are read only. If a path are not found, an error is thrown and no following object path is processed.

◆ afw_adaptor_get_reference()

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.

Parameters
adaptor_idAdaptor id.
xctxof caller.
Returns
adaptor.

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.

◆ afw_adaptor_journal_advance_cursor_for_consumer()

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.

Parameters
adaptor_idof journal.
consumer_idof associated peer object.
limitis number of entries to search to find applicable entry.
pis pool for result.
xctxof caller
Todo:
FIXME: Add authorization check before and after call.

Definition at line 291 of file afw_adaptor_journal.c.

◆ afw_adaptor_journal_get_by_cursor()

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.

Parameters
adaptor_idof journal.
cursorof entry to retrieve.
pis pool for result.
xctxof caller
Todo:
FIXME: Add authorization check before and after call.

Definition at line 161 of file afw_adaptor_journal.c.

◆ afw_adaptor_journal_get_first()

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.

Parameters
adaptor_idof journal.
pis pool for result.
xctxof caller.
Todo:
FIXME: Add authorization check before and after call.

Definition at line 132 of file afw_adaptor_journal.c.

◆ afw_adaptor_journal_get_next_after_cursor()

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.

Parameters
adaptor_idof journal.
cursorof entry to get next entry after.
pis pool for result.
xctxof caller
Todo:
FIXME: Add authorization check before and after call.

Definition at line 192 of file afw_adaptor_journal.c.

◆ afw_adaptor_journal_get_next_for_consumer()

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.

Parameters
adaptor_idof journal.
consumer_idof associated peer object.
limitis number of entries to search to find applicable entry.
pis pool for result.
xctxof caller
Todo:
FIXME: Add authorization check before and after call.

Definition at line 224 of file afw_adaptor_journal.c.

◆ afw_adaptor_journal_get_next_for_consumer_after_cursor()

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.

Parameters
adaptor_idof journal.
consumer_idof associated peer object.
cursorof entry to get next entry after.
limitis number of entries to search to find applicable entry.
pis pool for result.
xctxof caller
Todo:
FIXME: Add authorization check before and after call.

Definition at line 257 of file afw_adaptor_journal.c.

◆ afw_adaptor_journal_mark_consumed()

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.

Parameters
adaptor_idof journal.
consumer_idof associated peer object.
cursorof entry to get next entry after.
pis pool for result.
xctxof caller
Todo:
FIXME: Add authorization check before and after call.

Definition at line 323 of file afw_adaptor_journal.c.

◆ afw_adaptor_modify_entries_apply_to_unnormalized_object()

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.

Parameters
entriespointer to NULL terminated list of entry pointers.
objectto modify.
xctxof 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.

Todo:
FIXME: is this supposed to be use

Definition at line 344 of file afw_adaptor_modify.c.

◆ afw_adaptor_modify_entries_from_list()

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.

Parameters
listof tuple lists.
pPool for result.
xctxof caller.
Returns
pointer to list of modify entry pointers.

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.

◆ afw_adaptor_modify_entries_to_list()

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.

Parameters
entries
pfor result.
xctxof caller.
Returns
list.

Definition at line 277 of file afw_adaptor_modify.c.

◆ afw_adaptor_modify_entry_type()

afw_adaptor_modify_entry_type_t afw_adaptor_modify_entry_type ( const afw_utf8_t mnemonic)

Convert entry type mnemonic to enum.

Parameters
mnemonicof entry type
Returns
enum of entry type

Definition at line 123 of file afw_adaptor_modify.c.

◆ afw_adaptor_modify_entry_type_mnemonic()

const afw_utf8_t* afw_adaptor_modify_entry_type_mnemonic ( afw_adaptor_modify_entry_type_t  type)

Convert entry type enum to mnemonic.

Parameters
typeenum to convert.
Returns
mnemonic or NULL if invalid.

Definition at line 139 of file afw_adaptor_modify.c.

◆ afw_adaptor_modify_entry_type_value()

const afw_value_t* afw_adaptor_modify_entry_type_value ( afw_adaptor_modify_entry_type_t  type)

Convert entry type enum to value.

Parameters
typeenum to convert.
Returns
(const afw_value_t *) or NULL if invalid.

Definition at line 151 of file afw_adaptor_modify.c.

◆ afw_adaptor_modify_needed_to_reconcile()

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.

Parameters
adaptor_idreturn pointer.
object_type_idreturn pointer.
object_idreturn pointer.
entriesreturn pointer.
originalobject.
modifiedobject.
journal_entryis a memory object where journal entry properties will be added.
pfor result.
xctxof 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.

◆ afw_adaptor_modify_object()

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.

Parameters
adaptor_idof adaptor used to patch object.
object_type_idof object to modify.
object_idof object to modify.
entriesfor parameters to modify.
journal_entryis a memory object where journal entry properties will be added.
adaptor_type_specificparameter or NULL.
xctxof caller.
Returns

Patch an existing adaptive object via adaptor.

Definition at line 794 of file afw_adaptor_modify.c.

◆ afw_adaptor_modify_using_update_object()

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.

Parameters
adaptor_idId of adaptor used to update object.
object_type_idof object to update.
object_idof object to update.
update_objectcontaining properties to replace.
journal_entryis a memory object where journal entry properties will be added.
adaptor_type_specificparameter or NULL.
xctxof caller.
Returns

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.

Todo:
FIXME: move this out of update

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.

◆ afw_adaptor_query_criteria_parse_object()

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.

Parameters
query_criteriais an AdaptiveQueryCriteria object.
adaptor_idof adaptor.
object_type_idof object.
journal_entryis a memory object where journal entry properties will be added.
pto use for result.
xctxof caller.
Returns
parsed query criteria structure.

See afw_query_criteria_parse_AdaptiveQueryCriteria_object().

Definition at line 173 of file afw_adaptor.c.

◆ afw_adaptor_query_criteria_parse_url_encoded_rql_string()

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.

Parameters
url_encoded_rql_stringURL encoded query string.
adaptor_idof adaptor.
object_type_idof object.
journal_entryis a memory object where journal entry properties will be added.
pto use for result.
xctxof caller.
Returns
parsed query criteria structure.

See afw_query_criteria_parse_url_encoded_rql_string().

Definition at line 197 of file afw_adaptor.c.

◆ afw_adaptor_release()

void afw_adaptor_release ( const afw_adaptor_t adaptor,
afw_xctx_t xctx 
)

Release an adaptor accessed by afw_adaptor_get_reference().

Parameters
adaptorto release.
xctxof caller.
Returns
adaptor.

Get adaptor. Start it if necessary and possible.

Definition at line 221 of file afw_adaptor.c.

◆ afw_adaptor_replace_object()

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.

Parameters
adaptor_idId of adaptor used to patch object.
object_type_idof object to update.
object_idof object to update.
replacement_objectReplace 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_entryis a memory object where journal entry properties will be added.
adaptor_type_specificparameter or NULL.
xctxof caller.
Returns

Completely replace an existing adaptive object via adaptor.

Definition at line 20 of file afw_adaptor_replace.c.

◆ afw_adaptor_retrieve_objects()

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.

Parameters
adaptor_idId of adaptor used to retrieve objects.
object_type_idThe object type of objects to be retrieved.
optionsfor object processing or NULL.
criteriaQuery criteria.
journal_entryis a memory object where journal entry properties will be added.
contextPointer passed to callback routine.
callbackCallback function will be called each time an object is retrieved and once with a NULL object pointer when finished.
adaptor_type_specificor NULL.
pto use for retrieved objects.
xctxof 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.

◆ afw_adaptor_session_commit_and_release_cache()

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.

Parameters
abortchanges if true.
xctxof 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.

◆ afw_adaptor_session_create()

const afw_adaptor_session_t* afw_adaptor_session_create ( const afw_utf8_t adaptor_id,
afw_xctx_t xctx 
)

Create an adaptor session.

Parameters
adaptor_idAdaptor id.
xctxof caller.
Returns
Adaptor session.

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.

◆ afw_adaptor_session_get_cached()

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.

Parameters
adaptor_idAdaptor id.
begin_transactionif one is not already started.
xctxof caller.
Returns
Adaptor session.

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.

◆ afw_adaptor_session_release()

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().

Parameters
sessionto release.
xctxof caller.
Returns
Adaptor session.

Any uncommitted changes are lost.

See afw_adaptor_session_get_cached() for using cached session.

Definition at line 282 of file afw_adaptor.c.