Search in sources :

Example 46 with ListResponse

use of io.jans.scim.model.scim2.ListResponse in project jans by JanssenProject.

the class ResourceTypeWS method serve.

@GET
@Produces(MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT)
@HeaderParam("Accept")
@DefaultValue(MEDIA_TYPE_SCIM_JSON)
@RejectFilterParam
public Response serve() {
    try {
        ListResponse listResponse = new ListResponse(1, 4, 4);
        listResponse.addResource(getUserResourceType());
        listResponse.addResource(getGroupResourceType());
        listResponse.addResource(getFidoDeviceResourceType());
        listResponse.addResource(getFido2DeviceResourceType());
        String json = resourceSerializer.getListResponseMapper().writeValueAsString(listResponse);
        return Response.ok(json).location(new URI(endpointUrl)).build();
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        return getErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, "Unexpected error: " + e.getMessage());
    }
}
Also used : ListResponse(io.jans.scim.model.scim2.ListResponse) URI(java.net.URI) DefaultValue(javax.ws.rs.DefaultValue) HeaderParam(javax.ws.rs.HeaderParam) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) RejectFilterParam(io.jans.scim.service.scim2.interceptor.RejectFilterParam)

Aggregations

Response (javax.ws.rs.core.Response)38 ListResponse (io.jans.scim.model.scim2.ListResponse)36 Test (org.testng.annotations.Test)26 UserBaseTest (io.jans.scim2.client.UserBaseTest)16 SearchRequest (io.jans.scim.model.scim2.SearchRequest)12 UserResource (io.jans.scim.model.scim2.user.UserResource)11 URI (java.net.URI)11 BaseTest (io.jans.scim2.client.BaseTest)10 ListResponse (org.gluu.oxtrust.model.scim2.ListResponse)9 DefaultValue (javax.ws.rs.DefaultValue)8 HeaderParam (javax.ws.rs.HeaderParam)8 Produces (javax.ws.rs.Produces)8 ArrayList (java.util.ArrayList)7 GET (javax.ws.rs.GET)7 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)4 BaseScimResource (io.jans.scim.model.scim2.BaseScimResource)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 SimpleModule (com.fasterxml.jackson.databind.module.SimpleModule)2 RejectFilterParam (io.jans.scim.service.scim2.interceptor.RejectFilterParam)2