|
Fabric 0.2.0
|
The CapabilityClient class in Fabric is responsible for all interactions with the capabilities2 server. It manages service clients for querying available capabilities, establishing bonds, allocating and freeing capabilities, connecting them according to the plan, and triggering execution.
| Method | Purpose | Related Capability Service |
|---|---|---|
initialize(node) | Set up service clients, read service names from capability_client.services.*, and wait for each service to become available | (all services below) |
getInterfaces(capabilities) | Query all available interfaces and populate the list | /capabilities/get_interfaces |
getSemanticInterfaces(capabilities) | Query and append semantic interfaces for each capability | /capabilities/get_semantic_interfaces |
getProviders(capabilities) | Query and set providers and alternatives for each capability | /capabilities/get_providers |
request_bond() | Establish a bond with the server and return the bond ID | /capabilities/establish_bond |
use_capabilities(plan) | Request allocation of all capabilities in the plan | /capabilities/use_capability |
free_capabilities(plan) | Free all started capabilities in the plan | /capabilities/free_capability |
connect_capabilities(plan) | Configure connections between capabilities as per the plan | /capabilities/connect_capability |
trigger_first_node(plan) | Trigger the first capability in the plan to start execution | /capabilities/trigger_capability |
CapabilityClient at startup.initialize(node) sets up all service clients and waits for them to become available.getInterfaces() and getProviders() populate the list of capabilities and their providers.request_bond() establishes a bond for the plan.use_capabilities(plan) allocates all required capabilities.connect_capabilities(plan) configures the event-driven connections between capabilities.trigger_first_node(plan) starts the plan execution.free_capabilities(plan) releases all used capabilities.fabric::fabric_exception on failure.capability_client.service_wait_timeout_sec.The CapabilityClient is a central component for orchestrating the dynamic allocation, connection, and management of capabilities in Fabric, ensuring robust and flexible plan execution.