Batch system config update (#1402)

* Added an endpoint for batch update of system configurations

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* batch db save

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* Review changes and added tests

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* Evict cache only if transaction is commited - such as @CacheEvict

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* refactoring

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* Using AfterTransactionCommitExecutor for cache eviction

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* Change request body

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

---------

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>
This commit is contained in:
Denislav Prinov
2023-08-02 11:15:27 +03:00
committed by GitHub
parent 1dc1bdbe94
commit fb30999d73
7 changed files with 201 additions and 28 deletions

View File

@@ -9,6 +9,7 @@
package org.eclipse.hawkbit.repository;
import java.io.Serializable;
import java.util.Map;
import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions;
import org.eclipse.hawkbit.repository.model.TenantConfiguration;
@@ -44,6 +45,22 @@ public interface TenantConfigurationManagement {
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION)
<T extends Serializable> TenantConfigurationValue<T> addOrUpdateConfiguration(String configurationKeyName, T value);
/**
* Adds or updates a specific configuration for a specific tenant.
*
*
* @param configurations
* map containing the key - value of the configuration
* @return map of all configuration values which were written into the database.
* @throws TenantConfigurationValidatorException
* if the {@code propertyType} and the value in general does not
* match the expected type and format defined by the Key
* @throws ConversionFailedException
* if the property cannot be converted to the given
*/
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION)
<T extends Serializable> Map<String, TenantConfigurationValue<T>> addOrUpdateConfiguration(Map<String, T> configurations);
/**
* Build the tenant configuration by the given key
*