Adaptive Framework 0.9.0

Adaptors

This chapter goes over the various Adaptors, how and when each should be used, and how to configure them.

Adaptive Framework Core

This adaptor is a special adaptor, because it always exists and there is only one instance of its type. This adaptor is provided by the Adaptive Framework Core and uses the adaptorId of "afw". It presents objects that have been compiled into memory and also generates runtime objects that exist from configurations and environment. Objects from the Core adaptor are read-only.

File

This adaptor allows adaptive objects to be stored in the native file system as directories and files.

Features

Configuration Parameters

PropertyDescription
contentTypeThis is the content type to be used for this file adaptor. This must be a content-type that is registered by core or by an extension.
filenameSuffixWhen locating file objects, this adaptor will use this suffix to append to the objectId in order to resolve the filename.
isDevelopmentInputThis should only be used during Adaptive Framework core and extension development. It allows core object type instances to be written to the directory used by generate.py.
isModelLocationIf specified, this adaptor can hold _AdaptiveModel_ objects. The appropriate core objects associated with Adaptive Models will be added automatically for this adaptor.
isPolicyLocationIf specified, this adaptor can hold _AdaptivePolicy_ and _AdaptivePolicySet_ objects. The appropriate core objects associated with Adaptive Policies and Policy Sets will be added automatically for this adaptor.
rootWhen locating objects within this adaptor, this root path will be prepended in order to resolve filenames. It must already exist and be accessible. This hybrid value is evaluated at the time the adaptor is started.

LDAP

This adaptor provides access to adaptive objects stored in Lightweight Directory Access Protocol (LDAP) compliant databases.

Features

Configuration Parameters

PropertyDescription
bindParametersBind parameters for this LDAP adaptor.
preventVerifyCertSpecify true to prevent the ldap server certificate from being verified when url uses the LDAPS scheme. If this parameter is false or not specified, the adaptor does not influence the decision to verify the server certificate.
urlURL of LDAP Server. For example, ldaps://ldap-server:636

LMDB

This adaptor allows adaptive objects to be stored in the memory-mapped key-value database, LMDB.

Features

Configuration Parameters

PropertyDescription
envEnvironment settings for LMDB.
limitsDatabase limits for LMDB.

Model

This is a special adaptor that's used to support mapping objects based on model adaptive object types to one or more objects from another adaptor.

Features

Configuration Parameters

PropertyDescription
customQualifier custom:: variables available to model expressions.
mappedAdaptorIdThis is the default mappedAdaptorId value.
modelIdThe objectId of the _AdaptiveModel_ object in the modelLocationAdaptorId adaptor.
modelLocationAdaptorIdThis is the id of the adaptor that contains object type _AdaptiveModel_ and related objects.

VFS

This adaptor allows you to access files as objects through a Virtual File System.

Features

Configuration Parameters

PropertyDescription
markExecutableThis is a list of vfsPath filename patterns whose host files should be marked as executable when written. For instance, ["*.as"] will mark Adaptive Scripts whose vfsPath ends with ".as" as executable. A PATTERN match uses Apache apr function apr_fnmatch() which interprets a pattern as follows: There are no illegal patterns. PATTERN: Backslash followed by any character, including another backslash. MATCHES: That character exactly. PATTERN: ? MATCHES: Any single character. PATTERN: * MATCHES: Any sequence of zero or more characters. (Note that multiple *s in a row are equivalent to one.) PATTERN: Any character other than \?*[ or a \ at the end of the pattern MATCHES: That character exactly. (Case sensitive.) PATTERN: [ followed by a class description followed by ] MATCHES: A single character described by the class description. (Never matches, if the class description reaches until the end of the string without a ].) If the first character of the class description is ^ or !, the sense of the description is reversed. The rest of the class description is a list of single characters or pairs of characters separated by -. Any of those characters can have a backslash in front of them, which is ignored; this lets you use the characters ] and - in the character class, as well as ^ and ! at the beginning. The pattern matches a single character if it is one of the listed characters or falls into one of the listed ranges (inclusive, case sensitive). Ranges with the first character larger than the second are legal but never match. Edge cases: [] never matches, and [^] and [!] always match without consuming a character. Note that these patterns attempt to match the entire vfsPath, not just find a substring matching the pattern.
vfsMapThis property is a list of vfs map entries. The vfsPath of objects in this vfs adaptor is of the form: /<adaptorId>/<objectId> Where <adaptorId> is the id of this adaptor and where <objectId> is the relative path from the vfs root directory ("<adaptorId>/") to the associated file or directory. An <objectId> of a directory ends with a slash ('/'). Each vfsMap entry is a string of the form: <objectId_prefix>=<host file system directory path> <objectId_prefix> can be empty if the entry applies to files and directories in the vfs root directory or the objectId of a directory within the vfs. The <host file system directory path> must end in a slash ('/'). A backslash is tolerated on a Windows host. The host system file path is the <objectId> with <objectId_prefix> removed appended to the associated <host file system directory path>. The map entry with the longest matching <objectId_prefix> is the one used for any adaptor functions objectId parameter. For retrieve_objects*() the entries are processed in longest to shortest <objectId_prefix> order. If "subdirectory" is supplied in the retrieve_objects*() adaptorSpecific parameter, only matching entries are used. Note, that depending on the vfsMap, a single physical file or directory can appear multiple times with different vfsPaths.