Blame view

src/main/java/eu/omp/irap/vespa/epntapclient/epntap/EpnTapInterface.java 6.65 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/>.
 */

1375d734   Nathanael Jourdane   Create package ep...
17
package eu.omp.irap.vespa.epntapclient.epntap;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
18
19

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

1375d734   Nathanael Jourdane   Create package ep...
21
import eu.omp.irap.vespa.epntapclient.Query;
cfbb6d07   Nathanael Jourdane   Implement most of...
22
import eu.omp.irap.vespa.epntapclient.granule.Granule;
eda63a5c   Nathanael Jourdane   Add Javadoc.
23
import eu.omp.irap.vespa.epntapclient.granule.GranuleEnum;
cfbb6d07   Nathanael Jourdane   Implement most of...
24
import eu.omp.irap.vespa.epntapclient.voresource.VOResourceException;
bfe5db3a   Nathanael Jourdane   rename epnTapLib ...
25
import eu.omp.irap.vespa.epntapclient.voresource.model.Resource;
cfbb6d07   Nathanael Jourdane   Implement most of...
26
import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE;
1375d734   Nathanael Jourdane   Create package ep...
27
import eu.omp.irap.vespa.votable.votable.VOTableException;
bfe5db3a   Nathanael Jourdane   rename epnTapLib ...
28

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

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

eda63a5c   Nathanael Jourdane   Add Javadoc.
36
	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
37
	 * Returns the name of the EPNCore Table related to a service.
eda63a5c   Nathanael Jourdane   Add Javadoc.
38
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
39
40
41
	 * @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.
42
	 */
11205d24   Mickael Boiziot   Remove useless pu...
43
	String getEPNCoreTableName(String ivoid) throws VOTableException;
cfbb6d07   Nathanael Jourdane   Implement most of...
44
45
46

	// *** Resources ***

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

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
58
59
	 * Returns a VOTable containing the attributes of the corresponding service (from the list of
	 * attributes).
cfbb6d07   Nathanael Jourdane   Implement most of...
60
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
61
62
63
64
	 * @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.
65
	 * @throws VOTableException Can not get the VOTable.
cfbb6d07   Nathanael Jourdane   Implement most of...
66
	 */
11205d24   Mickael Boiziot   Remove useless pu...
67
	VOTABLE getEPNService(String ivoid, List<String> attributes)
e669c5d3   Nathanael Jourdane   Improve Javadoc.
68
			throws VOTableException;
cfbb6d07   Nathanael Jourdane   Implement most of...
69

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

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

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

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

19c409d4   Nathanael Jourdane   Add the EPNTAP in...
93
	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
94
95
	 * 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...
96
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
97
98
99
100
	 * @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.
101
	 * @throws VOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
102
	 */
11205d24   Mickael Boiziot   Remove useless pu...
103
	VOTABLE getEPNServices(List<String> keywords, List<String> attributes)
e669c5d3   Nathanael Jourdane   Improve Javadoc.
104
			throws VOTableException;
cfbb6d07   Nathanael Jourdane   Implement most of...
105

45fb4583   Nathanael Jourdane   Sort methods and ...
106
107
108
109
110
111
112
	/**
	 * 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.
	 */
11205d24   Mickael Boiziot   Remove useless pu...
113
	Resource getEPNVOresource(String ivoid) throws VOResourceException;
45fb4583   Nathanael Jourdane   Sort methods and ...
114
115
116
117
118
119
120

	/**
	 * 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.
	 */
11205d24   Mickael Boiziot   Remove useless pu...
121
	List<Resource> getEPNVOResources() throws VOResourceException;
45fb4583   Nathanael Jourdane   Sort methods and ...
122

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

	/**
45fb4583   Nathanael Jourdane   Sort methods and ...
126
127
	 * 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...
128
	 *
45fb4583   Nathanael Jourdane   Sort methods and ...
129
130
131
132
133
134
135
	 * @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...
136
	 */
11205d24   Mickael Boiziot   Remove useless pu...
137
	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
	 */
11205d24   Mickael Boiziot   Remove useless pu...
146
	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
	 */
11205d24   Mickael Boiziot   Remove useless pu...
160
	List<Granule> sendADQLQuery(String tapURL, String adqlQuery) throws VOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
161
162

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
163
	 * Returns the list of granules which are compliant with the Query, in VOTable format. "Query"
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
164
165
	 * is not an ADQL query. It is taken from a list of predefined queries. This list must be
	 * created.
eda63a5c   Nathanael Jourdane   Add Javadoc.
166
167
168
169
170
	 *
	 * @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.
171
	 * @throws VOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
172
	 */
11205d24   Mickael Boiziot   Remove useless pu...
173
	List<Granule> sendQuery(String tapURL, String schemaName, Query query) throws VOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
174
}