1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.ext.scimv2.api.service;
20
21 import javax.validation.constraints.NotNull;
22 import javax.ws.rs.Consumes;
23 import javax.ws.rs.DELETE;
24 import javax.ws.rs.GET;
25 import javax.ws.rs.POST;
26 import javax.ws.rs.PUT;
27 import javax.ws.rs.Path;
28 import javax.ws.rs.PathParam;
29 import javax.ws.rs.Produces;
30 import javax.ws.rs.QueryParam;
31 import javax.ws.rs.core.Response;
32 import org.apache.cxf.jaxrs.ext.PATCH;
33 import org.apache.syncope.ext.scimv2.api.SCIMConstants;
34 import org.apache.syncope.ext.scimv2.api.data.ListResponse;
35 import org.apache.syncope.ext.scimv2.api.data.SCIMPatchOp;
36 import org.apache.syncope.ext.scimv2.api.data.SCIMResource;
37 import org.apache.syncope.ext.scimv2.api.data.SCIMSearchRequest;
38 import org.apache.syncope.ext.scimv2.api.type.SortOrder;
39
40 public interface SCIMResourceService<R extends SCIMResource> {
41
42 @GET
43 @Path("{id}")
44 @Produces({ SCIMConstants.APPLICATION_SCIM_JSON })
45 R get(@NotNull @PathParam("id") String id,
46 @QueryParam("attributes") String attributes,
47 @QueryParam("excludedAttributes") String excludedAttributes);
48
49 @GET
50 @Produces({ SCIMConstants.APPLICATION_SCIM_JSON })
51 ListResponse<R> search(
52 @QueryParam("attributes") String attributes,
53 @QueryParam("excludedAttributes") String excludedAttributes,
54 @QueryParam("filter") String filter,
55 @QueryParam("sortBy") String sortBy,
56 @QueryParam("sortOrder") SortOrder sortOrder,
57 @QueryParam("startIndex") Integer startIndex,
58 @QueryParam("count") Integer count);
59
60 @POST
61 @Path(".search")
62 @Produces({ SCIMConstants.APPLICATION_SCIM_JSON })
63 @Consumes({ SCIMConstants.APPLICATION_SCIM_JSON })
64 ListResponse<R> search(SCIMSearchRequest request);
65
66 @POST
67 @Produces({ SCIMConstants.APPLICATION_SCIM_JSON })
68 @Consumes({ SCIMConstants.APPLICATION_SCIM_JSON })
69 Response create(R resource);
70
71 @PATCH
72 @Path("{id}")
73 @Produces({ SCIMConstants.APPLICATION_SCIM_JSON })
74 @Consumes({ SCIMConstants.APPLICATION_SCIM_JSON })
75 Response update(@NotNull @PathParam("id") String id, SCIMPatchOp patch);
76
77 @PUT
78 @Path("{id}")
79 @Produces({ SCIMConstants.APPLICATION_SCIM_JSON })
80 @Consumes({ SCIMConstants.APPLICATION_SCIM_JSON })
81 Response replace(@NotNull @PathParam("id") String id, R resource);
82
83 @DELETE
84 @Path("{id}")
85 @Produces({ SCIMConstants.APPLICATION_SCIM_JSON })
86 Response delete(@NotNull @PathParam("id") String id);
87 }