opyenxes.extension package¶
Subpackages¶
- opyenxes.extension.std package
- Submodules
- opyenxes.extension.std.XAbstractNestedAttributeSupport module
- opyenxes.extension.std.XConceptExtension module
- opyenxes.extension.std.XCostExtension module
- opyenxes.extension.std.XExtendedEvent module
- opyenxes.extension.std.XIdentityExtension module
- opyenxes.extension.std.XLifecycleExtension module
- opyenxes.extension.std.XMicroExtension module
- opyenxes.extension.std.XOrganizationalExtension module
- opyenxes.extension.std.XSemanticExtension module
- opyenxes.extension.std.XTimeExtension module
- Module contents
Submodules¶
opyenxes.extension.XExtension module¶
-
class
opyenxes.extension.XExtension.
XExtension
(name, prefix, uri)[source]¶ Bases:
object
This class defines and implements extensions to the basic log meta-model. Extensions have a name, a defined prefix, and a unique URI. They can define additional, typed attributes on the level of the log, trace, and event. Also, extensions may define meta attributes
Parameters: - name (str) – The name of the extension.
- prefix (str) – Prefix string of the extension, used for addressing attributes.
- uri (urllib.parse.ParseResult or urllib.parse.SplitResult) – Unique URI of the extension. This URI should point to the file defining the extension, and must be able to be resolved. Extension files should be accessible over the internet, e.g. stored on web servers.
-
get_defined_attributes
()[source]¶ Returns the collection of attributes defined by this extension for any log elements (archive-, log-, trace-, event-, and meta-attributes).
Returns: The collection of attributes defined by this extension Return type: set
-
get_event_attributes
()[source]¶ Returns the collection of attributes defined by this extension for event elements.
Returns: The collection of attributes for event elements Return type: set
-
get_log_attributes
()[source]¶ Returns the collection of attributes defined by this extension for log elements.
Returns: the collection of attributes for log elements Return type: set
-
get_meta_attributes
()[source]¶ Return the collection of meta-attributes defined by this extension for attributes.
Returns: The collection of meta-attributes for attributes. Return type: set
-
get_name
()[source]¶ Returns the human-readable name of this extension.
Returns: The name of this extension. Return type: str
-
get_prefix
()[source]¶ Returns a unique prefix associated with this extension. This prefix should be no longer than 5 characters, so as not to unnecessarily blow up storage files.
Returns: An unique prefix associated with this extension Return type: str
-
get_trace_attributes
()[source]¶ Returns the collection of attributes defined by this extension for trace elements.
Returns: the collection of attributes for trace elements Return type: set
-
get_uri
()[source]¶ Returns a unique URI associated with this extension. This URI should point to the file defining the extension, and must be able to be resolved. Extension files should be accessible over the internet, e.g. stored on web servers.
Returns: An unique URI associated with this extension Return type: urllib.parse.ParseResult or urllib.parse.SplitResult
opyenxes.extension.XExtensionManager module¶
-
class
opyenxes.extension.XExtensionManager.
XExtensionManager
[source]¶ Bases:
object
The extension manager is used to access, store, and manage extensions in a system. Extensions can be loaded from their given URI, which should point to the file defining the extension. Also, extensions can be registered locally, which then override any remotely-loaded extensions (which are more generic placeholders). Extension files downloaded from remote sources (which happens when the extension cannot be resolved locally) are cached on the local system, so that the network source of extension files is not put under extensive stress. The extension manager is a singleton, there is no need to instantiate more than one extension manager, which is necessary to avoid states of inconsistency.
Uses the singleton metaclass
-
static
cache_extension
(uri)[source]¶ Downloads and caches an extension from its remote definition file. The extension is subsequently placed in the local cache, so that future loading is accelerated.
Parameters: uri (urllib.parse.ParseResult or urllib.parse.SplitResult) – Unique URI of the extension which is to be cached.
-
get_by_index
(index)[source]¶ Retrieves an extension by ints index. If no extension with the given index is found, this method returns null.
Parameters: index (int) – The index of the requested extension. Returns: The requested extension (may be null, if it cannot be found). Return type: XExtension
-
get_by_name
(name)[source]¶ Retrieves an extension by its name. If no extension by that name can be found, this method returns null.
Parameters: name (str) – The name of the requested extension. Returns: The requested extension (may be null, if it cannot be found). Return type: XExtension
-
get_by_prefix
(prefix)[source]¶ Retrieves an extension by its prefix. If no extension by that prefix can be found, this method returns null.
Parameters: prefix (str) – The prefix of the requested extension. Returns: The requested extension (may be null, if it cannot be found). Return type: XExtension
-
get_by_uri
(uri)[source]¶ Retrieves an extension instance by its unique URI. If the extension has not been registered before, it is looked up in the local cache. If it cannot be found in the cache, the manager attempts to download it from its unique URI, and add it to the set of managed extensions.
Parameters: uri (urllib.parse.ParseResult or urllib.parse.SplitResult) – The unique URI of the requested extension. Returns: The requested extension. Return type: XExtension
-
get_index
(extension)[source]¶ Resolves the index of an extension, given that this extension has been previously registered with this manager instance. If the given index has not been registered previously, this method returns -1.
Parameters: extension (XExtension) – The extension to look up the index for. Returns: Unique index of the requested extension (positive integer). Return type: int
-
load_extension_cache
()[source]¶ Loads all extensions stored in the local cache. Cached extensions which exceed the maximum caching age are discarded, and downloaded freshly.
-
static
opyenxes.extension.XExtensionParser module¶
-
class
opyenxes.extension.XExtensionParser.
XExtensionParser
[source]¶ Bases:
object
Parser for extension definition files.
Uses the singleton metaclass
-
class
XExtensionHandler
[source]¶ Bases:
xml.sax.handler.ContentHandler
SAX handler class for extension definition files.
-
endElement
(local_name)[source]¶ Overrides endElement in class ContentHandler
Parameters: local_name (str) – The name of the element type, just as with the startElement event
-
-
class