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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 package org.astrogrid.filestore.common.transfer ;
58
59 import org.astrogrid.filestore.common.file.FileProperty;
60 import org.astrogrid.filestore.common.file.FileProperties;
61
62 import org.astrogrid.filestore.common.FileStoreInputStream;
63 import org.astrogrid.filestore.common.FileStoreOutputStream;
64
65 import org.astrogrid.filestore.common.identifier.UniqueIdentifier;
66
67 /***
68 * An object to hold metadata about a data transfer.
69 *
70 */
71 public class TransferProperties
72 {
73
74 /***
75 * Public constructor.
76 * Required for Axis to serialize this as a Bean.
77 *
78 */
79 public TransferProperties()
80 {
81 }
82
83 /***
84 * Public constructor.
85 * @param ident A unique identifier for the transfer.
86 *
87 */
88 public TransferProperties(String ident)
89 {
90 this(
91 ident,
92 (FileProperty[]) null
93 ) ;
94 }
95
96 /***
97 * Public constructor.
98 * @param properties The properties for the file to transfer
99 *
100 */
101 public TransferProperties(FileProperties properties)
102 {
103 this(
104 null,
105 (null != properties) ? properties.toArray() : (FileProperty[]) null
106 ) ;
107 }
108
109 /***
110 * Public constructor.
111 * @param ident A unique identifier for the transfer.
112 * @param properties The properties for the file to transfer
113 *
114 */
115 public TransferProperties(String ident, FileProperties properties)
116 {
117 this(
118 ident,
119 (null != properties) ? properties.toArray() : (FileProperty[]) null
120 ) ;
121 }
122
123 /***
124 * Public constructor.
125 * @param ident A unique identifier for the transfer.
126 * @param properties The properties for the file to transfer
127 *
128 */
129 public TransferProperties(String ident, FileProperty[] properties)
130 {
131 this.setIdent(
132 ident
133 ) ;
134 this.setFileProperties(
135 properties
136 ) ;
137 }
138
139 /***
140 * The transfer identifier.
141 *
142 */
143 private String ident ;
144
145 /***
146 * Access to our ident.
147 *
148 */
149 public String getIdent()
150 {
151 return this.ident ;
152 }
153
154 /***
155 * Access to our ident.
156 *
157 */
158 public void setIdent(String value)
159 {
160 this.ident = value ;
161 }
162
163 /***
164 * The transfer location (URL).
165 * eg http://host.domain/path/file
166 *
167 */
168 private String location ;
169
170 /***
171 * Access to the transfer location (URL).
172 * eg http://host.domain/path/file
173 *
174 */
175 public String getLocation()
176 {
177 return this.location ;
178 }
179
180 /***
181 * Access to the transfer location (URL).
182 * eg http://host.domain/path/file
183 * @param The transfer location (RL).
184 *
185 */
186 public void setLocation(String value)
187 {
188 this.location = value ;
189 }
190
191 /***
192 * The transfer protocol.
193 * eg http, ftp
194 * @todo generate this from our URL ?
195 *
196 */
197 private String protocol ;
198
199 /***
200 * Access to the transfer protocol.
201 * eg http, ftp
202 * @todo generate this from our URL ?
203 *
204 */
205 public String getProtocol()
206 {
207 return this.protocol ;
208 }
209
210 /***
211 * Access to the transfer protocol.
212 * eg http, ftp
213 * @todo generate this from our URL ?
214 *
215 */
216 public void setProtocol(String value)
217 {
218 this.protocol = value ;
219 }
220
221 /***
222 * The transfer method.
223 * eg GET, PUT, POST
224 *
225 */
226 private String method ;
227
228 /***
229 * Access to the transfer method.
230 * eg GET, PUT, POST
231 *
232 */
233 public String getMethod()
234 {
235 return this.method ;
236 }
237
238 /***
239 * Access to the transfer method.
240 * eg GET, PUT, POST
241 *
242 */
243 public void setMethod(String value)
244 {
245 this.method = value ;
246 }
247
248 /***
249 * The file properties for the transferred data.
250 *
251 */
252 private FileProperty[] properties ;
253
254 /***
255 * Access to our file properties.
256 *
257 */
258 public FileProperty[] getFileProperties()
259 {
260 return this.properties ;
261 }
262
263 /***
264 * Set the transfer properties.
265 *
266 */
267 public void setFileProperties(FileProperties properties)
268 {
269 this.setFileProperties(
270 properties.toArray()
271 );
272 }
273
274 /***
275 * Set the transfer properties.
276 *
277 */
278 public void setFileProperties(FileProperty[] properties)
279 {
280 this.properties = properties ;
281 }
282 }
283