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 package org.rundeck.api;
26
27 import org.rundeck.api.domain.RundeckExecution;
28 import org.rundeck.api.query.ExecutionQuery;
29
30
31
32
33
34
35
36
37 class ExecutionQueryParameters extends QueryParameterBuilder {
38 ExecutionQuery query;
39
40 ExecutionQueryParameters(final ExecutionQuery query) {
41 this.query = query;
42 }
43
44 public boolean buildParameters(final ApiPathBuilder builder, final boolean doPost) {
45 boolean seen = false;
46
47 seen |= visit("jobFilter", query.getJob(), doPost, builder);
48 seen |= visit("jobExactFilter", query.getJobExact(), doPost, builder);
49 seen |= visit("excludeJobFilter", query.getExcludeJob(), doPost, builder);
50 seen |= visit("excludeJobExactFilter", query.getExcludeJobExact(), doPost, builder);
51 seen |= visit("project", query.getProject(), doPost, builder);
52 seen |= visit("groupPath", query.getGroupPath(), doPost, builder);
53 seen |= visit("groupPathExact", query.getGroupPathExact(), doPost, builder);
54 seen |= visit("excludeGroupPath", query.getExcludeGroupPath(), doPost, builder);
55 seen |= visit("excludeGroupPathExact", query.getExcludeGroupPathExact(), doPost, builder);
56 seen |= visit("descFilter", query.getDescription(), doPost, builder);
57 seen |= visit("userFilter", query.getUser(), doPost, builder);
58 if(null!=query.getAdhoc()){
59 seen |= visit("adhoc", query.getAdhoc(), doPost, builder);
60 }
61
62 seen |= visit("statusFilter", stringVal(query.getStatus()), doPost, builder);
63 seen |= visit("abortedbyFilter", query.getAbortedby(), doPost, builder);
64 seen |= visit("jobListFilter", query.getJobList(), doPost, builder);
65 seen |= visit("jobIdListFilter", query.getJobIdList(), doPost, builder);
66 seen |= visit("excludeJobIdListFilter", query.getExcludeJobIdList(), doPost, builder);
67 seen |= visit("excludeJobListFilter", query.getExcludeJobList(), doPost, builder);
68 seen |= visit("begin", query.getBegin(), doPost, builder);
69 seen |= visit("end", query.getEnd(), doPost, builder);
70 seen |= visit("recentFilter", query.getRecent(), doPost, builder);
71
72 return seen;
73 }
74
75 public static String stringVal(final RundeckExecution.ExecutionStatus status) {
76 return null != status ? status.toString().toLowerCase() : null;
77 }
78
79 }