1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.github.maven_nar.cpptasks;
21
22 import java.util.Vector;
23
24 import org.apache.tools.ant.types.DataType;
25 import org.apache.tools.ant.types.Reference;
26
27
28
29
30
31 public final class DistributerDef extends DataType {
32
33
34
35 private String ifCond;
36
37
38
39
40 private String unlessCond;
41
42
43
44
45
46 private String hosts;
47
48
49
50
51
52 private DistributerProtocolEnum protocol;
53
54
55
56
57 private int tcpCork;
58
59
60
61
62 private String user;
63
64
65
66
67 private final Vector maps = new Vector();
68
69
70
71
72
73 public DistributerDef() {
74 }
75
76
77
78
79
80
81 public DistributerMap createMap() {
82 final DistributerMap map = new DistributerMap();
83 map.setProject(getProject());
84 this.maps.addElement(map);
85 return map;
86 }
87
88
89
90
91 public void execute() {
92 throw new org.apache.tools.ant.BuildException("Not an actual task, but looks like one for documentation purposes");
93 }
94
95
96
97
98
99
100
101 public String getHosts() {
102 if (isReference()) {
103 final DistributerDef refDistributer = (DistributerDef) getCheckedRef(DistributerDef.class, "DistributerDef");
104 return refDistributer.getHosts();
105 }
106 return this.hosts;
107 }
108
109
110
111
112
113
114
115 public DistributerProtocolEnum getProtocol() {
116 if (isReference()) {
117 final DistributerDef refDistributer = (DistributerDef) getCheckedRef(DistributerDef.class, "DistributerDef");
118 return refDistributer.getProtocol();
119 }
120 return this.protocol;
121 }
122
123
124
125
126
127
128
129 public int getTcpcork() {
130 if (isReference()) {
131 final DistributerDef refDistributer = (DistributerDef) getCheckedRef(DistributerDef.class, "DistributerDef");
132 return refDistributer.getTcpcork();
133 }
134 return this.tcpCork;
135 }
136
137
138
139
140
141
142
143 public boolean isActive() {
144 return CUtil.isActive(getProject(), this.ifCond, this.unlessCond);
145 }
146
147
148
149
150
151
152
153 public void setHosts(final String value) {
154 if (isReference()) {
155 throw tooManyAttributes();
156 }
157 this.hosts = value;
158 }
159
160
161
162
163
164
165
166 public void setId(final String id) {
167
168
169
170
171 }
172
173
174
175
176
177
178
179
180
181
182
183
184
185 public void setIf(final String propName) {
186 this.ifCond = propName;
187 }
188
189
190
191
192
193
194
195 public void setProtocol(final DistributerProtocolEnum value) {
196 if (isReference()) {
197 throw tooManyAttributes();
198 }
199 this.protocol = value;
200 }
201
202
203
204
205
206
207
208
209
210 @Override
211 public void setRefid(final Reference r) {
212 super.setRefid(r);
213 }
214
215
216
217
218
219
220
221 public void setTcpcork(final int value) {
222 if (isReference()) {
223 throw tooManyAttributes();
224 }
225 this.tcpCork = value;
226 }
227
228
229
230
231
232
233
234
235
236
237
238
239
240 public void setUnless(final String propName) {
241 this.unlessCond = propName;
242 }
243
244
245
246
247
248
249
250 public void setUser(final String value) {
251 this.user = value;
252 }
253
254 }