Class ConfigurationRestServiceImpl

java.lang.Object
org.finos.fluxnova.bpm.engine.rest.impl.AbstractRestProcessEngineAware
org.finos.fluxnova.bpm.engine.rest.impl.ConfigurationRestServiceImpl
All Implemented Interfaces:
ConfigurationRestService

public class ConfigurationRestServiceImpl extends AbstractRestProcessEngineAware implements ConfigurationRestService
  • Constructor Details

    • ConfigurationRestServiceImpl

      public ConfigurationRestServiceImpl(String engineName, tools.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • createConfiguration

      public jakarta.ws.rs.core.Response createConfiguration(CreateConfigurationDto configurationDto, jakarta.ws.rs.core.UriInfo uriInfo)
      Description copied from interface: ConfigurationRestService
      Creates a new configuration entry.

      If tenantId is omitted or blank the entry is treated as a global configuration applicable to all tenants. A duplicate (configKey, tenantId) combination with STATUS_=ACTIVE results in a 409 Conflict.

      Specified by:
      createConfiguration in interface ConfigurationRestService
      Parameters:
      configurationDto - the create request containing configKey, configValue and an optional tenantId
      uriInfo - JAX-RS URI context used to build the Location header
      Returns:
      201 Created with the persisted configuration and a Location header pointing to the new resource
    • getConfigurations

      public List<ConfigurationDto> getConfigurations(String tenantId, Boolean includeInactive)
      Description copied from interface: ConfigurationRestService
      Returns the configurations applicable to a tenant. If tenantId is omitted or blank, the global default configurations are returned. For a tenant, active global configurations are returned with the tenant's active entries overriding global entries of the same key. With includeInactive=true, all global and tenant entries of every status are returned without merging.
      Specified by:
      getConfigurations in interface ConfigurationRestService
      Parameters:
      tenantId - optional tenant scope
      includeInactive - whether to include inactive configurations
      Returns:
      configurations applicable to the requested scope
    • getConfiguration

      public ConfigurationDto getConfiguration(String configurationId)
      Description copied from interface: ConfigurationRestService
      Returns a configuration by id.
      Specified by:
      getConfiguration in interface ConfigurationRestService
      Parameters:
      configurationId - the configuration id
      Returns:
      the configuration
    • updateConfiguration

      public ConfigurationDto updateConfiguration(String configurationId, UpdateConfigurationDto configurationDto)
      Description copied from interface: ConfigurationRestService
      Updates an active configuration by creating a new version.

      The existing entry is marked INACTIVE and a new ACTIVE entry with the same key and tenant scope and an incremented version is created.

      Specified by:
      updateConfiguration in interface ConfigurationRestService
      Parameters:
      configurationId - the id of the active configuration to update
      configurationDto - the update request containing the new configValue
      Returns:
      the newly created active configuration version
    • deleteConfiguration

      public void deleteConfiguration(String configurationId)
      Description copied from interface: ConfigurationRestService
      Soft-deletes an active configuration by marking it INACTIVE.
      Specified by:
      deleteConfiguration in interface ConfigurationRestService
      Parameters:
      configurationId - the id of the active configuration to delete
    • trimToNull

      protected static String trimToNull(String value)
    • isConfigurationUniqueConstraintViolation

      protected static boolean isConfigurationUniqueConstraintViolation(ProcessEngineException exception)
    • containsMessage

      protected static boolean containsMessage(Throwable throwable, String value)
    • getScopeDescription

      protected static String getScopeDescription(String tenantId)