Interface ConfigurationRestService
- All Known Implementing Classes:
ConfigurationRestServiceImpl
@Produces("application/json")
public interface ConfigurationRestService
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsecreateConfiguration(CreateConfigurationDto configurationDto, jakarta.ws.rs.core.UriInfo uriInfo) Creates a new configuration entry.voiddeleteConfiguration(String configurationId) Soft-deletes an active configuration by marking itINACTIVE.getConfiguration(String configurationId) Returns a configuration by id.getConfigurations(String tenantId, Boolean includeInactive) Returns the configurations applicable to a tenant.updateConfiguration(String configurationId, UpdateConfigurationDto configurationDto) Updates an active configuration by creating a new version.
-
Field Details
-
PATH
- See Also:
-
-
Method Details
-
createConfiguration
@POST @Consumes("application/json") @Produces("application/json") jakarta.ws.rs.core.Response createConfiguration(CreateConfigurationDto configurationDto, @Context jakarta.ws.rs.core.UriInfo uriInfo) Creates a new configuration entry.If
tenantIdis omitted or blank the entry is treated as a global configuration applicable to all tenants. A duplicate(configKey, tenantId)combination withSTATUS_=ACTIVEresults in a409 Conflict.- Parameters:
configurationDto- the create request containingconfigKey,configValueand an optionaltenantIduriInfo- JAX-RS URI context used to build theLocationheader- Returns:
201 Createdwith the persisted configuration and aLocationheader pointing to the new resource
-
getConfigurations
@GET List<ConfigurationDto> getConfigurations(@QueryParam("tenantId") String tenantId, @QueryParam("includeInactive") Boolean includeInactive) Returns the configurations applicable to a tenant. IftenantIdis 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. WithincludeInactive=true, all global and tenant entries of every status are returned without merging.- Parameters:
tenantId- optional tenant scopeincludeInactive- whether to include inactive configurations- Returns:
- configurations applicable to the requested scope
-
getConfiguration
@GET @Path("/{configurationId}") ConfigurationDto getConfiguration(@PathParam("configurationId") String configurationId) Returns a configuration by id.- Parameters:
configurationId- the configuration id- Returns:
- the configuration
-
updateConfiguration
@PUT @Path("/{configurationId}") @Consumes("application/json") ConfigurationDto updateConfiguration(@PathParam("configurationId") String configurationId, UpdateConfigurationDto configurationDto) Updates an active configuration by creating a new version.The existing entry is marked
INACTIVEand a newACTIVEentry with the same key and tenant scope and an incremented version is created.- Parameters:
configurationId- the id of the active configuration to updateconfigurationDto- the update request containing the newconfigValue- Returns:
- the newly created active configuration version
-
deleteConfiguration
@DELETE @Path("/{configurationId}") void deleteConfiguration(@PathParam("configurationId") String configurationId) Soft-deletes an active configuration by marking itINACTIVE.- Parameters:
configurationId- the id of the active configuration to delete
-