Package energy.eddie.aiida.services
Class DataSourceService
java.lang.Object
energy.eddie.aiida.services.DataSourceService
-
Constructor Summary
ConstructorsConstructorDescriptionDataSourceService(DataSourceRepository repository, Aggregator aggregator, AuthService authService, MqttConfiguration mqttConfiguration, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder bCryptPasswordEncoder, SinapsiAlfaConfiguration sinapsiAlfaConfiguration, AiidaEventPublisher aiidaEventPublisher) -
Method Summary
Modifier and TypeMethodDescriptioncreateInboundDataSource(Permission permission) dataSourceByIdOrThrow(UUID dataSourceId) voiddeleteDataSource(UUID dataSourceId) Optional<DataSourceAdapter<? extends DataSource>> findDataSourceAdapter(Predicate<DataSourceAdapter<? extends DataSource>> predicate) Optional<DataSourceAdapter<? extends DataSource>> findDataSourceAdapter(UUID dataSourceId) regenerateSecrets(UUID dataSourceId) voidstartDataSource(DataSource dataSource) voidvoidupdateEnabledState(UUID dataSourceId, boolean enabled)
-
Constructor Details
-
DataSourceService
@Autowired public DataSourceService(DataSourceRepository repository, Aggregator aggregator, AuthService authService, MqttConfiguration mqttConfiguration, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder bCryptPasswordEncoder, SinapsiAlfaConfiguration sinapsiAlfaConfiguration, AiidaEventPublisher aiidaEventPublisher)
-
-
Method Details
-
startDataSources
@EventListener(org.springframework.context.event.ContextRefreshedEvent.class) public void startDataSources() -
startDataSource
- Throws:
ModbusConnectionException
-
dataSourceByIdOrThrow
- Throws:
DataSourceNotFoundException
-
getOutboundDataSourceTypes
-
getInboundDataSources
- Throws:
InvalidUserException
-
getOutboundDataSources
- Throws:
InvalidUserException
-
addDataSource
public DataSourceSecretsDto addDataSource(DataSourceDto dto) throws InvalidUserException, SinapsiAlflaEmptyConfigException -
deleteDataSource
-
updateDataSource
public DataSource updateDataSource(DataSourceDto dto) throws ModbusConnectionException, DataSourceNotFoundException -
updateEnabledState
public void updateEnabledState(UUID dataSourceId, boolean enabled) throws DataSourceNotFoundException - Throws:
DataSourceNotFoundException
-
regenerateSecrets
public DataSourceSecretsDto regenerateSecrets(UUID dataSourceId) throws DataSourceNotFoundException, DataSourceSecretGenerationNotSupportedException -
findDataSourceAdapter
-
findDataSourceAdapter
public Optional<DataSourceAdapter<? extends DataSource>> findDataSourceAdapter(Predicate<DataSourceAdapter<? extends DataSource>> predicate) -
createInboundDataSource
-