Class ProvisioningService

java.lang.Object
energy.eddie.aiida.services.ProvisioningService

@Service public class ProvisioningService extends Object
  • Constructor Details

    • ProvisioningService

      public ProvisioningService(InboundAggregator inboundAggregator, PermissionRepository permissionRepository, MqttConfiguration mqttConfiguration, org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder passwordEncoder, InboundDataSourceRepository inboundDataSourceRepository)
      Creates a service that manages provisioning configuration and MQTT publishers for inbound data sources.
      Parameters:
      inboundAggregator - Aggregator whose inbound records are forwarded to active provisioning publishers.
      permissionRepository - Repository used to resolve the permission and its inbound data source.
      mqttConfiguration - MQTT broker configuration used for server-mode provisioning.
      passwordEncoder - Encoder used to store server-mode MQTT credentials securely.
      inboundDataSourceRepository - Repository used to restore persisted MQTT provisioning publishers.
  • Method Details

    • changeProvisioningType

      Changes the provisioning type of the inbound data source associated with a permission. MQTT modes establish a connection and replace the active publisher, while REST modes stop any active publisher and clear the MQTT provisioning configuration.
      Parameters:
      permissionId - ID of the permission whose inbound data source should be reconfigured.
      patch - Requested provisioning type and, for MQTT client mode, its connection parameters.
      Returns:
      Connection details for MQTT provisioning, or an empty DTO for REST provisioning.
      Throws:
      PermissionNotFoundException - If no permission exists for permissionId.
      InvalidDataSourceTypeException - If the permission is not associated with an inbound data source.