xentara-plugin v2.0.4
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::process::Microservice Class Referenceabstract

deprecated Deprecated base class for microservice elements More...

#include <xentara/process/Microservice.hpp>

+ Inheritance diagram for xentara::process::Microservice:

Classes

class  FallbackConfigHandler
 A helper object used to throw exceptions for unknown configuration parameters. More...
 

Public Member Functions

virtual internal auto createSubservice (const MicroserviceClass &microserviceClass, plugin::SharedFactory< Microservice > &factory) -> std::shared_ptr< Microservice >
 Called by the framework to create a new child element of this element.
 
virtual auto resolveAttribute (std::string_view name) -> const model::Attribute *
 Called by the framework to resolve an attribute with a specific name.
 
virtual auto resolveEvent (std::string_view name) -> std::shared_ptr< process::Event >
 Called by the framework to resolve an event with a specific name.
 
virtual auto resolveTask (std::string_view name) -> std::shared_ptr< process::Task >
 Called by the framework to resolve a task with a specific name.
 
virtual auto readHandle (const model::Attribute &attribute) const noexcept -> data::ReadHandle
 Called by the framework to get a read handle for a specific attribute.
 
virtual auto writeHandle (const model::Attribute &attribute) noexcept -> data::WriteHandle
 Called by the framework to get a write handle for a specific attribute.
 
- Public Member Functions inherited from xentara::skill::Element
virtual ~Element ()=0
 Virtual destructor.
 
auto name () const -> utils::string::StringView
 Gets the name of the element.
 
auto primaryKey () const -> utils::string::StringView
 Gets the primary key of the element.
 
auto uuid () const -> utils::core::Uuid
 Gets the UUID of the element.
 
auto elementClass () const noexcept -> const Class &
 Gets the class of this element.
 
virtual auto isAttributePending (std::string_view name) const noexcept -> bool
 Callback for determining whether an attribute is not available yet due to unresolved references.
 
virtual auto isAttributePending (const utils::core::Uuid &uuid) const noexcept -> bool
 Callback for determining whether an attribute is not available yet due to unresolved references.
 
virtual auto isEventPending (std::string_view name) const noexcept -> bool
 Callback for determining whether an event is not available yet due to unresolved references.
 
virtual auto isEventPending (const utils::core::Uuid &uuid) const noexcept -> bool
 Callback for determining whether an event is not available yet due to unresolved references.
 
virtual auto isTaskPending (std::string_view name) const noexcept -> bool
 Callback for determining whether a task is not available yet due to unresolved references.
 
virtual auto isTaskPending (const utils::core::Uuid &uuid) const noexcept -> bool
 Callback for determining whether a task is not available yet due to unresolved references.
 
virtual auto isMetadataPending () const noexcept -> bool
 Callback for determining whether meta information is not available yet due to unresolved references.
 
- Public Member Functions inherited from xentara::utils::tools::DisableCopy
constexpr DisableCopy () noexcept=default
 
 DisableCopy (const DisableCopy &)=delete
 
DisableCopyoperator= (const DisableCopy &)=delete
 

Protected Types

using ConfigIntializer = memory::Initializer< memory::Array >
 Type alias for an initializer for the configuration.
 

Protected Member Functions

virtual auto loadConfig (const ConfigIntializer &initializer, utils::json::decoder::Object &jsonObject, config::Resolver &resolver, const FallbackConfigHandler &fallbackHandler) -> void=0
 Called by the framework to load the element's configuration from a JSON object.
 
auto configBlock () const noexcept -> const memory::ArrayBlock &
 Gets the memory block that the configuration is stored in.
 
- Protected Member Functions inherited from xentara::skill::Element
auto element () const noexcept -> const model::Element &
 Gets the Xentara element for this skill element.
 
auto element () noexcept -> model::Element &
 Gets the Xentara element for this skill element.
 
auto rootElement () const -> std::shared_ptr< const model::Element >
 Returns the invisible root element of the model this element belongs to.
 
auto rootElement () -> std::shared_ptr< model::Element >
 Returns the invisible root element of the model this element belongs to.
 
auto findAttribute (std::string_view primaryKey) -> model::ElementAttribute
 Finds the attribute with a specific primary key in the model this element belongs to.
 
auto findAttributeVerbose (std::string_view primaryKey) -> utils::eh::expected< model::ElementAttribute, std::string >
 Finds the attribute with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findEvent (std::string_view primaryKey) const -> std::shared_ptr< const process::Event >
 Finds the event with a specific primary key in the model this element belongs to.
 
auto findEvent (std::string_view primaryKey) -> std::shared_ptr< process::Event >
 Finds the event with a specific primary key in the model this element belongs to.
 
auto findEventVerbose (std::string_view primaryKey) const -> utils::eh::expected< std::shared_ptr< const process::Event >, std::string >
 Finds the event with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findEventVerbose (std::string_view primaryKey) -> utils::eh::expected< std::shared_ptr< process::Event >, std::string >
 Finds the event with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findExtendedEvent (std::string_view primaryKey) const -> process::ExtendedEvent
 Finds the extended event with a specific primary key in the model this element belongs to.
 
auto findExtendedEventVerbose (std::string_view primaryKey) const -> utils::eh::expected< process::ExtendedEvent, std::string >
 Finds the extended event with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findTask (std::string_view primaryKey) const -> std::shared_ptr< const process::Task >
 Finds the task with a specific primary key in the model this element belongs to.
 
auto findTask (std::string_view primaryKey) -> std::shared_ptr< process::Task >
 Finds the task with a specific primary key in the model this element belongs to.
 
auto findTaskVerbose (std::string_view primaryKey) const -> utils::eh::expected< std::shared_ptr< const process::Task >, std::string >
 Finds the task with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findTaskVerbose (std::string_view primaryKey) -> utils::eh::expected< std::shared_ptr< process::Task >, std::string >
 Finds the task with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findElement (std::string_view primaryKey) const -> std::shared_ptr< const model::Element >
 Finds the element with a specific primary key in the model this element belongs to.
 
auto findElement (std::string_view primaryKey) -> std::shared_ptr< model::Element >
 Finds the element with a specific primary key in the model this element belongs to.
 
auto findElementVerbose (std::string_view primaryKey) const -> utils::eh::expected< std::shared_ptr< const model::Element >, std::string >
 Finds the element with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findElementVerbose (std::string_view primaryKey) -> utils::eh::expected< std::shared_ptr< model::Element >, std::string >
 Finds the element with a specific primary key in the model this element belongs to, returning an error message on error.
 
auto findElement (const utils::core::Uuid &uuid) const -> std::shared_ptr< const model::Element >
 Finds the element with a specific UUID in the model this element belongs to.
 
auto findElement (const utils::core::Uuid &uuid) -> std::shared_ptr< model::Element >
 Finds the element with a specific UUID in the model this element belongs to.
 
auto securityContext () const -> const security::Context &
 Returns the security context of the element.
 
auto checkAccess (const security::Authorization &authorization, const security::Entitlement &entitlement) const -> bool
 Checks an authorization for a certain entitlement using the ACL for this element.
 

Virtual Overrides for skill::Element


auto load (utils::json::decoder::Object &jsonObject, config::Context &context) -> void final
 Virtual overide for skill::Element::load()
 
auto createChildElement (const skill::Element::Class &elementClass, skill::ElementFactory &factory) -> std::shared_ptr< skill::Element > final
 Virtual overide for skill::Element::createChildElement()
 
auto resolveAttributeByName (std::string_view name) const -> std::shared_ptr< const model::Attribute > final
 Virtual overide for skill::Element::resolveAttributeByName()
 
auto resolveAttributeByUuid (const utils::core::Uuid &uuid) const -> std::shared_ptr< const model::Attribute > final
 Virtual overide for skill::Element::resolveAttributeByUuid()
 
auto forEachAttribute (const model::ForEachAttributeFunction &function) const -> bool final
 Virtual overide for skill::Element::forEachAttribute()
 
auto resolveEventByName (std::string_view name) -> std::shared_ptr< process::Event > final
 Virtual overide for skill::Element::resolveEventByName()
 
auto resolveEventByUuid (const utils::core::Uuid &uuid) -> std::shared_ptr< process::Event > final
 Virtual overide for skill::Element::resolveEventByUuid()
 
auto forEachEvent (const model::ForEachEventFunction &function) -> bool final
 Virtual overide for skill::Element::forEachEvent()
 
auto resolveTaskByName (std::string_view name) -> std::shared_ptr< process::Task > final
 Virtual overide for skill::Element::resolveTaskByName()
 
auto resolveTaskByUuid (const utils::core::Uuid &uuid) -> std::shared_ptr< process::Task > final
 Virtual overide for skill::Element::resolveTaskByUuid()
 
auto forEachTask (const model::ForEachTaskFunction &function) -> bool final
 Virtual overide for skill::Element::forEachTask()
 
auto makeReadHandle (const model::Attribute &attribute) const noexcept -> std::optional< data::ReadHandle > final
 Virtual overide for skill::Element::makeReadHandle()
 
auto makeWriteHandle (const model::Attribute &attribute) noexcept -> std::optional< data::WriteHandle > final
 Virtual overide for skill::Element::makeReadHandle()
 
auto category () const noexcept -> model::ElementCategory final
 Virtual overide for skill::Element::category()
 

Detailed Description

deprecated Deprecated base class for microservice elements

Member Typedef Documentation

◆ ConfigIntializer

Type alias for an initializer for the configuration.

Member Function Documentation

◆ category()

auto xentara::process::Microservice::category ( ) const -> model::ElementCategory
finalprivatevirtualnoexcept

Virtual overide for skill::Element::category()

This function returns model::ElementCategory::Microservice.

Implements xentara::skill::Element.

◆ configBlock()

auto xentara::process::Microservice::configBlock ( ) const -> const memory::ArrayBlock &
protectednoexcept

Gets the memory block that the configuration is stored in.

◆ createChildElement()

auto xentara::process::Microservice::createChildElement ( const skill::Element::Class elementClass,
skill::ElementFactory factory 
) -> std::shared_ptr< skill::Element >
finalprivatevirtual

Virtual overide for skill::Element::createChildElement()

This function calls createSubservice() if elementClass is derived from MicroserviceClass, or returns nullptr otherwise.

Reimplemented from xentara::skill::Element.

◆ createSubservice()

virtual internal auto xentara::process::Microservice::createSubservice ( const MicroserviceClass microserviceClass,
plugin::SharedFactory< Microservice > &  factory 
) -> std::shared_ptr< Microservice >
virtual

Called by the framework to create a new child element of this element.

◆ forEachAttribute()

auto xentara::process::Microservice::forEachAttribute ( const model::ForEachAttributeFunction function) const -> bool
finalprivatevirtual

Virtual overide for skill::Element::forEachAttribute()

This class calls resolveAttribute() repeatedly using a list of standard attribute names.

Reimplemented from xentara::skill::Element.

◆ forEachEvent()

auto xentara::process::Microservice::forEachEvent ( const model::ForEachEventFunction function) -> bool
finalprivatevirtual

Virtual overide for skill::Element::forEachEvent()

This class calls resolveEvent() repeatedly using a list of standard event names.

Reimplemented from xentara::skill::Element.

◆ forEachTask()

auto xentara::process::Microservice::forEachTask ( const model::ForEachTaskFunction function) -> bool
finalprivatevirtual

Virtual overide for skill::Element::forEachTask()

This class calls resolveTask() repeatedly using a list of standard task names.

Reimplemented from xentara::skill::Element.

◆ load()

auto xentara::process::Microservice::load ( utils::json::decoder::Object jsonObject,
config::Context context 
) -> void
finalprivatevirtual

Virtual overide for skill::Element::load()

This function calls loadConfig() to load the element.

Reimplemented from xentara::skill::Element.

◆ loadConfig()

virtual auto xentara::process::Microservice::loadConfig ( const ConfigIntializer initializer,
utils::json::decoder::Object jsonObject,
config::Resolver resolver,
const FallbackConfigHandler fallbackHandler 
) -> void
protectedpure virtual

Called by the framework to load the element's configuration from a JSON object.

◆ makeReadHandle()

auto xentara::process::Microservice::makeReadHandle ( const model::Attribute attribute) const -> std::optional< data::ReadHandle >
finalprivatevirtualnoexcept

Virtual overide for skill::Element::makeReadHandle()

This function calls readHandle(), but returns std::nullopt if readHandle() returns data::ReadHandle::Error::Unknown.

Reimplemented from xentara::skill::Element.

◆ makeWriteHandle()

auto xentara::process::Microservice::makeWriteHandle ( const model::Attribute attribute) -> std::optional< data::WriteHandle >
finalprivatevirtualnoexcept

Virtual overide for skill::Element::makeReadHandle()

This function calls writeHandle(), but returns std::nullopt if writeHandle() returns data::WriteHandle::Error::Unknown.

Reimplemented from xentara::skill::Element.

◆ readHandle()

virtual auto xentara::process::Microservice::readHandle ( const model::Attribute attribute) const -> data::ReadHandle
virtualnoexcept

Called by the framework to get a read handle for a specific attribute.

◆ resolveAttribute()

virtual auto xentara::process::Microservice::resolveAttribute ( std::string_view  name) -> const model::Attribute *
virtual

Called by the framework to resolve an attribute with a specific name.

◆ resolveAttributeByName()

auto xentara::process::Microservice::resolveAttributeByName ( std::string_view  name) const -> std::shared_ptr< const model::Attribute >
finalprivatevirtual

Virtual overide for skill::Element::resolveAttributeByName()

This function just calls resolveAttribute()

Reimplemented from xentara::skill::Element.

◆ resolveAttributeByUuid()

auto xentara::process::Microservice::resolveAttributeByUuid ( const utils::core::Uuid uuid) const -> std::shared_ptr< const model::Attribute >
finalprivatevirtual

Virtual overide for skill::Element::resolveAttributeByUuid()

This function calls resolveAttribute(), selecting a name taken from a list of standard attribute UUIDs.

Reimplemented from xentara::skill::Element.

◆ resolveEvent()

virtual auto xentara::process::Microservice::resolveEvent ( std::string_view  name) -> std::shared_ptr< process::Event >
virtual

Called by the framework to resolve an event with a specific name.

◆ resolveEventByName()

auto xentara::process::Microservice::resolveEventByName ( std::string_view  name) -> std::shared_ptr< process::Event >
finalprivatevirtual

Virtual overide for skill::Element::resolveEventByName()

This function just calls resolveEvent()

Reimplemented from xentara::skill::Element.

◆ resolveEventByUuid()

auto xentara::process::Microservice::resolveEventByUuid ( const utils::core::Uuid uuid) -> std::shared_ptr< process::Event >
finalprivatevirtual

Virtual overide for skill::Element::resolveEventByUuid()

This function calls resolveEvent(), selecting a name taken from a list of standard event UUIDs.

Reimplemented from xentara::skill::Element.

◆ resolveTask()

virtual auto xentara::process::Microservice::resolveTask ( std::string_view  name) -> std::shared_ptr< process::Task >
virtual

Called by the framework to resolve a task with a specific name.

◆ resolveTaskByName()

auto xentara::process::Microservice::resolveTaskByName ( std::string_view  name) -> std::shared_ptr< process::Task >
finalprivatevirtual

Virtual overide for skill::Element::resolveTaskByName()

This function just calls resolveAttribute()

Reimplemented from xentara::skill::Element.

◆ resolveTaskByUuid()

auto xentara::process::Microservice::resolveTaskByUuid ( const utils::core::Uuid uuid) -> std::shared_ptr< process::Task >
finalprivatevirtual

Virtual overide for skill::Element::resolveTaskByUuid()

This function calls resolveTask(), selecting a name taken from a list of standard task UUIDs.

Reimplemented from xentara::skill::Element.

◆ writeHandle()

virtual auto xentara::process::Microservice::writeHandle ( const model::Attribute attribute) -> data::WriteHandle
virtualnoexcept

Called by the framework to get a write handle for a specific attribute.