1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.rest.api.service;
20
21 import io.swagger.v3.oas.annotations.responses.ApiResponse;
22 import io.swagger.v3.oas.annotations.responses.ApiResponses;
23 import java.util.List;
24 import javax.validation.constraints.Min;
25 import javax.validation.constraints.NotNull;
26 import javax.ws.rs.BeanParam;
27 import javax.ws.rs.DELETE;
28 import javax.ws.rs.DefaultValue;
29 import javax.ws.rs.GET;
30 import javax.ws.rs.POST;
31 import javax.ws.rs.Path;
32 import javax.ws.rs.PathParam;
33 import javax.ws.rs.Produces;
34 import javax.ws.rs.QueryParam;
35 import javax.ws.rs.core.MediaType;
36 import javax.ws.rs.core.Response;
37 import org.apache.syncope.common.lib.to.ExecTO;
38 import org.apache.syncope.common.lib.to.JobTO;
39 import org.apache.syncope.common.lib.to.PagedResult;
40 import org.apache.syncope.common.lib.types.JobAction;
41 import org.apache.syncope.common.rest.api.RESTHeaders;
42 import org.apache.syncope.common.rest.api.beans.ExecQuery;
43 import org.apache.syncope.common.rest.api.beans.ExecSpecs;
44
45 public interface ExecutableService extends JAXRSService {
46
47
48
49
50
51
52
53 @GET
54 @Path("{key}/executions")
55 @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
56 PagedResult<ExecTO> listExecutions(@BeanParam ExecQuery query);
57
58
59
60
61
62
63
64 @GET
65 @Path("executions/recent")
66 @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
67 List<ExecTO> listRecentExecutions(@Min(1) @QueryParam(JAXRSService.PARAM_MAX) @DefaultValue("25") int max);
68
69
70
71
72
73
74 @ApiResponses(
75 @ApiResponse(responseCode = "204", description = "Operation was successful"))
76 @DELETE
77 @Path("executions/{executionKey}")
78 @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
79 void deleteExecution(@NotNull @PathParam("executionKey") String executionKey);
80
81
82
83
84
85
86
87 @DELETE
88 @ApiResponses(
89 @ApiResponse(responseCode = "200",
90 description = "Batch results available, returned as Response entity"))
91 @Path("{key}/executions")
92 @Produces(RESTHeaders.MULTIPART_MIXED)
93 Response deleteExecutions(@BeanParam ExecQuery query);
94
95
96
97
98
99
100
101 @POST
102 @Path("{key}/execute")
103 @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
104 ExecTO execute(@BeanParam ExecSpecs specs);
105
106
107
108
109
110
111
112 @GET
113 @Path("jobs/{key}")
114 @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
115 JobTO getJob(@PathParam("key") String key);
116
117
118
119
120
121
122 @GET
123 @Path("jobs")
124 @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML })
125 List<JobTO> listJobs();
126
127
128
129
130
131
132
133 @ApiResponses(
134 @ApiResponse(responseCode = "204", description = "Operation was successful"))
135 @POST
136 @Path("jobs/{key}")
137 void actionJob(@NotNull @PathParam("key") String key, @QueryParam("action") JobAction action);
138 }