19 afw_adaptor_internal_journal_prologue(
63 afw_adaptor_journal_entry_consume(
80 " session get_journal() returned NULL",
86 &afw_s_consumed, &found, xctx);
87 if (!found || !consumed) {
90 " update_object() must have consumed property set to true", xctx);
95 &afw_s_consumerId, xctx);
99 " update_object() must have consumerId property", xctx);
105 consumer_id, object_id, xctx);
110 impl_get_journal_interface(
const afw_utf8_t *adaptor_id,
120 if (!journal)
goto error;
145 journal = impl_get_journal_interface(adaptor_id,
false, xctx);
175 journal = impl_get_journal_interface(adaptor_id,
false, xctx);
206 journal = impl_get_journal_interface(adaptor_id,
false, xctx);
239 journal = impl_get_journal_interface(adaptor_id,
true, xctx);
248 limit, result, xctx);
273 journal = impl_get_journal_interface(adaptor_id,
true, xctx);
282 consumer_id, cursor, limit, result, xctx);
306 journal = impl_get_journal_interface(adaptor_id,
true, xctx);
315 consumer_id, NULL, limit, result, xctx);
334 journal = impl_get_journal_interface(adaptor_id,
true, xctx);
341 consumer_id, cursor, xctx);
374 journal_entry, &afw_s_request, xctx);
378 limit_applies =
false;
384 if (!journal)
return NULL;
389 syntax_z =
"get_first";
391 option_z =
"get_first";
392 if (strlen(
"get_first") != object_id->len)
goto error_special_id;
397 syntax_z =
"get_by_cursor:<event_cursor>";
399 option_z =
"get_by_cursor";
401 object_id->s + strlen(
"get_by_cursor:"),
402 object_id->len - strlen(
"get_by_cursor:"),
404 if (entry_cursor->len == 0)
goto error_special_id;
409 syntax_z =
"get_next_after_cursor:<event_cursor>";
411 option_z =
"get_next_after_cursor";
413 object_id->s + strlen(
"get_next_after_cursor:"),
414 object_id->len - strlen(
"get_next_after_cursor:"),
416 if (entry_cursor->len == 0)
goto error_special_id;
422 limit_applies =
true;
423 syntax_z =
"get_next_for_consumer:<consumer_id>";
425 option_z =
"get_next_for_consumer";
427 object_id->s + strlen(
"get_next_for_consumer:"),
428 object_id->len - strlen(
"get_next_for_consumer:"),
430 if (consumer_id->len == 0)
goto error_special_id;
435 "get_next_for_consumer_after_cursor:"))
437 limit_applies =
true;
439 "get_next_for_consumer_after_cursor:<consumer_id>:<event_cursor>";
441 option_z =
"get_next_for_consumer_after_cursor";
442 s = c = object_id->s + strlen(
"get_next_for_consumer_after_cursor:");
443 len = object_id->len - strlen(
"get_next_for_consumer_after_cursor:");
444 for (; len > 0; c++, len--) {
450 if (len <= 0)
goto error_special_id;
452 if (entry_cursor->len == 0)
goto error_special_id;
457 "advance_cursor_for_consumer:"))
459 limit_applies =
true;
460 syntax_z =
"advance_cursor_for_consumer:<consumer_id>";
463 option_z =
"advance_cursor_for_consumer";
465 object_id->s + strlen(
"advance_cursor_for_consumer:"),
466 object_id->len - strlen(
"advance_cursor_for_consumer:"),
468 if (consumer_id->len == 0)
goto error_special_id;
474 option_z =
"get_by_cursor";
475 entry_cursor = object_id;
480 &afw_s_a_journal_get_entry, xctx);
484 &afw_s_option, option_z, xctx);
509 option, consumer_id, entry_cursor, limit, journal_entry, xctx);
511 &afw_s_status, &afw_s_success, xctx);
512 return journal_entry;
516 "Expecting special objectId in the form: %s", syntax_z);
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
const afw_object_t * afw_adaptor_internal_journal_get_entry(const afw_adaptor_session_t *session, const afw_utf8_t *object_id, const afw_object_t *journal_entry, afw_xctx_t *xctx)
void afw_adaptor_internal_journal_epilogue(const afw_adaptor_session_t *session, const afw_object_t *journal_entry, afw_boolean_t modification, afw_xctx_t *xctx)
#define afw_adaptor_journal_add_entry(instance, impl_request, entry, xctx)
Call method add_entry of interface afw_adaptor_journal.
#define afw_adaptor_journal_mark_entry_consumed(instance, impl_request, consumer_id, entry_cursor, xctx)
Call method mark_entry_consumed of interface afw_adaptor_journal.
#define afw_adaptor_journal_get_entry(instance, impl_request, option, consumer_id, entry_cursor, limit, response, xctx)
Call method get_entry of interface afw_adaptor_journal.
#define afw_adaptor_session_get_journal_interface(instance, xctx)
Call method get_journal_interface of interface afw_adaptor_session.
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.
afw_adaptor_journal_get_first(const afw_utf8_t *adaptor_id, const afw_pool_t *p, afw_xctx_t *xctx)
Journal - get first entry.
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.
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.
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.
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.
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.
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.
#define afw_object_old_get_property_as_boolean(object, property_name, found, xctx)
Get property function for data type boolean value.
afw_object_set_property_as_integer(const afw_object_t *object, const afw_utf8_t *property_name, afw_integer_t internal, afw_xctx_t *xctx)
Set property function for data type integer values.
#define afw_object_old_get_property_as_object(object, property_name, xctx)
Get property function for data type object value.
#define afw_object_old_get_property_as_string(object, property_name, xctx)
Get property function for data type string value.
afw_object_set_property_as_string(const afw_object_t *object, const afw_utf8_t *property_name, const afw_utf8_t *internal, afw_xctx_t *xctx)
Set property function for data type string values.
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
afw_utf8_octet_t afw_utf8_z_t
NFC normalized UTF-8 null terminated string.
char afw_utf8_octet_t
8 bits of utf-8 codepoint.
apr_size_t afw_size_t
size_t.
enum afw_adaptor_journal_option_e afw_adaptor_journal_option_t
Typedef for afw_adaptor_journal get_entry options enum.
@ afw_adaptor_journal_option_get_next_for_consumer_after_cursor
afw_adaptor_journal get_entry option get_next_for_consumer_after_cursor
@ afw_adaptor_journal_option_get_next_for_consumer
afw_adaptor_journal get_entry option get_next_for_consumer
@ afw_adaptor_journal_option_advance_cursor_for_consumer
afw_adaptor_journal get_entry option advance_cursor_for_consumer
@ afw_adaptor_journal_option_get_next_after_cursor
afw_adaptor_journal get_entry option get_next_after_cursor
@ afw_adaptor_journal_option_get_by_cursor
afw_adaptor_journal get_entry option get_by_cursor
@ afw_adaptor_journal_option_get_first
afw_adaptor_journal get_entry option get_first
#define AFW_THROW_ERROR_FZ(code, xctx, format_z,...)
Macro used to set error and 0 rv in xctx and throw it.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
#define afw_memory_clear(to)
Clear preallocated memory for sizeof(*(to)).
#define afw_object_create_managed(p, xctx)
Create an empty entity object in its own pool.
#define AFW_OBJECT_Q_OBJECT_TYPE_ID_JOURNAL_ENTRY
Quoted object type id for Journal Entry object.
afw_object_set_property_as_string_from_utf8_z(const afw_object_t *instance, const afw_utf8_t *property_name, const afw_utf8_z_t *string_z, afw_xctx_t *xctx)
Set an string property from utf8_z.
afw_object_set_property(const afw_object_t *instance, const afw_utf8_t *property_name, const afw_value_t *value, afw_xctx_t *xctx)
Set the value of an object's property.
const afw_object_t * afw_object_create_embedded(const afw_object_t *embedding_object, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Create an empty embedded object in a memory object.
afw_boolean_t afw_utf8_starts_with_z(const afw_utf8_t *string, const afw_utf8_z_t *starts_with_z)
Check to see if a string starts with a utf8_z string.
#define afw_utf8_create(s, len, p, xctx)
Create utf-8 string without copy unless necessary in pool specified.
afw_value_create_dateTime_now_utc(const afw_pool_t *p, afw_xctx_t *xctx)
Create a dateTime value with current time.
Internal request info used by afw_adaptor_impl*() functions.
const afw_utf8_t * journal_adaptor_id
Journal adaptor id (FIXME Going away)
Interface afw_adaptor_journal public struct.
Interface afw_adaptor_session public struct.
Interface afw_object public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Interface afw_value public struct.
Interface afw_xctx public struct.