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());
}
}
Aggregations