Blame view

src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapInterface.java 6.69 KB
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * 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/>.
 */

5e72363b   Nathanael Jourdane   Change project ar...
17
package eu.omp.irap.vespa.epntapclient;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
18
19

import java.util.List;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
20

cfbb6d07   Nathanael Jourdane   Implement most of...
21
import eu.omp.irap.vespa.epntapclient.granule.Granule;
eda63a5c   Nathanael Jourdane   Add Javadoc.
22
import eu.omp.irap.vespa.epntapclient.granule.GranuleEnum;
cfbb6d07   Nathanael Jourdane   Implement most of...
23
import eu.omp.irap.vespa.epntapclient.voresource.VOResourceException;
bfe5db3a   Nathanael Jourdane   rename epnTapLib ...
24
import eu.omp.irap.vespa.epntapclient.voresource.model.Resource;
cfbb6d07   Nathanael Jourdane   Implement most of...
25
import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE;
e669c5d3   Nathanael Jourdane   Improve Javadoc.
26
import eu.omp.irap.vespa.votable.controller.VOTableException;
bfe5db3a   Nathanael Jourdane   rename epnTapLib ...
27

19c409d4   Nathanael Jourdane   Add the EPNTAP in...
28
29
30
/**
 * @author N. Jourdane
 */
bfe5db3a   Nathanael Jourdane   rename epnTapLib ...
31
public interface EpnTapInterface {
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
32

cfbb6d07   Nathanael Jourdane   Implement most of...
33
34
	// *** Resource ***

eda63a5c   Nathanael Jourdane   Add Javadoc.
35
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
36
	 * Returns the name of the EPNCore Table related to a service.
eda63a5c   Nathanael Jourdane   Add Javadoc.
37
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
38
39
40
	 * @param ivoid The ivoid of the service.
	 * @return The table name of the service, used usually in the 'FROM' keyword in a ADQL query.
	 * @throws VOTableException Can not get the VOTable.
eda63a5c   Nathanael Jourdane   Add Javadoc.
41
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
42
	public String getEPNCoreTableName(String ivoid) throws VOTableException;
cfbb6d07   Nathanael Jourdane   Implement most of...
43
44
45

	// *** Resources ***

eda63a5c   Nathanael Jourdane   Add Javadoc.
46
	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
47
48
	 * Returns a VOTable containing the attributes of the corresponding service (from a predefined
	 * list).
cfbb6d07   Nathanael Jourdane   Implement most of...
49
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
50
51
	 * @param ivoid The ivoid of the service to get.
	 * @return A VOTable containing the service.
e669c5d3   Nathanael Jourdane   Improve Javadoc.
52
	 * @throws VOTableException Can not get the VOTable.
cfbb6d07   Nathanael Jourdane   Implement most of...
53
	 */
e669c5d3   Nathanael Jourdane   Improve Javadoc.
54
	public VOTABLE getEPNService(String ivoid) throws VOTableException;
cfbb6d07   Nathanael Jourdane   Implement most of...
55
56

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
57
58
	 * Returns a VOTable containing the attributes of the corresponding service (from the list of
	 * attributes).
cfbb6d07   Nathanael Jourdane   Implement most of...
59
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
60
61
62
63
	 * @param ivoid The ivoid of the service to get.
	 * @param attributes A list of attributes, which are the column names to get.
	 * @return A VOTable containing the service.
	 * @see GranuleEnum The EpnTapv2 column names.
e669c5d3   Nathanael Jourdane   Improve Javadoc.
64
	 * @throws VOTableException Can not get the VOTable.
cfbb6d07   Nathanael Jourdane   Implement most of...
65
	 */
eda63a5c   Nathanael Jourdane   Add Javadoc.
66
	public VOTABLE getEPNService(String ivoid, List<String> attributes)
e669c5d3   Nathanael Jourdane   Improve Javadoc.
67
			throws VOTableException;
cfbb6d07   Nathanael Jourdane   Implement most of...
68

45fb4583   Nathanael Jourdane   Sort methods and ...
69
	// *** Service ***
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
70
71

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
72
73
	 * Returns a VOTable containing the list of EPN-TAP services and their attributes (from a
	 * predefined list).
cfbb6d07   Nathanael Jourdane   Implement most of...
74
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
75
	 * @return A VOTable containing the services.
e669c5d3   Nathanael Jourdane   Improve Javadoc.
76
	 * @throws VOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
77
	 */
e669c5d3   Nathanael Jourdane   Improve Javadoc.
78
	public VOTABLE getEPNServices() throws VOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
79
80

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
81
	 * Returns a VOTable containing the list of EPN-TAP services and their attributes (from the list
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
82
	 * of attributes)
cfbb6d07   Nathanael Jourdane   Implement most of...
83
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
84
85
	 * @param attributes A list of attributes, which are the column names to get.
	 * @return A VOTable containing the services.
e669c5d3   Nathanael Jourdane   Improve Javadoc.
86
	 * @throws VOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
87
	 */
e669c5d3   Nathanael Jourdane   Improve Javadoc.
88
	public VOTABLE getEPNServices(List<String> attributes) throws VOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
89

45fb4583   Nathanael Jourdane   Sort methods and ...
90
91
	// *** Services ***

19c409d4   Nathanael Jourdane   Add the EPNTAP in...
92
	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
93
94
	 * Returns a VOTable containing the list of EPN-TAP services corresponding to the keywords and
	 * their attributes (from the list of attributes).
cfbb6d07   Nathanael Jourdane   Implement most of...
95
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
96
97
98
99
	 * @param keywords A list of keywords, which are the *res_subject* column content of the table
	 *            rr.res_subject of a registry.
	 * @param attributes A list of attributes, which are the column names to get.
	 * @return A VOTable containing the services.
e669c5d3   Nathanael Jourdane   Improve Javadoc.
100
	 * @throws VOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
101
	 */
35daa117   Nathanael Jourdane   Improve JUnits te...
102
	public VOTABLE getEPNServices(List<String> keywords, List<String> attributes)
e669c5d3   Nathanael Jourdane   Improve Javadoc.
103
			throws VOTableException;
cfbb6d07   Nathanael Jourdane   Implement most of...
104

45fb4583   Nathanael Jourdane   Sort methods and ...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
	/**
	 * Returns the VOResource element of the service identified by the ivoID.
	 *
	 * @param ivoid the ivoid of the service.
	 * @return The Resource of a service corresponding to the ivoid
	 * @throws VOResourceException Can not get the VOResource.
	 */
	public Resource getEPNVOresource(String ivoid) throws VOResourceException;

	/**
	 * Returns a set of VOResource elements (one per EPN-TAP service).
	 *
	 * @return A list containing the VOResources of all EpnTap services.
	 * @throws VOResourceException Can not get the VOResource.
	 */
	public List<Resource> getEPNVOResources() throws VOResourceException;

cfbb6d07   Nathanael Jourdane   Implement most of...
122
	// *** Getters ***
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
123
124

	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
125
126
	 * Returns a set of VOREsource elements (one per EPN-TAP service corresponding to the keywords).
	 * The way keywords are defined is still to be defined.
cfbb6d07   Nathanael Jourdane   Implement most of...
127
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
128
129
130
131
132
133
134
	 * @param keywords A list of keywords, which are the content of the *subject* JSON node in the
	 *            query.
	 * @see <a href=
	 *      "http://voparis-registry.obspm.fr/vo/ivoa/1/voresources/search?keywords=standardid:%22ivo://ivoa.net/std/TAP%22%20subjects:%22Spectroscopy%22&max=100">
	 *      this example request</a>
	 * @return A list containing the selected VOResources.
	 * @throws VOResourceException Can not get the VOResource.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
135
	 */
45fb4583   Nathanael Jourdane   Sort methods and ...
136
137
	public List<Resource> getEPNVOResources(List<String> keywords)
			throws VOResourceException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
138
139

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
140
	 * Returns the Access URL of an EPN-TAP Service.
cfbb6d07   Nathanael Jourdane   Implement most of...
141
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
142
143
	 * @param ivoid the ivoid of the service.
	 * @return The target URL of the service, used usually to process requests on it.
e669c5d3   Nathanael Jourdane   Improve Javadoc.
144
	 * @throws VOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
145
	 */
e669c5d3   Nathanael Jourdane   Improve Javadoc.
146
	public String getTAPURL(String ivoid) throws VOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
147

cfbb6d07   Nathanael Jourdane   Implement most of...
148
	// *** Queries ***
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
149
150

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
151
	 * Returns the list of granules which are compliant with the ADQL Query, in VOTable format .
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
152
153
	 * TAPURL is build from elements taken in VOResource. "ADQLQuery" is created by the Client. It
	 * is a full query containing the name of the EPNCore table, taken in VOResource.
cfbb6d07   Nathanael Jourdane   Implement most of...
154
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
155
156
157
	 * @param tapURL The URL of the service.
	 * @param adqlQuery The ADQL query.
	 * @return A list of Granules resulting the query.
e669c5d3   Nathanael Jourdane   Improve Javadoc.
158
	 * @throws VOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
159
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
160
	public List<Granule> sendADQLQuery(String tapURL, String adqlQuery)
e669c5d3   Nathanael Jourdane   Improve Javadoc.
161
			throws VOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
162
163

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
164
	 * Returns the list of granules which are compliant with the Query, in VOTable format. "Query"
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
165
166
	 * is not an ADQL query. It is taken from a list of predefined queries. This list must be
	 * created.
eda63a5c   Nathanael Jourdane   Add Javadoc.
167
168
169
170
171
	 *
	 * @param tapURL The URL of the service.
	 * @param schemaName The name of the service schema.
	 * @param query The query, from a list a predefined queries.
	 * @return A list of granules resulting the query.
e669c5d3   Nathanael Jourdane   Improve Javadoc.
172
	 * @throws VOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
173
	 */
125adfc1   Nathanael Jourdane   Use enumerated qu...
174
	public List<Granule> sendQuery(String tapURL, String schemaName, Query query)
e669c5d3   Nathanael Jourdane   Improve Javadoc.
175
			throws VOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
176
}