Blame view

src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapInterface.java 6.82 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
26
import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE;
import eu.omp.irap.vespa.votable.controller.CantGetVOTableException;
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
36
37
38
39
40
41
	/**
	 * 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.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
42
43
44
45
	public Resource getEPNVOresource(String ivoid) throws VOResourceException;

	// *** Resources ***

eda63a5c   Nathanael Jourdane   Add Javadoc.
46
47
48
49
50
51
	/**
	 * 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.
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
52
	public List<Resource> getEPNVOResources() throws VOResourceException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
53
54

	/**
bfe5db3a   Nathanael Jourdane   rename epnTapLib ...
55
56
	 * 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.
eda63a5c   Nathanael Jourdane   Add Javadoc.
57
58
59
60
61
62
63
64
	 *
	 * @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...
65
	 */
35daa117   Nathanael Jourdane   Improve JUnits te...
66
	public List<Resource> getEPNVOResources(List<String> keywords)
cfbb6d07   Nathanael Jourdane   Implement most of...
67
			throws VOResourceException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
68

cfbb6d07   Nathanael Jourdane   Implement most of...
69
70
71
	// *** Service ***

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
72
73
	 * Returns a VOTable containing the attributes of the corresponding service (from a predefined
	 * list).
cfbb6d07   Nathanael Jourdane   Implement most of...
74
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
75
76
77
	 * @param ivoid The ivoid of the service to get.
	 * @return A VOTable containing the service.
	 * @throws CantGetVOTableException Can not get the VOTable.
cfbb6d07   Nathanael Jourdane   Implement most of...
78
	 */
eda63a5c   Nathanael Jourdane   Add Javadoc.
79
	public VOTABLE getEPNService(String ivoid) throws CantGetVOTableException;
cfbb6d07   Nathanael Jourdane   Implement most of...
80
81

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
82
83
	 * Returns a VOTable containing the attributes of the corresponding service (from the list of
	 * attributes).
cfbb6d07   Nathanael Jourdane   Implement most of...
84
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
85
86
87
88
89
	 * @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.
	 * @throws CantGetVOTableException Can not get the VOTable.
cfbb6d07   Nathanael Jourdane   Implement most of...
90
	 */
eda63a5c   Nathanael Jourdane   Add Javadoc.
91
	public VOTABLE getEPNService(String ivoid, List<String> attributes)
cfbb6d07   Nathanael Jourdane   Implement most of...
92
93
94
			throws CantGetVOTableException;

	// *** Services ***
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
95
96

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
97
98
	 * Returns a VOTable containing the list of EPN-TAP services and their attributes (from a
	 * predefined list).
cfbb6d07   Nathanael Jourdane   Implement most of...
99
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
100
101
	 * @return A VOTable containing the services.
	 * @throws CantGetVOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
102
	 */
35daa117   Nathanael Jourdane   Improve JUnits te...
103
	public VOTABLE getEPNServices() throws CantGetVOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
104
105

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
106
	 * Returns a VOTable containing the list of EPN-TAP services and their attributes (from the list
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
107
	 * of attributes)
cfbb6d07   Nathanael Jourdane   Implement most of...
108
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
109
110
111
	 * @param attributes A list of attributes, which are the column names to get.
	 * @return A VOTable containing the services.
	 * @throws CantGetVOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
112
	 */
35daa117   Nathanael Jourdane   Improve JUnits te...
113
	public VOTABLE getEPNServices(List<String> attributes) throws CantGetVOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
114
115

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
116
117
	 * 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...
118
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
119
120
121
122
123
	 * @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.
	 * @throws CantGetVOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
124
	 */
35daa117   Nathanael Jourdane   Improve JUnits te...
125
126
	public VOTABLE getEPNServices(List<String> keywords, List<String> attributes)
			throws CantGetVOTableException;
cfbb6d07   Nathanael Jourdane   Implement most of...
127
128

	// *** Getters ***
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
129
130

	/**
eda63a5c   Nathanael Jourdane   Add Javadoc.
131
	 * Returns the name of the EPNCore Table related to a service.
cfbb6d07   Nathanael Jourdane   Implement most of...
132
	 *
eda63a5c   Nathanael Jourdane   Add Javadoc.
133
134
135
	 * @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 CantGetVOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
136
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
137
	public String getEPNCoreTableName(String ivoid) throws CantGetVOTableException;
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
144
	 * @param ivoid the ivoid of the service.
	 * @return The target URL of the service, used usually to process requests on it.
	 * @throws CantGetVOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
145
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
146
	public String getTAPURL(String ivoid) throws CantGetVOTableException;
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
158
	 * @param tapURL The URL of the service.
	 * @param adqlQuery The ADQL query.
	 * @return A list of Granules resulting the query.
	 * @throws CantGetVOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
159
	 */
cfbb6d07   Nathanael Jourdane   Implement most of...
160
161
	public List<Granule> sendADQLQuery(String tapURL, String adqlQuery)
			throws CantGetVOTableException;
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
172
	 *
	 * @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.
	 * @throws CantGetVOTableException Can not get the VOTable.
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
173
	 */
125adfc1   Nathanael Jourdane   Use enumerated qu...
174
175
	public List<Granule> sendQuery(String tapURL, String schemaName, Query query)
			throws CantGetVOTableException;
19c409d4   Nathanael Jourdane   Add the EPNTAP in...
176
}