sorcery: Add support for object staleness
authorMatt Jordan <mjordan@digium.com>
Sat, 4 Jul 2015 15:03:06 +0000 (10:03 -0500)
committerMatt Jordan <mjordan@digium.com>
Sun, 5 Jul 2015 01:32:09 +0000 (20:32 -0500)
commitb178f8701bee0b56b3648a3c63bff1cd8ee0bc6d
tree25de93b965b5b078418e01ce3b6012f7a0573424
parent987548413d05af0f29089e3d54cb277b5d2156c4
sorcery: Add support for object staleness

This patch enhances the sorcery API to allow for sorcery wizards to
determine if an object is stale. This includes the following:

* Sorcery objects now have a timestamp that is set on creation. Since
  sorcery objects are immutable, this can be used by sorcery wizards to
  determine if an object is stale.

* A new API call has been added, ast_sorcery_is_stale. This API call
  queries the wizards associated with the object, calling a new callback
  function 'is_stale'. Note that if a wizard does not support the new
  callback, objects are always assumed to not be stale.

* Unit tests have been added that cover the new API call.

Change-Id: Ica93c6a4e8a06c0376ea43e00cf702920b806064
include/asterisk/sorcery.h
main/sorcery.c
tests/test_sorcery.c