Class OperationProvider

Class Documentation

class OperationProvider

Provider interface for entity operations.

Typed provider interface for plugins that serve SOVD operations (GET /{entity_type}/{id}/operations, POST /{entity_type}/{id}/operations/{name}). Per-entity routing like DataProvider.

See also

GatewayPlugin for the base class all plugins must also implement

See also

DataProvider for the data counterpart

Thread safety

All methods may be called concurrently. Implementations must synchronize.

Public Functions

virtual ~OperationProvider() = default
virtual tl::expected<nlohmann::json, OperationProviderErrorInfo> list_operations(const std::string &entity_id) = 0

List available operations for an entity

Parameters:

entity_id – SOVD entity ID

Returns:

JSON with {“items”: […]} array of operation descriptors

inline virtual tl::expected<nlohmann::json, OperationProviderErrorInfo> get_operation(const std::string &entity_id, const std::string &operation_name)

Get a specific operation by name

Note

Default implementation calls list_operations + linear scan. Override for O(1) lookup in plugins with many operations.

Parameters:
  • entity_id – SOVD entity ID

  • operation_name – Operation name

Returns:

JSON with operation detail, or OperationNotFound error

virtual tl::expected<nlohmann::json, OperationProviderErrorInfo> execute_operation(const std::string &entity_id, const std::string &operation_name, const nlohmann::json &parameters) = 0

Execute an operation

Parameters:
  • entity_id – SOVD entity ID

  • operation_name – Operation name (e.g., “session_control”)

  • parameters – JSON parameters from request body

Returns:

JSON response body with operation result