Commit 8b66e0876cb91338ea22a39a48fdd04c2bab3f2f
1 parent
2e76fb04
Exists in
master
Make readTable() private and use newVOTable() and appendVOTable() instead, to avoid confusions.
Showing
4 changed files
with
12 additions
and
19 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapConnection.java
... | ... | @@ -123,8 +123,8 @@ public class EpnTapConnection implements EpnTapInterface { |
123 | 123 | |
124 | 124 | @Override |
125 | 125 | public List<Granule> sendADQLQuery(String tapURL, String adqlQuery) throws VOTableException { |
126 | - VOTableController voTableCtrl = new VOTableController(tapURL, adqlQuery); | |
127 | - voTableCtrl.readTable(); | |
126 | + VOTableController voTableCtrl = new VOTableController(); | |
127 | + voTableCtrl.newVOTable(tapURL, adqlQuery); | |
128 | 128 | VOTableData data = voTableCtrl.getVOTableData(); |
129 | 129 | |
130 | 130 | List<Granule> granules; |
... | ... | @@ -137,8 +137,8 @@ public class EpnTapConnection implements EpnTapInterface { |
137 | 137 | public List<Granule> sendQuery(String tapURL, String schemaName, Query enumeratedQuery) |
138 | 138 | throws VOTableException { |
139 | 139 | String query = String.format(enumeratedQuery.toString(), schemaName); |
140 | - VOTableController voTableCtrl = new VOTableController(tapURL, query); | |
141 | - voTableCtrl.readTable(); | |
140 | + VOTableController voTableCtrl = new VOTableController(); | |
141 | + voTableCtrl.newVOTable(tapURL, query); | |
142 | 142 | VOTableData data = voTableCtrl.getVOTableData(); |
143 | 143 | Debug.writeObject("data", data); |
144 | 144 | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/EpnTapController.java
... | ... | @@ -53,15 +53,6 @@ public abstract class EpnTapController { |
53 | 53 | |
54 | 54 | |
55 | 55 | /** |
56 | - * Method constructor, which initialize servicesController, resultsController and mainView. | |
57 | - */ | |
58 | - public EpnTapController() { | |
59 | - String query = String.format(Queries.SELECT_ALL_TAP_SERVICES_WHERE_CORE, | |
60 | - ServiceCore.EPNCORE); | |
61 | - servicesCtrl = new VOTableController(Consts.DEFAULT_REGISTRY_URL, query); | |
62 | - } | |
63 | - | |
64 | - /** | |
65 | 56 | * @return The request controller. |
66 | 57 | */ |
67 | 58 | public RequestCtrl getRequestCtrl() { |
... | ... | @@ -97,7 +88,9 @@ public abstract class EpnTapController { |
97 | 88 | public void readServices() throws VOTableException { |
98 | 89 | // Here getServicesCtrl() is used instead of class field servicesCtrl to get the |
99 | 90 | // subclass field, since subclasses overrides getServicesCtrl(). |
100 | - getServicesCtrl().readTable(); | |
91 | + String query = String.format(Queries.SELECT_ALL_TAP_SERVICES_WHERE_CORE, | |
92 | + ServiceCore.EPNCORE); | |
93 | + getServicesCtrl().newVOTable(Consts.DEFAULT_REGISTRY_URL, query); | |
101 | 94 | } |
102 | 95 | |
103 | 96 | /** |
... | ... | @@ -114,7 +107,7 @@ public abstract class EpnTapController { |
114 | 107 | LOGGER.info("Sending query(ies) on " + StringJoiner.join(servicesUrls)); |
115 | 108 | for (int i = 0; i < servicesUrls.size(); i++) { |
116 | 109 | String query = getRequestCtrl().getQuery(services.getTableNames().get(i)); |
117 | - getResultsCtrl().updateVOTable(servicesUrls.get(i), query); | |
110 | + getResultsCtrl().appendVOTable(servicesUrls.get(i), query); | |
118 | 111 | } |
119 | 112 | |
120 | 113 | } | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/gui/resultpanel/ResultPanelCtrl.java
... | ... | @@ -80,9 +80,9 @@ public class ResultPanelCtrl extends VOTableController implements ResultPanelLis |
80 | 80 | } |
81 | 81 | |
82 | 82 | @Override |
83 | - public void updateVOTable(String newTargetURL, String newQuery) { | |
83 | + public void appendVOTable(String newTargetURL, String newQuery) { | |
84 | 84 | try { |
85 | - super.updateVOTable(newTargetURL, newQuery); | |
85 | + super.appendVOTable(newTargetURL, newQuery); | |
86 | 86 | } catch (VOTableException e) { |
87 | 87 | listener.displayError("Can not update the VOTable.", e); |
88 | 88 | } | ... | ... |
src/main/java/eu/omp/irap/vespa/epntapclient/service/ServiceCtrl.java
... | ... | @@ -151,8 +151,8 @@ public class ServiceCtrl { |
151 | 151 | * @throws VOTableException Can not get the VOTable. |
152 | 152 | */ |
153 | 153 | public static VOTABLE getVoTable(String query) throws VOTableException { |
154 | - VOTableController voTableCtrl = new VOTableController(Consts.DEFAULT_REGISTRY_URL, query); | |
155 | - voTableCtrl.readTable(); | |
154 | + VOTableController voTableCtrl = new VOTableController(); | |
155 | + voTableCtrl.newVOTable(Consts.DEFAULT_REGISTRY_URL, query); | |
156 | 156 | return voTableCtrl.getVOTable(); |
157 | 157 | } |
158 | 158 | ... | ... |