1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.waarp.openr66.pojo;
22
23 import javax.xml.bind.annotation.XmlAccessType;
24 import javax.xml.bind.annotation.XmlAccessorType;
25 import javax.xml.bind.annotation.XmlElement;
26 import javax.xml.bind.annotation.XmlType;
27
28 import static org.waarp.openr66.configuration.RuleFileBasedConfiguration.*;
29 import static org.waarp.openr66.database.data.DbRule.*;
30
31
32
33
34 @XmlType(name = XTASK)
35 @XmlAccessorType(XmlAccessType.FIELD)
36 public class RuleTask {
37
38 @XmlElement(name = TASK_TYPE)
39 private String type;
40
41 @XmlElement(name = TASK_PATH)
42 private String path;
43
44 @XmlElement(name = TASK_DELAY)
45 private int delay;
46
47 public RuleTask() {
48
49 }
50
51 public RuleTask(final String type, final String path, final int delay) {
52 this.type = type;
53 this.path = path;
54 this.delay = delay;
55 }
56
57 public final String getXML() {
58 String res = "<task>";
59 res = res + "<type>" + type + "</type>";
60 res = res + "<path>" + path + "</path>";
61 res = res + "<delay>" + delay + "</delay>";
62 return res + "</task>";
63 }
64
65 @Override
66 public final String toString() {
67 return getXML();
68 }
69
70 public final String getType() {
71 return type;
72 }
73
74 public final void setType(final String type) {
75 this.type = type;
76 }
77
78 public final String getPath() {
79 return path;
80 }
81
82 public final void setPath(final String path) {
83 this.path = path;
84 }
85
86 public final int getDelay() {
87 return delay;
88 }
89
90 public final void setDelay(final int delay) {
91 this.delay = delay;
92 }
93 }