1
2
3
4
5
6
7
8 package fr.in2p3.jsaga.adaptor.schema.data.emulator;
9
10
11
12
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import org.exolab.castor.xml.MarshalException;
19 import org.exolab.castor.xml.Marshaller;
20 import org.exolab.castor.xml.Unmarshaller;
21 import org.exolab.castor.xml.ValidationException;
22 import org.xml.sax.ContentHandler;
23
24
25
26
27
28
29 public class ServerType extends fr.in2p3.jsaga.adaptor.schema.data.emulator.DirectoryType
30 implements java.io.Serializable
31 {
32
33
34
35
36
37
38
39
40
41 private java.lang.String _protocol;
42
43
44
45
46 private java.lang.String _host;
47
48
49
50
51 private int _port;
52
53
54
55
56 private boolean _has_port;
57
58
59
60
61
62
63 public ServerType()
64 {
65 super();
66 }
67
68
69
70
71
72
73
74
75
76
77 public void deletePort()
78 {
79 this._has_port= false;
80 }
81
82
83
84
85
86
87
88 public java.lang.String getHost()
89 {
90 return this._host;
91 }
92
93
94
95
96
97
98
99 public int getPort()
100 {
101 return this._port;
102 }
103
104
105
106
107
108
109
110 public java.lang.String getProtocol()
111 {
112 return this._protocol;
113 }
114
115
116
117
118
119
120
121
122 public boolean hasPort()
123 {
124 return this._has_port;
125 }
126
127
128
129
130
131
132
133
134 public boolean isValid()
135 {
136 try {
137 validate();
138 }
139 catch (org.exolab.castor.xml.ValidationException vex) {
140 return false;
141 }
142 return true;
143 }
144
145
146
147
148
149
150
151
152 public void marshal(java.io.Writer out)
153 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
154 {
155
156 Marshaller.marshal(this, out);
157 }
158
159
160
161
162
163
164
165
166 public void marshal(org.xml.sax.ContentHandler handler)
167 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
168 {
169
170 Marshaller.marshal(this, handler);
171 }
172
173
174
175
176
177
178 public void setHost(java.lang.String host)
179 {
180 this._host = host;
181 }
182
183
184
185
186
187
188 public void setPort(int port)
189 {
190 this._port = port;
191 this._has_port = true;
192 }
193
194
195
196
197
198
199 public void setProtocol(java.lang.String protocol)
200 {
201 this._protocol = protocol;
202 }
203
204
205
206
207
208
209
210
211
212 public static java.lang.Object unmarshal(java.io.Reader reader)
213 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
214 {
215 return (fr.in2p3.jsaga.adaptor.schema.data.emulator.ServerType) Unmarshaller.unmarshal(fr.in2p3.jsaga.adaptor.schema.data.emulator.ServerType.class, reader);
216 }
217
218
219
220
221
222 public void validate()
223 throws org.exolab.castor.xml.ValidationException
224 {
225 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
226 validator.validate(this);
227 }
228
229 }