Commit 4bcbd19fd9746073f40abac439f3d503e064c272

Authored by Nathanael Jourdane
1 parent d11a0a1d
Exists in master

Fix imports

src/main/java/eu/omp/irap/vespa/epntapclient/gui/GUIController.java
@@ -24,9 +24,9 @@ import java.util.logging.Level; @@ -24,9 +24,9 @@ import java.util.logging.Level;
24 import java.util.logging.Logger; 24 import java.util.logging.Logger;
25 25
26 import eu.omp.irap.vespa.epntapclient.lib.EpnTapController; 26 import eu.omp.irap.vespa.epntapclient.lib.EpnTapController;
27 -import eu.omp.irap.vespa.epntapclient.lib.Queries;  
28 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException;  
29 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException; 27 +import eu.omp.irap.vespa.epntapclient.service.Queries;
  28 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException;
  29 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
30 30
31 /** 31 /**
32 * @author N. Jourdane 32 * @author N. Jourdane
src/main/java/eu/omp/irap/vespa/epntapclient/gui/ParamField.java
@@ -44,7 +44,7 @@ import com.google.gson.JsonArray; @@ -44,7 +44,7 @@ import com.google.gson.JsonArray;
44 import com.google.gson.JsonObject; 44 import com.google.gson.JsonObject;
45 import com.google.gson.JsonParser; 45 import com.google.gson.JsonParser;
46 46
47 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException; 47 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
48 import eu.omp.irap.vespa.epntapclient.votable.utils.Network; 48 import eu.omp.irap.vespa.epntapclient.votable.utils.Network;
49 49
50 /** 50 /**
src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapController.java
@@ -20,10 +20,11 @@ import java.util.HashMap; @@ -20,10 +20,11 @@ import java.util.HashMap;
20 import java.util.Map; 20 import java.util.Map;
21 import java.util.logging.Logger; 21 import java.util.logging.Logger;
22 22
  23 +import eu.omp.irap.vespa.epntapclient.service.Queries;
  24 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
  25 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException;
  26 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
23 import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController; 27 import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController;
24 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException;  
25 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException;  
26 -import eu.omp.irap.vespa.epntapclient.votable.utils.Consts;  
27 28
28 /** 29 /**
29 * The main controller which manage views and controllers. 30 * The main controller which manage views and controllers.
src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapFacade.java
@@ -22,6 +22,7 @@ import java.util.logging.Logger; @@ -22,6 +22,7 @@ import java.util.logging.Logger;
22 22
23 import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceCtrl; 23 import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceCtrl;
24 import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceException; 24 import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceException;
  25 +import eu.omp.irap.vespa.epntapclient.service.Service;
25 import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; 26 import eu.omp.irap.vespa.epntapclient.voresource.model.Resource;
26 27
27 /** 28 /**
@@ -35,8 +36,9 @@ public class EpnTapFacade implements EpnTapInterface { @@ -35,8 +36,9 @@ public class EpnTapFacade implements EpnTapInterface {
35 36
36 /* @see eu.omp.irap.vespa.epntapclient.epnTapLib.EpnTapInterface#getEPNVOResources() */ 37 /* @see eu.omp.irap.vespa.epntapclient.epnTapLib.EpnTapInterface#getEPNVOResources() */
37 @Override 38 @Override
38 - public List<Resource> getEPNVOResources() throws VOResourceException {  
39 - return VOResourceCtrl.getVOResources(); 39 + public List<Resource> getEPNVOResources(Service.ServiceType serviceType)
  40 + throws VOResourceException {
  41 + return VOResourceCtrl.getVOResources(serviceType);
40 } 42 }
41 43
42 /* 44 /*
@@ -44,9 +46,10 @@ public class EpnTapFacade implements EpnTapInterface { @@ -44,9 +46,10 @@ public class EpnTapFacade implements EpnTapInterface {
44 * eu.omp.irap.vespa.epntapclient.epnTapLib.EpnTapInterface#getEPNVOResources(java.util.List) 46 * eu.omp.irap.vespa.epntapclient.epnTapLib.EpnTapInterface#getEPNVOResources(java.util.List)
45 */ 47 */
46 @Override 48 @Override
47 - public List<Resource> getEPNVOResources(Map<String, String> keywords) 49 + public List<Resource> getEPNVOResources(Service.ServiceType serviceType,
  50 + Map<String, String> keywords)
48 throws VOResourceException { 51 throws VOResourceException {
49 - return VOResourceCtrl.getVOResources(keywords); 52 + return VOResourceCtrl.getVOResources(serviceType, keywords);
50 } 53 }
51 54
52 /* 55 /*
src/main/java/eu/omp/irap/vespa/epntapclient/lib/EpnTapInterface.java
@@ -20,6 +20,7 @@ import java.util.List; @@ -20,6 +20,7 @@ import java.util.List;
20 import java.util.Map; 20 import java.util.Map;
21 21
22 import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceException; 22 import eu.omp.irap.vespa.epntapclient.lib.resource.VOResourceException;
  23 +import eu.omp.irap.vespa.epntapclient.service.Service;
23 import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; 24 import eu.omp.irap.vespa.epntapclient.voresource.model.Resource;
24 25
25 /** 26 /**
@@ -28,13 +29,15 @@ import eu.omp.irap.vespa.epntapclient.voresource.model.Resource; @@ -28,13 +29,15 @@ import eu.omp.irap.vespa.epntapclient.voresource.model.Resource;
28 public interface EpnTapInterface { 29 public interface EpnTapInterface {
29 30
30 /** returns a set of VOResource elements (one per EPN-TAP service) */ 31 /** returns a set of VOResource elements (one per EPN-TAP service) */
31 - List<Resource> getEPNVOResources() throws VOResourceException; 32 + List<Resource> getEPNVOResources(Service.ServiceType serviceType)
  33 + throws VOResourceException;
32 34
33 /** 35 /**
34 * Returns a set of VOREsource elements (one per EPN-TAP service corresponding to the keywords). 36 * Returns a set of VOREsource elements (one per EPN-TAP service corresponding to the keywords).
35 * The way keywords are defined is still to be defined. 37 * The way keywords are defined is still to be defined.
36 */ 38 */
37 - List<Resource> getEPNVOResources(Map<String, String> keywords) throws VOResourceException; 39 + List<Resource> getEPNVOResources(Service.ServiceType serviceType,
  40 + Map<String, String> keywords) throws VOResourceException;
38 41
39 /** returns the VOResource element of the service identified by the ivoID. */ 42 /** returns the VOResource element of the service identified by the ivoID. */
40 Resource getEPNVOresource(String ivoid) throws VOResourceException; 43 Resource getEPNVOresource(String ivoid) throws VOResourceException;
src/main/java/eu/omp/irap/vespa/epntapclient/lib/ServicesManager.java
@@ -18,8 +18,9 @@ package eu.omp.irap.vespa.epntapclient.lib; @@ -18,8 +18,9 @@ package eu.omp.irap.vespa.epntapclient.lib;
18 18
19 import java.util.logging.Logger; 19 import java.util.logging.Logger;
20 20
  21 +import eu.omp.irap.vespa.epntapclient.service.Queries;
  22 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
21 import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController; 23 import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController;
22 -import eu.omp.irap.vespa.epntapclient.votable.utils.Consts;  
23 24
24 /** 25 /**
25 * @author N. Jourdane 26 * @author N. Jourdane
src/main/java/eu/omp/irap/vespa/epntapclient/service/Service.java
@@ -19,7 +19,7 @@ package eu.omp.irap.vespa.epntapclient.service; @@ -19,7 +19,7 @@ package eu.omp.irap.vespa.epntapclient.service;
19 /** 19 /**
20 * @author N. Jourdane 20 * @author N. Jourdane
21 */ 21 */
22 -public class ServiceModel { 22 +public class Service {
23 23
24 private String ivoid; 24 private String ivoid;
25 25
@@ -60,10 +60,10 @@ public class ServiceModel { @@ -60,10 +60,10 @@ public class ServiceModel {
60 } 60 }
61 61
62 62
63 - private ServiceModel() { 63 + private Service() {
64 } 64 }
65 65
66 - ServiceModel(String ivoid) { 66 + Service(String ivoid) {
67 this.ivoid = ivoid; 67 this.ivoid = ivoid;
68 } 68 }
69 69
src/main/java/eu/omp/irap/vespa/epntapclient/service/ServiceCtrl.java
@@ -41,9 +41,9 @@ public class ServiceCtrl { @@ -41,9 +41,9 @@ public class ServiceCtrl {
41 public static final String DATE_FORMAT = "yyyy/MM/dd HH:mm:ss"; 41 public static final String DATE_FORMAT = "yyyy/MM/dd HH:mm:ss";
42 42
43 43
44 - public final ServiceModel getServiceFromResource(ServiceModel.ServiceType serviceType, 44 + public final Service getServiceFromResource(Service.ServiceType serviceType,
45 Resource resource) { 45 Resource resource) {
46 - ServiceModel service = new ServiceModel(resource.getIdentifier()); 46 + Service service = new Service(resource.getIdentifier());
47 service.setTitle(resource.getTitle()); 47 service.setTitle(resource.getTitle());
48 service.setShortName(resource.getShortName()); 48 service.setShortName(resource.getShortName());
49 StringJoiner types = new StringJoiner(", "); 49 StringJoiner types = new StringJoiner(", ");
@@ -74,11 +74,11 @@ public class ServiceCtrl { @@ -74,11 +74,11 @@ public class ServiceCtrl {
74 return sdf.format(date.toGregorianCalendar().getTime()); 74 return sdf.format(date.toGregorianCalendar().getTime());
75 } 75 }
76 76
77 - public final List<ServiceModel> getServiceFromVOTableData(ServiceModel.ServiceType serviceType, 77 + public final List<Service> getServiceFromVOTableData(Service.ServiceType serviceType,
78 VOTableData data) { 78 VOTableData data) {
79 - List<ServiceModel> services = new ArrayList<>(); 79 + List<Service> services = new ArrayList<>();
80 for (int i = 0; i < data.getNbRows(); i++) { 80 for (int i = 0; i < data.getNbRows(); i++) {
81 - ServiceModel service = new ServiceModel((String) data.getCell(i, "ivoid")); 81 + Service service = new Service((String) data.getCell(i, "ivoid"));
82 service.setTitle((String) data.getCell(i, "res_title")); 82 service.setTitle((String) data.getCell(i, "res_title"));
83 service.setShortName((String) data.getCell(i, "short_name")); 83 service.setShortName((String) data.getCell(i, "short_name"));
84 service.setType((String) data.getCell(i, "content_type")); 84 service.setType((String) data.getCell(i, "content_type"));
src/main/java/eu/omp/irap/vespa/epntapclient/votable/Consts.java
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 * <http://www.gnu.org/licenses/>. 14 * <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17 -package eu.omp.irap.vespa.epntapclient.votable.utils; 17 +package eu.omp.irap.vespa.epntapclient.votable;
18 18
19 /** 19 /**
20 * This class defines widely-used constants. 20 * This class defines widely-used constants.
src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableApp.java
@@ -25,7 +25,6 @@ import javax.swing.SwingUtilities; @@ -25,7 +25,6 @@ import javax.swing.SwingUtilities;
25 import com.google.gson.Gson; 25 import com.google.gson.Gson;
26 26
27 import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController; 27 import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableController;
28 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException;  
29 import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView; 28 import eu.omp.irap.vespa.epntapclient.votable.view.VOTableView;
30 29
31 /** 30 /**
src/main/java/eu/omp/irap/vespa/epntapclient/votable/VOTableException.java
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 * <http://www.gnu.org/licenses/>. 14 * <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17 -package eu.omp.irap.vespa.epntapclient.votable.controller; 17 +package eu.omp.irap.vespa.epntapclient.votable;
18 18
19 import java.io.IOException; 19 import java.io.IOException;
20 20
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableController.java
@@ -22,15 +22,16 @@ import java.util.SortedMap; @@ -22,15 +22,16 @@ import java.util.SortedMap;
22 import java.util.TreeMap; 22 import java.util.TreeMap;
23 import java.util.logging.Logger; 23 import java.util.logging.Logger;
24 24
25 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException;  
26 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.CantModifyVOTableException;  
27 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.ErrorMessageInVOTableException;  
28 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.SeveralResourcesException;  
29 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.SeveralTablesException;  
30 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException; 25 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
  26 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException;
  27 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
  28 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.CantModifyVOTableException;
  29 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.ErrorMessageInVOTableException;
  30 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.SeveralResourcesException;
  31 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.SeveralTablesException;
  32 +import eu.omp.irap.vespa.epntapclient.votable.data.VOTableDataCtrl;
31 import eu.omp.irap.vespa.epntapclient.votable.model.Table; 33 import eu.omp.irap.vespa.epntapclient.votable.model.Table;
32 import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE; 34 import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE;
33 -import eu.omp.irap.vespa.epntapclient.votable.utils.Consts;  
34 import eu.omp.irap.vespa.epntapclient.votable.utils.Network; 35 import eu.omp.irap.vespa.epntapclient.votable.utils.Network;
35 import eu.omp.irap.vespa.epntapclient.votable.view.VOTableViewListener; 36 import eu.omp.irap.vespa.epntapclient.votable.view.VOTableViewListener;
36 37
@@ -113,11 +114,11 @@ public class VOTableController implements VOTableViewListener { @@ -113,11 +114,11 @@ public class VOTableController implements VOTableViewListener {
113 114
114 Table table = (Table) voTable.getRESOURCE().get(0).getLINKAndTABLEOrRESOURCE().get(0); 115 Table table = (Table) voTable.getRESOURCE().get(0).getLINKAndTABLEOrRESOURCE().get(0);
115 116
116 - VOTableDataParser dataParser; 117 + VOTableDataCtrl dataParser;
117 try { 118 try {
118 - dataParser = new VOTableDataParser(table);  
119 - voTableColumns = dataParser.getColumnsName();  
120 - voTableData = dataParser.getDataArray(); 119 + dataParser = new VOTableDataCtrl(table);
  120 + voTableColumns = dataParser.getData().getColumnsName();
  121 + voTableData = dataParser.getData().getData();
121 } catch (IOException e) { 122 } catch (IOException e) {
122 throw new CantModifyVOTableException(voTablePath, e); 123 throw new CantModifyVOTableException(voTablePath, e);
123 } 124 }
src/main/java/eu/omp/irap/vespa/epntapclient/votable/controller/VOTableParser.java
@@ -36,9 +36,9 @@ import org.w3c.dom.Document; @@ -36,9 +36,9 @@ import org.w3c.dom.Document;
36 import org.w3c.dom.NamedNodeMap; 36 import org.w3c.dom.NamedNodeMap;
37 import org.xml.sax.SAXException; 37 import org.xml.sax.SAXException;
38 38
39 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException;  
40 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.CantModifyVOTableException;  
41 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantDisplayVOTableException.VOTableIsNotValidException; 39 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException;
  40 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.CantModifyVOTableException;
  41 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantDisplayVOTableException.VOTableIsNotValidException;
42 import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE; 42 import eu.omp.irap.vespa.epntapclient.votable.model.VOTABLE;
43 43
44 /** 44 /**
src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Debug.java
@@ -23,6 +23,8 @@ import java.util.logging.Logger; @@ -23,6 +23,8 @@ import java.util.logging.Logger;
23 import com.google.gson.Gson; 23 import com.google.gson.Gson;
24 import com.google.gson.GsonBuilder; 24 import com.google.gson.GsonBuilder;
25 25
  26 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
  27 +
26 /** 28 /**
27 * @author N. Jourdane 29 * @author N. Jourdane
28 */ 30 */
src/main/java/eu/omp/irap/vespa/epntapclient/votable/utils/Network.java
@@ -31,14 +31,14 @@ import java.util.Map; @@ -31,14 +31,14 @@ import java.util.Map;
31 import java.util.logging.Level; 31 import java.util.logging.Level;
32 import java.util.logging.Logger; 32 import java.util.logging.Logger;
33 33
34 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException;  
35 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.BadResponseCodeException;  
36 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantGetErrorStream;  
37 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantGetResponseCode;  
38 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantOpenConnectionException;  
39 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.CantWriteQueryResultException;  
40 -import eu.omp.irap.vespa.epntapclient.votable.controller.VOTableException.CantSendQueryException.UnsupportedParamEncodingException;  
41 -import eu.omp.irap.vespa.epntapclient.votable.utils.Strings.StringJoiner; 34 +import eu.omp.irap.vespa.epntapclient.votable.Consts;
  35 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException;
  36 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.BadResponseCodeException;
  37 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantGetErrorStream;
  38 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantGetResponseCode;
  39 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantOpenConnectionException;
  40 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.CantWriteQueryResultException;
  41 +import eu.omp.irap.vespa.epntapclient.votable.VOTableException.CantSendQueryException.UnsupportedParamEncodingException;
42 42
43 /** 43 /**
44 * @author N. Jourdane 44 * @author N. Jourdane