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.parser;
26
27 import org.apache.commons.lang.StringUtils;
28 import org.dom4j.Node;
29 import org.rundeck.api.domain.RundeckJobDelete;
30
31
32
33
34
35
36
37 public class DeleteParser extends BaseXpathParser<RundeckJobDelete> {
38
39
40 public DeleteParser(final String xpath) {
41 super(xpath);
42 }
43
44 public DeleteParser() {
45 super();
46 }
47
48 @Override
49 public RundeckJobDelete parse(Node resultNode) {
50
51 final RundeckJobDelete delete = new RundeckJobDelete();
52 delete.setError(StringUtils.trimToNull(resultNode.valueOf("error")));
53 delete.setErrorCode(StringUtils.trimToNull(resultNode.valueOf("@errorCode")));
54 delete.setId(StringUtils.trimToNull(resultNode.valueOf("@id")));
55 delete.setMessage(StringUtils.trimToNull(resultNode.valueOf("message")));
56 delete.setSuccessful(null == delete.getError() && null == delete.getErrorCode());
57
58 return delete;
59 }
60 }