Package energy.eddie.aiida.services
Class ProvisioningService
java.lang.Object
energy.eddie.aiida.services.ProvisioningService
-
Constructor Summary
ConstructorsConstructorDescriptionProvisioningService(InboundAggregator inboundAggregator, PermissionRepository permissionRepository, MqttConfiguration mqttConfiguration, org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder passwordEncoder, InboundDataSourceRepository inboundDataSourceRepository, AuthService authService, SecretsService secretsService) -
Method Summary
Modifier and TypeMethodDescriptionchangeProvisioningType(UUID permissionId, ProvisioningTypePatchDto patch) Changes the provisioning type of the inbound data source associated with a permission.resetRestApiKey(UUID permissionId) Replaces the API key used to retrieve records from an inbound REST data source.resetServerModePassword(UUID permissionId)
-
Constructor Details
-
ProvisioningService
public ProvisioningService(InboundAggregator inboundAggregator, PermissionRepository permissionRepository, MqttConfiguration mqttConfiguration, org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder passwordEncoder, InboundDataSourceRepository inboundDataSourceRepository, AuthService authService, SecretsService secretsService)
-
-
Method Details
-
changeProvisioningType
public MqttProvisioningConnectionDto changeProvisioningType(UUID permissionId, ProvisioningTypePatchDto patch) throws PermissionNotFoundException, InvalidDataSourceTypeException, ProvisioningConfigurationException 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:
PermissionNotFoundExceptionInvalidDataSourceTypeExceptionProvisioningConfigurationException
-
resetServerModePassword
public MqttProvisioningConnectionDto resetServerModePassword(UUID permissionId) throws PermissionNotFoundException, InvalidDataSourceTypeException, ProvisioningTypeNotConfiguredException, ProvisioningConfigurationException -
resetRestApiKey
public RestApiKeyDto resetRestApiKey(UUID permissionId) throws PermissionNotFoundException, InvalidDataSourceTypeException, ProvisioningTypeNotConfiguredException, InvalidUserException, UnauthorizedException, SecretStoringException Replaces the API key used to retrieve records from an inbound REST data source. The plaintext key is only returned by this call; subsequent permission responses expose neither it nor its keystore alias.- Parameters:
permissionId- ID of the permission whose REST API key should be rotated.- Returns:
- The newly generated plaintext API key.
- Throws:
PermissionNotFoundExceptionInvalidDataSourceTypeExceptionProvisioningTypeNotConfiguredExceptionInvalidUserExceptionUnauthorizedExceptionSecretStoringException
-