Class UmaResourcesResource
- java.lang.Object
-
- io.jans.configapi.core.rest.BaseResource
-
- io.jans.configapi.rest.resource.auth.ConfigBaseResource
-
- io.jans.configapi.rest.resource.auth.UmaResourcesResource
-
@Path("/uma/resources") @Consumes("application/json") @Produces("application/json") public class UmaResourcesResource extends ConfigBaseResource- Author:
- Mougang T.Gasmyr
-
-
Constructor Summary
Constructors Constructor Description UmaResourcesResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.ws.rs.core.ResponsecreateUmaResource(@Valid io.jans.as.model.uma.persistence.UmaResource umaResource)Create a new UMA resource and persist it.jakarta.ws.rs.core.ResponsedeleteUmaResource(@NotNull String id)Deletes the UMA resource identified by the given id.jakarta.ws.rs.core.ResponsefetchUmaResources(int limit, String pattern, int startIndex, String sortBy, String sortOrder, String fieldValuePair)Retrieve a paged list of UMA resources matching the given search criteria.jakarta.ws.rs.core.ResponsegetUmaResourceByAssociatedClient(@NotNull String associatedClientId)Fetches UMA resources associated with a given client identifier.jakarta.ws.rs.core.ResponsegetUmaResourceByInum(@NotNull String id)Retrieve an UMA resource by its identifier.jakarta.ws.rs.core.ResponsepatchResource(@NotNull String id, @NotNull String pathString)Apply a JSON Patch document to an existing UMA resource identified by its id.jakarta.ws.rs.core.ResponseupdateUmaResource(@Valid io.jans.as.model.uma.persistence.UmaResource resource)Update an existing UMA resource.-
Methods inherited from class io.jans.configapi.rest.resource.auth.ConfigBaseResource
getMaxCount
-
Methods inherited from class io.jans.configapi.core.rest.BaseResource
checkNotEmpty, checkNotEmpty, checkNotNull, checkNotNull, checkNotNull, checkResourceNotNull, createSearchRequest, findRootError, getBadRequestException, getBadRequestException, getBadRequestException, getHttpHeaders, getHttpRequest, getInternalServerException, getInternalServerException, getMissingAttributeError, getNotAcceptableException, getNotFoundError, getNotFoundError, getUriInfo, throwBadRequestException, throwBadRequestException, throwBadRequestException, throwInternalServerException, throwInternalServerException, throwInternalServerException, throwInternalServerException, throwMissingAttributeError, throwNotFoundException, throwNotFoundException
-
-
-
-
Method Detail
-
fetchUmaResources
@GET public jakarta.ws.rs.core.Response fetchUmaResources(@DefaultValue("50") @QueryParam("limit") int limit, @DefaultValue("") @QueryParam("pattern") String pattern, @DefaultValue("0") @QueryParam("startIndex") int startIndex, @DefaultValue("inum") @QueryParam("sortBy") String sortBy, @DefaultValue("ascending") @QueryParam("sortOrder") String sortOrder, @DefaultValue("") @QueryParam("fieldValuePair") String fieldValuePair)Retrieve a paged list of UMA resources matching the given search criteria.- Parameters:
limit- maximum number of results to returnpattern- search pattern used to filter resourcesstartIndex- 1-based index of the first result to returnsortBy- attribute used to order the resultssortOrder- sort direction; allowed values are "ascending" and "descending"fieldValuePair- single field=value filter to apply to the search- Returns:
- a Response whose entity is a PagedResult of UmaResource objects (HTTP 200)
-
getUmaResourceByInum
@GET @Path("{id}") public jakarta.ws.rs.core.Response getUmaResourceByInum(@PathParam("id") @NotNull @NotNull String id)Retrieve an UMA resource by its identifier.- Parameters:
id- the UMA resource identifier (inum)- Returns:
- the UMA resource with the given id
- Throws:
jakarta.ws.rs.NotFoundException- if no UMA resource exists for the given id
-
getUmaResourceByAssociatedClient
@GET @Path("/clientId/{clientId}") public jakarta.ws.rs.core.Response getUmaResourceByAssociatedClient(@PathParam("clientId") @NotNull @NotNull String associatedClientId)Fetches UMA resources associated with a given client identifier.- Parameters:
associatedClientId- the client identifier whose UMA resources will be returned- Returns:
- a Response whose entity is a list of UmaResource objects serialized as JSON
-
createUmaResource
@POST public jakarta.ws.rs.core.Response createUmaResource(@Valid @Valid io.jans.as.model.uma.persistence.UmaResource umaResource)Create a new UMA resource and persist it. Validates that the resource's name and description are present, assigns a new identifier and DN, persists the resource, and returns the created resource with its id and DN populated.- Parameters:
umaResource- the UMA resource to create; must include non-null name and description- Returns:
- the created UmaResource with its generated id and DN
-
updateUmaResource
@PUT public jakarta.ws.rs.core.Response updateUmaResource(@Valid @Valid io.jans.as.model.uma.persistence.UmaResource resource)Update an existing UMA resource. Updates the stored UMA resource identified by the supplied resource's id. The provided resource must include an id; the response contains the updated UMA resource.- Parameters:
resource- the UMA resource payload; must include a valid id- Returns:
- the updated UmaResource
-
patchResource
@PATCH @Consumes("application/json-patch+json") @Path("{id}") public jakarta.ws.rs.core.Response patchResource(@PathParam("id") @NotNull @NotNull String id, @NotNull @NotNull String pathString) throws com.github.fge.jsonpatch.JsonPatchException, IOExceptionApply a JSON Patch document to an existing UMA resource identified by its id.- Parameters:
id- the identifier of the UMA resource to patchpathString- a JSON Patch document (as a JSON string) to apply to the resource- Returns:
- a Response containing the patched UmaResource with HTTP 200 OK
- Throws:
com.github.fge.jsonpatch.JsonPatchException- if the patch document cannot be applied to the resourceIOException- if the patch document cannot be read or parsed
-
deleteUmaResource
@DELETE @Path("{id}") public jakarta.ws.rs.core.Response deleteUmaResource(@PathParam("id") @NotNull @NotNull String id)Deletes the UMA resource identified by the given id.- Parameters:
id- the identifier of the UMA resource to delete- Returns:
- HTTP 204 No Content response when the resource is successfully deleted
-
-