Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package de.unikoblenz.fgbks.api;
import de.unikoblenz.fgbks.core.dmn.verification.DmnVerificationService;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Path("/dmn/verification")
public class Verification {
@Inject protected DmnVerificationService dmnVerificationService;
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.TEXT_XML)
public Response verifyAll(String payload) {
return Response.accepted(dmnVerificationService.generate(payload)).build();
}
@POST
@Path("/type")
@Produces(MediaType.APPLICATION_JSON)
public Response verifyType() {
return Response.accepted(dmnVerificationService.getVerificationTypes()).build();
}
@POST
@Path("/type/{typeName}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.TEXT_XML)
public Response verifyType(@PathParam("typeName") String typeName, String payload) {
return Response.accepted(dmnVerificationService.generateFromType(typeName, payload)).build();
}
@POST
@Path("/classification")
@Produces(MediaType.APPLICATION_JSON)
public Response verifyClassification() {
return Response.accepted(dmnVerificationService.getVerificationClassificationTypes()).build();
}
@POST
@Path("/classification/{classificationName}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.TEXT_XML)
public Response verifyClassification(
@PathParam("classificationName") String classificationName, String payload) {
return Response.accepted(
dmnVerificationService.generateFromClassification(classificationName, payload))
.build();
}
}