Class CustomScriptResource
- java.lang.Object
-
- io.jans.configapi.core.rest.BaseResource
-
- io.jans.configapi.rest.resource.auth.ConfigBaseResource
-
- io.jans.configapi.rest.resource.auth.CustomScriptResource
-
@Path("/config/scripts") @Consumes("application/json") @Produces("application/json") public class CustomScriptResource extends ConfigBaseResource
-
-
Field Summary
-
Fields inherited from class io.jans.configapi.rest.resource.auth.ConfigBaseResource
DEFAULT_LIST_SIZE, DEFAULT_LIST_START_INDEX, DEFAULT_MAX_COUNT, READ_ACCESS, WRITE_ACCESS
-
-
Constructor Summary
Constructors Constructor Description CustomScriptResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.ws.rs.core.Response
createScript(@Valid io.jans.model.custom.script.model.CustomScript customScript)
Method to create a new custom scriptjakarta.ws.rs.core.Response
deleteScript(@NotNull String inum)
Method to delete custom scriptjakarta.ws.rs.core.Response
getAllCustomScripts()
Method to fetch a custom scriptsjakarta.ws.rs.core.Response
getCustomScriptByInum(@NotNull String inum)
Method to fetch a custom script by identifier - inumjakarta.ws.rs.core.Response
getCustomScriptsByTypePattern(@NotNull String type, String pattern, int limit)
Method to fetch a custom script by typejakarta.ws.rs.core.Response
patchAtribute(@NotNull String inum, @NotNull String pathString)
Method to patch custom scriptjakarta.ws.rs.core.Response
updateScript(@Valid @NotNull io.jans.model.custom.script.model.CustomScript customScript)
Method to update custom script-
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, checkResourceNotNull, createSearchRequest, getBadRequestException, getInternalServerException, getMissingAttributeError, getNotAcceptableException, getNotFoundError, thorwBadRequestException, thorwInternalServerException, throwMissingAttributeError
-
-
-
-
Method Detail
-
getAllCustomScripts
@GET public jakarta.ws.rs.core.Response getAllCustomScripts()
Method to fetch a custom scripts- Parameters:
type
- - type of the script- Throws:
jakarta.ws.rs.NotAuthorizedException
-
getCustomScriptsByTypePattern
@GET @Path("/type/{type}") public jakarta.ws.rs.core.Response getCustomScriptsByTypePattern(@PathParam("type") @NotNull @NotNull String type, @DefaultValue("") @QueryParam("pattern") String pattern, @DefaultValue("50") @QueryParam("limit") int limit)
Method to fetch a custom script by type- Parameters:
type
- - type of the script- Returns:
- - List of CustomScript object
- Throws:
jakarta.ws.rs.NotAuthorizedException
-
getCustomScriptByInum
@GET @Path("/inum/{inum}") public jakarta.ws.rs.core.Response getCustomScriptByInum(@PathParam("inum") @NotNull @NotNull String inum)
Method to fetch a custom script by identifier - inum- Parameters:
inum
- - unique identifier of the script- Returns:
- - CustomScript object
- Throws:
jakarta.ws.rs.NotAuthorizedException
-
createScript
@POST public jakarta.ws.rs.core.Response createScript(@Valid @Valid io.jans.model.custom.script.model.CustomScript customScript)
Method to create a new custom script- Parameters:
customScript
- - CustomScript object- Returns:
- - CustomScript object
- Throws:
jakarta.ws.rs.NotAuthorizedException
-
updateScript
@PUT public jakarta.ws.rs.core.Response updateScript(@Valid @NotNull @Valid @NotNull io.jans.model.custom.script.model.CustomScript customScript)
Method to update custom script- Parameters:
customScript
- - CustomScript object- Returns:
- - CustomScript object
- Throws:
jakarta.ws.rs.NotAuthorizedException
jakarta.ws.rs.NotFoundException
-
deleteScript
@DELETE @Path("{inum}") public jakarta.ws.rs.core.Response deleteScript(@PathParam("inum") @NotNull @NotNull String inum)
Method to delete custom script- Parameters:
inum
- - unique identifier of the script- Returns:
- Throws:
jakarta.ws.rs.NotAuthorizedException
-
patchAtribute
@PATCH @Consumes("application/json-patch+json") @Path("{inum}") public jakarta.ws.rs.core.Response patchAtribute(@PathParam("inum") @NotNull @NotNull String inum, @NotNull @NotNull String pathString) throws com.github.fge.jsonpatch.JsonPatchException, IOException
Method to patch custom script- Parameters:
inum
- - unique identifier of the scriptpathString
- - A JSON Patch JSON file containing an array of patch operations.- Returns:
- - CustomScript object
- Throws:
jakarta.ws.rs.NotAuthorizedException
jakarta.ws.rs.NotFoundException
com.github.fge.jsonpatch.JsonPatchException
IOException
-
-