Adaptive Framework 0.9.0

Interfaces

Often a pattern emerges that may take advantage of having multiple internal or external implementations. Adaptive Framework declares an Adaptive Interface definition for these patterns in order to formalize and document the related functions and parameters. This allows the core and extensions to follow a contract and work cohesively together through the interface implementation. Refer to the following table for a list of interfaces and their descriptions.

InterfaceDescription
afw_extensionInterface returned from afw_extension_initialize() of an Adaptive Framework environment extension module. Additional information about an extension is found in object /afw/_AdaptiveManifest_/<extension_id>.
afw_adaptor_factoryFactory to create an instance of an afw_adaptor.
afw_adaptorAdaptor interface.
afw_adaptor_object_type_cacheAdaptor object type cache interface. This interface is used by afw_adaptor_get_object_type().
afw_adaptor_sessionAdaptor session interface.
afw_adaptor_transactionAdaptor session transaction interface.
afw_adaptor_impl_index_cursorAdaptor implementation index cursor interface.
afw_adaptor_key_valueAdaptor implementation of key value interface.
afw_adaptor_impl_indexAdaptor implementation index interface.
afw_authorization_handler_factoryFactory to create an instance of an afw_authorization_handler.
afw_authorization_handlerAdaptive framework authorization handler interface.
afw_content_typeAdaptive Content Type.
afw_content_type_object_list_writer
afw_data_typeAdaptive Data Type.
afw_list_setterAdaptive list setter interface.
afw_listAdaptive value list interface.
afw_log_factoryLog factory.
afw_logLog.
afw_object_setterThis is interface used to set properties and meta of an adaptive object. See interface afw_object method get_object_setter for more information.
afw_objectThis is interface used to access the properties of an adaptive object.
afw_serverAdaptive framework server interface.
afw_service_typeAdaptive framework service type interface. Each instance is registered in the environment with type of "service_type" and id of the service type id.
afw_object_associative_arrayThis is interface for an object associative array.
afw_request_handler_factoryCreate an instance of an afw_request_handler.
afw_request_handlerAdaptive framework request handler interface.
afw_connectionAdaptive Framework connection. This has not yet been developed.
afw_requestAdaptive framework request interface.
afw_xctxAdaptive Framework Execution Context (xctx) interface. An execution context holds common information related to a unit of work in Adaptive Framwork. This unit of work runs in a single thread of a single-threaded or multi-threaded process. In a multi-threaded process, the main thread has the global execution context. Other threads have their own execution context and required the appropriate mutexes or queued work to access memory in the global execution context. The type of execution contexts can be "server", "request_session', etc. A execution context's pool, properties, and object cache will last for the life of the execution context. An execution context's parent will always have a longer life.
afw_streamAn interface for a stream.
afw_poolAdaptive framework pool interface.
afw_adaptor_journalAdaptor journal interface.
afw_valueAdaptive value.
afw_variable_handlerAdaptive variable handler.
afw_writerAn interface for a writer.

The following sections describe a few interfaces that are significant to discussion of the Adaptive Framework architecture. For a more comprehensive list, refer to the Developer Guide.

Request Handlers

Request Handlers control how client requests are handled to by implementing the afw_request_handler interface. Currently, the only Request Handler provided by Core is the Adaptor Request Handler, which allows clients to retrieve and store objects in configured Adaptor(s). In time, additional request handlers may be added to provide functionality, such as XACML.

Content Types

Both core and extensions may register Content Types, which provide Adaptive Objects with an external representation. These Content Types are useful for translating adaptive objects between adaptors and storing them in ways that are convenient and useful. They allow you to encode and decode all properties of an Adaptive Object, including their Adaptive Values. The following content types are provided by core:

Content TypeDescription
JSONJavascript Object Notation
XMLExtensible Markup Language
UBJSONUniversal Binary JSON
YAMLYAML Ain't Markup Language

Adaptors

Adaptors implement several afw_adaptor_ interfaces in order to provide your Adaptive Framework application with a way to store and retrieve Adaptive Objects. There are several adaptors that are included with the Adaptive Framework:

AdaptorDescription
FileFile-based object storage
LDAPLightweight Directory Access Protocol
LMDBLightning Memory-Mapped Database
ModelModel Adaptor
VFSVirtual File System

Logs

Logs implement the afw_log interface and allow for messages produced by Adaptive Framework to be routed to an external destination for viewing. There are currently two Logs available:

LogDescription
StandardLogging to standard output
SyslogLogging to syslog

Journals

Journals implement the afw_adaptor_journal interface and allow for object events to be journaled into a persistent queue. Journals must maintain cursors into this queue to track clients (or Provisioning Peers) who are producing or consuming journal entries. Currently, two adaptors also support the Journal interface:

JournalDescription
FileFile-based journal
LMDBLightning Memory-Mapped Database journal

Authorization Handlers

Authorization Handlers implement the afw_authorization_ interfaces in order to provide Adaptive Framework Core with a way to request and enforce authorization decisions when clients make requests for resources. There is currently one Authorization Handler provided by Core:

Authorization HandlerDescription
ScriptAdaptive-Script based authorization