Blame view

src/main/java/eu/omp/irap/vespa/epntapclient/service/Service.java 6.81 KB
d11a0a1d   Nathanael Jourdane   Create package er...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * This file is a part of EpnTAPClient.
 * This program aims to provide EPN-TAP support for software clients, like CASSIS spectrum analyzer.
 * See draft specifications: https://voparis-confluence.obspm.fr/pages/viewpage.action?pageId=559861
 * Copyright (C) 2016 Institut de Recherche en Astrophysique et Planétologie.
 *
 * This program is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or (at your option) any later
 * version. This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE. See the GNU General Public License for more details. You should have received a copy of
 * the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */

package eu.omp.irap.vespa.epntapclient.service;

/**
 * @author N. Jourdane
 */
4bcbd19f   Nathanael Jourdane   Fix imports
22
public class Service {
d11a0a1d   Nathanael Jourdane   Create package er...
23

76a922bc   Nathanael Jourdane   Improve Javadoc.
24
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
25
26
	 * The content_level of the service: <br/>
	 * <em> A hash-separated list of content levels specifying the intended audience.</em>
76a922bc   Nathanael Jourdane   Improve Javadoc.
27
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
28
	private String contentLevel;
d11a0a1d   Nathanael Jourdane   Create package er...
29

76a922bc   Nathanael Jourdane   Improve Javadoc.
30
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
31
32
33
34
	 * The created date of the service, as a string: <br/>
	 * <em>The UTC date and time this resource metadata de- scription was created. This timestamp must
	 * not be in the future. This time is not required to be accurate; it should be at least
	 * accurate to the day. Any insignificant time elds should be set to zero.</em>
76a922bc   Nathanael Jourdane   Improve Javadoc.
35
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
36
	private String created;
d11a0a1d   Nathanael Jourdane   Create package er...
37

76a922bc   Nathanael Jourdane   Improve Javadoc.
38
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
39
40
41
	 * The creator of the service: <br/>
	 * <em>The creator(s) of the resource in the order given by the resource record author, separated by
	 * semicolons.</em>
76a922bc   Nathanael Jourdane   Improve Javadoc.
42
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
43
	private String creator;
d11a0a1d   Nathanael Jourdane   Create package er...
44

76a922bc   Nathanael Jourdane   Improve Javadoc.
45
46
47
48
	/**
	 * The description of the service: <br/>
	 * <em>An account of the nature of the resource.</em>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
49
50
	private String description;

76a922bc   Nathanael Jourdane   Improve Javadoc.
51
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
52
53
54
	 * The ivoid of the service: <br/>
	 * <em>Unambiguous reference to the resource conforming to the IVOA
	 * standard for identifiers.</em>
76a922bc   Nathanael Jourdane   Improve Javadoc.
55
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
56
	private String ivoid;
d11a0a1d   Nathanael Jourdane   Create package er...
57

76a922bc   Nathanael Jourdane   Improve Javadoc.
58
59
60
61
	/**
	 * The reference_rul of the service: <br/>
	 * <em>URL pointing to a human-readable document describing this resource.</em>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
62
63
	private String referenceURL;

76a922bc   Nathanael Jourdane   Improve Javadoc.
64
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
65
66
67
68
69
	 * The short_name of the service: <br/>
	 * <em> A short name or abbreviation given to something. This name will be used where brief
	 * annotations for the re- source name are required. Applications may use it to refer to the
	 * resource in a compact display. One word or a few letters is recommended. No more than sixteen
	 * characters are allowed.</em>
76a922bc   Nathanael Jourdane   Improve Javadoc.
70
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
71
72
73
74
75
76
77
78
79
80
81
82
83
	private String shortName;

	/**
	 * The title of the service: <br/>
	 * <em>The full name given to the resource.</em>
	 */
	private String title;

	/**
	 * The type of the service: <br/>
	 * <em>Resource type (something like vs:datacollection, vs:catalogservice, etc).</em>
	 */
	private String type;
d11a0a1d   Nathanael Jourdane   Create package er...
84

76a922bc   Nathanael Jourdane   Improve Javadoc.
85
86
87
88
89
90
	/**
	 * The updated date of the service, as a string: <br/>
	 * <em> The UTC date this resource metadata description was last updated. This timestamp must not be
	 * in the future. This time is not required to be accurate; it should be at least accurate to
	 * the day. Any insignificant time elds should be set to zero.</em>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
91
92
93
	private String updated;


76a922bc   Nathanael Jourdane   Improve Javadoc.
94
95
96
97
98
99
	/**
	 * Constructor of Service
	 *
	 * @param ivoid The ivoID of the service.
	 */
	public Service(String ivoid) {
d11a0a1d   Nathanael Jourdane   Create package er...
100
101
102
		this.ivoid = ivoid;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
103
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
104
105
106
	 * Get the service {@link #contentLevel}.
	 *
	 * @return The service {@link #contentLevel}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
107
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
108
109
	public String getContentLevel() {
		return contentLevel;
d11a0a1d   Nathanael Jourdane   Create package er...
110
111
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
112
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
113
	 * Get the service {@link #created} date.
76a922bc   Nathanael Jourdane   Improve Javadoc.
114
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
115
	 * @return The service {@link #created} date.
76a922bc   Nathanael Jourdane   Improve Javadoc.
116
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
117
118
	public String getCreated() {
		return created;
d11a0a1d   Nathanael Jourdane   Create package er...
119
120
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
121
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
122
	 * Get the service {@link #creator}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
123
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
124
	 * @return The service {@link #creator}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
125
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
	public String getCreator() {
		return creator;
	}

	/**
	 * Get the service {@link #description}.
	 *
	 * @return The service {@link #description}.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Get the service {@link #ivoid}.
	 *
	 * @return The service {@link #ivoid}.
	 */
	public String getIvoid() {
		return ivoid;
	}

	/**
	 * Get the service {@link #referenceURL}.
	 *
	 * @return The service {@link #referenceURL}.
	 */
	public String getReferenceURL() {
		return referenceURL;
d11a0a1d   Nathanael Jourdane   Create package er...
155
156
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
157
158
159
160
161
	/**
	 * Get the service {@link #shortName}.
	 *
	 * @return The service {@link #shortName}.
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
162
163
164
165
	public String getShortName() {
		return shortName;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
166
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
167
	 * Get the service {@link #title}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
168
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
169
	 * @return The service {@link #title}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
170
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
171
172
	public String getTitle() {
		return title;
d11a0a1d   Nathanael Jourdane   Create package er...
173
174
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
175
176
177
178
179
	/**
	 * Get the service {@link #type}.
	 *
	 * @return The service {@link #type}.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
180
181
182
183
	public String getType() {
		return type;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
184
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
185
	 * Get the service {@link #updated} date.
76a922bc   Nathanael Jourdane   Improve Javadoc.
186
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
187
	 * @return The service {@link #updated} date.
76a922bc   Nathanael Jourdane   Improve Javadoc.
188
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
189
190
	public String getUpdated() {
		return updated;
d11a0a1d   Nathanael Jourdane   Create package er...
191
192
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
193
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
194
	 * @return true if all parameter of the service are not null.
76a922bc   Nathanael Jourdane   Improve Javadoc.
195
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
196
197
198
199
200
	public boolean isValid() {
		boolean isValid = ivoid != null && title != null && shortName != null;
		isValid = isValid && type != null && description != null && creator != null;
		isValid = isValid && contentLevel != null && referenceURL != null && created != null;
		return isValid && updated != null;
cfbb6d07   Nathanael Jourdane   Implement most of...
201
202
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
203
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
204
	 * Set the service {@link #contentLevel}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
205
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
206
	 * @param contentLevel The service {@link #contentLevel}
76a922bc   Nathanael Jourdane   Improve Javadoc.
207
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
208
209
	public void setContentLevel(String contentLevel) {
		this.contentLevel = contentLevel;
d11a0a1d   Nathanael Jourdane   Create package er...
210
211
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
212
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
213
	 * Set the service {@link #created}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
214
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
215
	 * @param created The service {@link #created}
76a922bc   Nathanael Jourdane   Improve Javadoc.
216
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
217
218
	public void setCreated(String created) {
		this.created = created;
cfbb6d07   Nathanael Jourdane   Implement most of...
219
220
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
221
222
223
224
225
	/**
	 * Set the service {@link #creator}.
	 *
	 * @param creator The service {@link #creator}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
226
227
228
229
	public void setCreator(String creator) {
		this.creator = creator;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
230
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
231
	 * Set the service {@link #description}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
232
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
233
	 * @param description The service {@link #description}
76a922bc   Nathanael Jourdane   Improve Javadoc.
234
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
235
236
	public void setDescription(String description) {
		this.description = description;
cfbb6d07   Nathanael Jourdane   Implement most of...
237
238
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
239
240
241
242
243
	/**
	 * Set the service {@link #referenceURL}.
	 *
	 * @param referenceURL The service {@link #referenceURL}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
244
245
246
247
	public void setReferenceURL(String referenceURL) {
		this.referenceURL = referenceURL;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
248
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
249
	 * Set the service {@link #shortName}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
250
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
251
	 * @param shortName The service {@link #shortName}
76a922bc   Nathanael Jourdane   Improve Javadoc.
252
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
253
254
	public void setShortName(String shortName) {
		this.shortName = shortName;
cfbb6d07   Nathanael Jourdane   Implement most of...
255
256
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
257
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
258
	 * Set the service {@link #title}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
259
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
260
	 * @param title The service {@link #title}
76a922bc   Nathanael Jourdane   Improve Javadoc.
261
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
262
263
	public void setTitle(String title) {
		this.title = title;
d11a0a1d   Nathanael Jourdane   Create package er...
264
265
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
266
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
267
	 * Set the service {@link #type}.
76a922bc   Nathanael Jourdane   Improve Javadoc.
268
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
269
	 * @param type The service {@link #type}
76a922bc   Nathanael Jourdane   Improve Javadoc.
270
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
271
272
	public void setType(String type) {
		this.type = type;
cfbb6d07   Nathanael Jourdane   Implement most of...
273
274
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
275
276
277
278
279
	/**
	 * Set the service {@link #updated}.
	 *
	 * @param updated The service {@link #updated}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
280
281
282
283
	public void setUpdated(String updated) {
		this.updated = updated;
	}

d11a0a1d   Nathanael Jourdane   Create package er...
284
}