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
25
26
27
28
	/**
	 * The ivoid of the service: <br/>
	 * <em>Unambiguous reference to the resource conforming to the IVOA
	 * standard for identifiers.</em>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
29
30
	private String ivoid;

76a922bc   Nathanael Jourdane   Improve Javadoc.
31
32
33
34
	/**
	 * The title of the service: <br/>
	 * <em>The full name given to the resource.</em>
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
35
	private String title;
d11a0a1d   Nathanael Jourdane   Create package er...
36

76a922bc   Nathanael Jourdane   Improve Javadoc.
37
38
39
40
41
42
43
	/**
	 * 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>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
44
45
	private String shortName;

76a922bc   Nathanael Jourdane   Improve Javadoc.
46
47
48
49
	/**
	 * The type of the service: <br/>
	 * <em>Resource type (something like vs:datacollection, vs:catalogservice, etc).</em>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
50
51
	private String type;

76a922bc   Nathanael Jourdane   Improve Javadoc.
52
53
54
55
	/**
	 * The description of the service: <br/>
	 * <em>An account of the nature of the resource.</em>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
56
57
	private String description;

76a922bc   Nathanael Jourdane   Improve Javadoc.
58
59
60
61
62
	/**
	 * 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>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
63
64
	private String creator;

76a922bc   Nathanael Jourdane   Improve Javadoc.
65
66
67
68
	/**
	 * The content_level of the service: <br/>
	 * <em> A hash-separated list of content levels specifying the intended audience.</em>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
69
70
	private String contentLevel;

76a922bc   Nathanael Jourdane   Improve Javadoc.
71
72
73
74
	/**
	 * 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...
75
76
	private String referenceURL;

76a922bc   Nathanael Jourdane   Improve Javadoc.
77
78
79
80
81
82
	/**
	 * 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>
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
83
84
	private String created;

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
104
105
	/**
	 * @return true if all parameter of the service are not null.
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
106
	public boolean isValid() {
cfbb6d07   Nathanael Jourdane   Implement most of...
107
		boolean isValid = ivoid != null && title != null && shortName != null;
d11a0a1d   Nathanael Jourdane   Create package er...
108
109
110
111
112
		isValid = isValid && type != null && description != null && creator != null;
		isValid = isValid && contentLevel != null && referenceURL != null && created != null;
		return isValid && updated != null;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
113
114
115
116
117
	/**
	 * Get the service {@link #title}.
	 *
	 * @return The service {@link #title}.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
118
119
	public String getTitle() {
		return title;
d11a0a1d   Nathanael Jourdane   Create package er...
120
121
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
122
123
124
125
126
127
128
	/**
	 * Set the service {@link #title}.
	 *
	 * @param title The service {@link #title}
	 */
	public void setTitle(String title) {
		this.title = title;
d11a0a1d   Nathanael Jourdane   Create package er...
129
130
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
131
132
133
134
135
	/**
	 * Get the service {@link #shortName}.
	 *
	 * @return The service {@link #shortName}.
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
136
137
138
139
	public String getShortName() {
		return shortName;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
140
141
142
143
144
	/**
	 * Set the service {@link #shortName}.
	 *
	 * @param shortName The service {@link #shortName}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
145
146
147
148
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
149
150
151
152
153
	/**
	 * Get the service {@link #type}.
	 *
	 * @return The service {@link #type}.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
154
155
156
157
	public String getType() {
		return type;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
158
159
160
161
162
	/**
	 * Set the service {@link #type}.
	 *
	 * @param type The service {@link #type}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
163
164
165
166
	public void setType(String type) {
		this.type = type;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
167
168
169
170
171
	/**
	 * Get the service {@link #description}.
	 *
	 * @return The service {@link #description}.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
172
173
174
175
	public String getDescription() {
		return description;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
176
177
178
179
180
	/**
	 * Set the service {@link #description}.
	 *
	 * @param description The service {@link #description}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
181
182
183
184
	public void setDescription(String description) {
		this.description = description;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
185
186
187
188
189
	/**
	 * Get the service {@link #creator}.
	 *
	 * @return The service {@link #creator}.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
190
191
192
193
	public String getCreator() {
		return creator;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
194
195
196
197
198
	/**
	 * Set the service {@link #creator}.
	 *
	 * @param creator The service {@link #creator}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
199
200
201
202
	public void setCreator(String creator) {
		this.creator = creator;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
203
204
205
206
207
	/**
	 * Get the service {@link #contentLevel}.
	 *
	 * @return The service {@link #contentLevel}.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
208
209
210
211
	public String getContentLevel() {
		return contentLevel;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
212
213
214
215
216
	/**
	 * Set the service {@link #contentLevel}.
	 *
	 * @param contentLevel The service {@link #contentLevel}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
217
218
219
220
	public void setContentLevel(String contentLevel) {
		this.contentLevel = contentLevel;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
221
222
223
224
225
	/**
	 * Get the service {@link #referenceURL}.
	 *
	 * @return The service {@link #referenceURL}.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
226
227
228
229
	public String getReferenceURL() {
		return referenceURL;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
230
231
232
233
234
	/**
	 * Set the service {@link #referenceURL}.
	 *
	 * @param referenceURL The service {@link #referenceURL}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
235
236
237
238
	public void setReferenceURL(String referenceURL) {
		this.referenceURL = referenceURL;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
239
240
241
242
243
	/**
	 * Get the service {@link #created} date.
	 *
	 * @return The service {@link #created} date.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
244
245
246
247
	public String getCreated() {
		return created;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
248
249
250
251
252
	/**
	 * Set the service {@link #created}.
	 *
	 * @param created The service {@link #created}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
253
254
255
256
	public void setCreated(String created) {
		this.created = created;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
257
258
259
260
261
	/**
	 * Get the service {@link #updated} date.
	 *
	 * @return The service {@link #updated} date.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
262
263
264
265
	public String getUpdated() {
		return updated;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
266
267
268
269
270
	/**
	 * Set the service {@link #updated}.
	 *
	 * @param updated The service {@link #updated}
	 */
d11a0a1d   Nathanael Jourdane   Create package er...
271
272
273
274
	public void setUpdated(String updated) {
		this.updated = updated;
	}

76a922bc   Nathanael Jourdane   Improve Javadoc.
275
276
277
278
279
	/**
	 * Get the service {@link #ivoid}.
	 *
	 * @return The service {@link #ivoid}.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
280
281
282
283
	public String getIvoid() {
		return ivoid;
	}

d11a0a1d   Nathanael Jourdane   Create package er...
284
}