diff --git a/gcube-geonetwork-client/pom.xml b/gcube-geonetwork-client/pom.xml
index 7fe6b7a..362eaa7 100644
--- a/gcube-geonetwork-client/pom.xml
+++ b/gcube-geonetwork-client/pom.xml
@@ -6,16 +6,15 @@
org.gcube.spatial.data
1.0.0-SNAPSHOT
- org.gcube.spatial.data
gcube-geonetwork-client
0.0.1-SNAPSHOT
gCube GeoNetwork Client
- scm:git:${gitBaseUrl}/gFeed
- scm:git:${gitBaseUrl}/gFeed
- ${gitBaseUrl}/gFeed
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ ${gitBaseUrl}/gcube-sdi-suite
diff --git a/gcube-geoserver-client/pom.xml b/gcube-geoserver-client/pom.xml
index c20646a..0e56f4c 100644
--- a/gcube-geoserver-client/pom.xml
+++ b/gcube-geoserver-client/pom.xml
@@ -6,21 +6,35 @@
org.gcube.spatial.data
1.0.0-SNAPSHOT
- org.gcube.spatial.data
gcube-geoserver-client
0.0.1-SNAPSHOT
Gcube GeoServer client
- scm:git:${gitBaseUrl}/gFeed
- scm:git:${gitBaseUrl}/gFeed
- ${gitBaseUrl}/gFeed
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ ${gitBaseUrl}/gcube-sdi-suite
-
+
+ sdi-interface
+ org.gcube.spatial.data
+
+
+
+ org.gcube.common
+ authorization-client
+
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+
+
diff --git a/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GSRESTClient.java b/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GSRESTClient.java
new file mode 100644
index 0000000..1fff64d
--- /dev/null
+++ b/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GSRESTClient.java
@@ -0,0 +1,28 @@
+package org.gcube.spatial.data.clients.geoserver;
+
+import java.util.List;
+
+public interface GSRESTClient {
+
+
+ // ********** READ OPS
+
+ // WS
+
+ public List getWorkspaces();
+
+ // DS
+ public List getDataStoresInWorkspace(String ws);
+
+ // SLD
+ public List getStyles();
+ public List getStylesInWorkspace(String ws);
+ public List getStylesByLayer(String layer);
+
+ // *********** CREATE OPS
+ public void createWorkspace(String ws);
+
+ public void createStyle(String name,String content);
+
+
+}
diff --git a/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GSRESTClientImpl.java b/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GSRESTClientImpl.java
new file mode 100644
index 0000000..94ad8f3
--- /dev/null
+++ b/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GSRESTClientImpl.java
@@ -0,0 +1,22 @@
+package org.gcube.spatial.data.clients.geoserver;
+
+import java.util.List;
+
+import org.gcube.spatial.data.clients.GenericLoginClient;
+import org.gcube.spatial.data.clients.model.ConnectionDescriptor;
+
+import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor;
+
+public class GSRESTClientImpl implements GSRESTClient,GenericLoginClient{
+
+ private ConnectionDescriptor conn;
+ WebTarget target=
+
+ public GSRESTClientImpl(ConnectionDescriptor desc) {
+ this.conn=desc;
+ }
+
+
+
+
+}
diff --git a/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GeoServerClient.java b/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GeoServerClient.java
new file mode 100644
index 0000000..1cf3c44
--- /dev/null
+++ b/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GeoServerClient.java
@@ -0,0 +1,22 @@
+package org.gcube.spatial.data.clients.geoserver;
+
+import org.gcube.spatial.data.clients.SDIGenericClient;
+import org.gcube.spatial.data.clients.model.ClientInfo;
+import org.gcube.spatial.data.clients.model.ConnectionDescriptor;
+
+public class GeoServerClient implements SDIGenericClient{
+
+
+ @Override
+ public ClientInfo getInfo() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getRESTClient(ConnectionDescriptor conn) {
+ return new GSRESTClientImpl(conn);
+ }
+
+
+}
diff --git a/sdi-generic-client/pom.xml b/sdi-generic-client/pom.xml
index 9cbcd64..717481d 100644
--- a/sdi-generic-client/pom.xml
+++ b/sdi-generic-client/pom.xml
@@ -11,15 +11,34 @@
Generic SDI Client
-
- scm:git:${gitBaseUrl}/gFeed
- scm:git:${gitBaseUrl}/gFeed
- ${gitBaseUrl}/gFeed
+
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ ${gitBaseUrl}/gcube-sdi-suite
-
+
+ sdi-interface
+ org.gcube.spatial.data
+
+
+
+ org.gcube.common
+ authorization-client
+
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+
diff --git a/sdi-generic-client/src/main/java/org/gcube/spatial/data/clients/AbstractGenericClient.java b/sdi-generic-client/src/main/java/org/gcube/spatial/data/clients/AbstractGenericClient.java
index 9dec254..511770c 100644
--- a/sdi-generic-client/src/main/java/org/gcube/spatial/data/clients/AbstractGenericClient.java
+++ b/sdi-generic-client/src/main/java/org/gcube/spatial/data/clients/AbstractGenericClient.java
@@ -1,12 +1,76 @@
package org.gcube.spatial.data.clients;
+import java.io.IOException;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.core.Response;
+import org.glassfish.jersey.client.ClientProperties;
+
+import org.gcube.spatial.data.clients.model.ConnectionDescriptor;
+import org.gcube.spatial.data.sdi.model.faults.RemoteException;
+
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
import lombok.extern.slf4j.Slf4j;
@Slf4j
public abstract class AbstractGenericClient {
+ private static ObjectMapper mapper = new ObjectMapper();
+
+ static {
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
+ mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS,false);
+ mapper.configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, false);
+ mapper.setSerializationInclusion(Include.NON_NULL);
+ }
+
+
+ protected ConnectionDescriptor conn;
+ protected Client client;
+
+ public AbstractGenericClient(ConnectionDescriptor conn) {
+
+ }
+
+
+ private synchronized Client getWebClient() {
+ if(client==null) {
+ client = ClientBuilder.newClient()
+ .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+// client.register(MultiPartFeature.class);
+ }
+ return client;
+ }
+
+
+
+
+
+ protected static T check(Response resp, Class clazz) throws RemoteException{
+ if(resp.getStatus()<200||resp.getStatus()>=300) {
+ String remoteMessage=resp.readEntity(String.class);
+ Integer httpCode=resp.getStatus();
+ RemoteException e=new RemoteException("RESP STATUS IS "+httpCode+". Message : "+remoteMessage);
+ e.setRemoteMessage(remoteMessage);
+ e.setResponseHTTPCode(httpCode);
+ throw e;
+ }else {
+ if(clazz==null) return null;
+ String respString=resp.readEntity(String.class);
+ try {
+ return mapper.readValue(respString, clazz);
+ } catch (IOException e) {
+ throw new RemoteException("Unable to parse response from Zenodo. Content was : \n "+respString,e);
+ }
+ }
+ }
}
diff --git a/sdi-interface/pom.xml b/sdi-interface/pom.xml
index 83fb6bf..2c40469 100644
--- a/sdi-interface/pom.xml
+++ b/sdi-interface/pom.xml
@@ -19,10 +19,10 @@
-
- scm:git:${gitBaseUrl}/${project.artifactId}.git
- scm:git:${gitBaseUrl}/${project.artifactId}.git
- ${gitBaseUrl}/${project.artifactId}.git
+
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ ${gitBaseUrl}/gcube-sdi-suite
diff --git a/sdi-interface/src/main/java/org/gcube/spatial/data/clients/GenericLoginClient.java b/sdi-interface/src/main/java/org/gcube/spatial/data/clients/GenericLoginClient.java
new file mode 100644
index 0000000..e4f8d66
--- /dev/null
+++ b/sdi-interface/src/main/java/org/gcube/spatial/data/clients/GenericLoginClient.java
@@ -0,0 +1,12 @@
+package org.gcube.spatial.data.clients;
+
+import org.gcube.spatial.data.sdi.model.gn.LoginLevel;
+
+public interface GenericLoginClient {
+
+
+ public void login();
+
+ public void login(LoginLevel lvl);
+
+}
diff --git a/sdi-interface/src/main/java/org/gcube/spatial/data/sdi/model/faults/RemoteException.java b/sdi-interface/src/main/java/org/gcube/spatial/data/sdi/model/faults/RemoteException.java
index 412210e..80b4547 100644
--- a/sdi-interface/src/main/java/org/gcube/spatial/data/sdi/model/faults/RemoteException.java
+++ b/sdi-interface/src/main/java/org/gcube/spatial/data/sdi/model/faults/RemoteException.java
@@ -31,4 +31,24 @@ public class RemoteException extends Exception {
// TODO Auto-generated constructor stub
}
+private String remoteMessage=null;
+
+ private Integer responseHTTPCode=0;
+
+ public void setResponseHTTPCode(Integer responseHTTPCode) {
+ this.responseHTTPCode = responseHTTPCode;
+ }
+
+ public Integer getResponseHTTPCode() {
+ return responseHTTPCode;
+ }
+
+ public String getRemoteMessage() {
+ return remoteMessage;
+ }
+
+ public void setRemoteMessage(String remoteMessage) {
+ this.remoteMessage = remoteMessage;
+ }
+
}
diff --git a/sdi-library/pom.xml b/sdi-library/pom.xml
index b7c932b..21ae2c3 100644
--- a/sdi-library/pom.xml
+++ b/sdi-library/pom.xml
@@ -11,9 +11,9 @@
Client library to interact with gCube SDI Service
- scm:git:${gitBaseUrl}/gFeed
- scm:git:${gitBaseUrl}/gFeed
- ${gitBaseUrl}/gFeed
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ ${gitBaseUrl}/gcube-sdi-suite
diff --git a/sdi-service/pom.xml b/sdi-service/pom.xml
index 6be0056..62e92d2 100644
--- a/sdi-service/pom.xml
+++ b/sdi-service/pom.xml
@@ -14,9 +14,9 @@
2.25.1
- scm:git:${gitBaseUrl}/gFeed
- scm:git:${gitBaseUrl}/gFeed
- ${gitBaseUrl}/gFeed
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ scm:git:${gitBaseUrl}/gcube-sdi-suite
+ ${gitBaseUrl}/gcube-sdi-suite