diff --git a/gcube-geoserver-client/pom.xml b/gcube-geoserver-client/pom.xml
index 126058e..bdb7614 100644
--- a/gcube-geoserver-client/pom.xml
+++ b/gcube-geoserver-client/pom.xml
@@ -1,4 +1,5 @@
-
4.0.0
@@ -10,29 +11,38 @@
0.0.1-SNAPSHOT
Gcube GeoServer client
-
+
scm:git:${gitBaseUrl}/gcube-sdi-suite
scm:git:${gitBaseUrl}/gcube-sdi-suite
${gitBaseUrl}/gcube-sdi-suite
-
-
+
+
sdi-generic-client
org.gcube.spatial.data
-
+
-
+
org.gcube.common
authorization-client
-
-
+
+
+
- org.glassfish.jersey.media
- jersey-media-json-jackson
+ com.googlecode.json-simple
+ json-simple
+ 1.1.1
+
+
+
+
+ com.jayway.jsonpath
+ json-path
+ 2.5.0
@@ -42,9 +52,9 @@
sdi-test-commons
org.gcube.spatial.data
test
-
+
-
+
Java library used to communicate with GeoServer instances in D4Science infrastructure.
\ No newline at end of file
diff --git a/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/DataStoreRegistrationRequest.java b/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/DataStoreRegistrationRequest.java
new file mode 100644
index 0000000..d7c838e
--- /dev/null
+++ b/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/DataStoreRegistrationRequest.java
@@ -0,0 +1,49 @@
+package org.gcube.spatial.data.clients.geoserver;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.json.simple.JSONObject;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+@Data
+@XmlRootElement(name = "datastore")
+public class DataStoreRegistrationRequest {
+
+ @Data
+ @AllArgsConstructor
+ private static class Parameter{
+ private String key;
+ @XmlElement(name="$")
+ private String value;
+ }
+
+ private JSONObject datastore=new JSONObject();
+
+ public DataStoreRegistrationRequest() {
+ }
+
+ public DataStoreRegistrationRequest(String name) {
+ setName(name);
+ }
+
+ public void setName(String name) {
+ datastore.put("name",name);
+ }
+
+ public void setParameters(Map params) {
+ ArrayList paramList=new ArrayList();
+
+ params.forEach((String k,String v)->{paramList.add(new Parameter(k,v));});
+
+ datastore.put("connectionParameters", new JSONObject().put("entry", paramList));
+
+ }
+
+
+}
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
index 76af48c..9fbbcb2 100644
--- 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
@@ -2,6 +2,7 @@ package org.gcube.spatial.data.clients.geoserver;
import java.util.List;
+import org.gcube.spatial.data.clients.GenericLoginClient;
//import org.apache.commons.httpclient.NameValuePair;
//import org.gcube.application.geoportal.service.engine.RESTFeatureType;
//import org.gcube.application.geoportal.service.engine.RESTLayer;
@@ -11,7 +12,7 @@ import org.json.simple.JSONObject;
//import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.UploadMethod;
//import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
-public interface GSRESTClient {
+public interface GSRESTClient extends GenericLoginClient{
// Management
@@ -46,14 +47,16 @@ public interface GSRESTClient {
// FeatureTypes
-// public JSONObject getFeatureType(JSONObject layer)
- /**
- * RESTLayer l=reader.getLayer(workspace, toSetLayerName);
- RESTFeatureType f= reader.getFeatureType(l);
- * @param ws
- * @throws RemoteException
- * @throws Exception
- */
+ public List getFeatureTypesInWorkspace(String workspace)throws RemoteException,Exception;
+ public List getFeatureTypesInDataStore(String workspace,String datastore)throws RemoteException,Exception;
+ public JSONObject getFeatureType(String workspace,String featureName)throws RemoteException,Exception;
+
+
+ //Layers
+ public List getLayers()throws RemoteException,Exception;
+ public List getLayers(String workspace)throws RemoteException, Exception;
+ public JSONObject getLayer(String layerName)throws RemoteException, Exception;
+ public JSONObject getLayerInWorkspace(String ws,String layerName)throws RemoteException, Exception;
// *********** CREATE OPS
public void createWorkspace(String ws)throws RemoteException,Exception;
@@ -93,25 +96,24 @@ public interface GSRESTClient {
* @throws Exception
*/
+ /**
+ * Publish a DS described in @param parameters. Parameters vary depending on DS type. See https://docs.geoserver.org/latest/en/api/#1.0.0/datastores.yaml for more details.
+ *
+ * @param ws
+ * @param parameters
+ * @return
+ */
+ public void publishDataStore(String ws, JSONObject parameters)throws RemoteException,Exception;
+
+
// // +********** DELETE OPS
- /**
- * publisher.removeWorkspace(toDelete.getWorkspace(), true);
- * @param ws
- * @throws RemoteException
- * @throws Exception
- */
- public void deleteWorkspace(String ws)throws RemoteException,Exception;
- public void deleteStyle(String style)throws RemoteException,Exception;
+
+ public void deleteWorkspace(String ws, boolean recurse)throws RemoteException,Exception;
+ public void deleteStyle(String style, boolean purgeSLDFile,boolean updateReferences)throws RemoteException,Exception;
- /**
- * publisher.removeDatastore(toDelete.getWorkspace(), toDelete.getStore(), true);
- * @param ds
- * @throws RemoteException
- * @throws Exception
- */
- public void deleteDataStore(String ds)throws RemoteException,Exception;
- public void deleteLayer(String layer)throws RemoteException,Exception;
+ public void deleteDataStore(String ds, boolean recurse)throws RemoteException,Exception;
+ public void deleteLayer(String layer,boolean recurse)throws RemoteException,Exception;
}
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
index 8f576c1..678fe41 100644
--- 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
@@ -1,17 +1,17 @@
package org.gcube.spatial.data.clients.geoserver;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;
+import org.gcube.common.gxrest.request.GXWebTargetAdapterRequest;
import org.gcube.spatial.data.clients.AbstractGenericRESTClient;
-import org.gcube.spatial.data.clients.GenericLoginClient;
import org.gcube.spatial.data.clients.model.ConnectionDescriptor;
-import org.gcube.spatial.data.sdi.model.credentials.Credentials;
import org.gcube.spatial.data.sdi.model.faults.RemoteException;
-import org.gcube.spatial.data.sdi.model.gn.LoginLevel;
-import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
import org.json.simple.JSONObject;
import com.jayway.jsonpath.Configuration;
@@ -22,7 +22,7 @@ import com.jayway.jsonpath.Option;
import lombok.extern.slf4j.Slf4j;
@Slf4j
-public class GSRESTClientImpl extends AbstractGenericRESTClient implements GSRESTClient,GenericLoginClient{
+public class GSRESTClientImpl extends AbstractGenericRESTClient implements GSRESTClient{
private static final String API_BASE_PATH="rest";
@@ -30,6 +30,8 @@ public class GSRESTClientImpl extends AbstractGenericRESTClient implements GSRES
private static final String DATASTORE_BASE_PATH="datastores";
private static final String STYLES_BASE_PATH="styles";
private static final String LAYERS_BASE_PATH="layers";
+ private static final String FEATURES_BASE_PATH="featuretype";
+
static Configuration JSON_PATH_ALWAYS_LIST_CONFIG= Configuration.builder().options(Option.ALWAYS_RETURN_LIST,Option.SUPPRESS_EXCEPTIONS,Option.DEFAULT_PATH_LEAF_TO_NULL).build();
@@ -42,27 +44,6 @@ public class GSRESTClientImpl extends AbstractGenericRESTClient implements GSRES
setBasePath(API_BASE_PATH);
-// log.info("Connecting to GS @ "+conn.getEndpoint());
-//
-// Credentials cr=conn.getCredentials().get(0);
-// log.debug("Using "+cr);
-// register(HttpAuthenticationFeature.universal(cr.getUsername(), cr.getPassword()));
-
-
- }
-
-
-
-
- @Override
- public void login() {
-
- }
-
- @Override
- public void login(LoginLevel lvl) {
- // TODO Auto-generated method stub
-
}
//************************** READ OPS
@@ -70,33 +51,33 @@ public class GSRESTClientImpl extends AbstractGenericRESTClient implements GSRES
@Override
public JSONObject getWorkspaces() throws RemoteException,Exception {
- return get(WS_BASE_PATH);
+ return get(WS_BASE_PATH,JSONObject.class);
}
@Override
public JSONObject getWorkspace(String workspace) throws RemoteException, Exception {
- return get(WS_BASE_PATH+"/"+workspace);
+ return get(WS_BASE_PATH+"/"+workspace,JSONObject.class);
}
@Override
public JSONObject getDataStoresInWorkspace(String ws) throws RemoteException, Exception {
- return get(WS_BASE_PATH+"/"+ws+"/datastores");
+ return get(WS_BASE_PATH+"/"+ws+"/"+DATASTORE_BASE_PATH,JSONObject.class);
}
@Override
public JSONObject getStyles() throws RemoteException, Exception {
- return get(STYLES_BASE_PATH);
+ return get(STYLES_BASE_PATH,JSONObject.class);
}
@Override
public JSONObject getStylesByLayer(String layer) throws RemoteException, Exception {
- return get(LAYERS_BASE_PATH+"/"+layer+"/styles");
+ return get(LAYERS_BASE_PATH+"/"+layer+"/"+STYLES_BASE_PATH,JSONObject.class);
}
@Override
public JSONObject getStylesInWorkspace(String ws) throws RemoteException, Exception {
- return get(WS_BASE_PATH+"/"+ws+"/styles");
+ return get(WS_BASE_PATH+"/"+ws+"/"+STYLES_BASE_PATH,JSONObject.class);
}
@Override
@@ -134,59 +115,124 @@ public class GSRESTClientImpl extends AbstractGenericRESTClient implements GSRES
@Override
public JSONObject getDataStore(String workspace, String dsName) throws RemoteException, Exception {
- // TODO Auto-generated method stub
- return null;
+ return get(WS_BASE_PATH+"/"+workspace+"/"+DATASTORE_BASE_PATH+"/"+dsName,JSONObject.class);
}
@Override
public String getSLD(String styleName) throws RemoteException, Exception {
- // TODO Auto-generated method stub
- return null;
+ return get(STYLES_BASE_PATH+"/"+styleName,String.class,"application/vnd.ogc.sld+xml");
+ }
+
+
+
+ @Override
+ public JSONObject getFeatureType(String workspace, String featureName) throws RemoteException, Exception {
+ return get(WS_BASE_PATH+"/"+workspace+"/"+FEATURES_BASE_PATH+"/"+featureName,JSONObject.class);
+ }
+
+ @Override
+ public List getFeatureTypesInDataStore(String workspace, String datastore)
+ throws RemoteException, Exception {
+ DocumentContext sourceCtx=JsonPath.using(JSON_PATH_ALWAYS_LIST_CONFIG).parse(
+ get(WS_BASE_PATH+"/"+workspace+"/"+DATASTORE_BASE_PATH+"/"+datastore+"/"+FEATURES_BASE_PATH));
+ return sourceCtx.read("$..name");
+ }
+
+
+ @Override
+ public List getFeatureTypesInWorkspace(String workspace) throws RemoteException, Exception {
+ DocumentContext sourceCtx=JsonPath.using(JSON_PATH_ALWAYS_LIST_CONFIG).parse(
+ get(WS_BASE_PATH+"/"+workspace+"/"+FEATURES_BASE_PATH));
+ return sourceCtx.read("$..name");
+ }
+
+
+ @Override
+ public JSONObject getLayer(String layerName) throws RemoteException, Exception {
+ return get(LAYERS_BASE_PATH+"/"+layerName,JSONObject.class);
+ }
+
+
+ @Override
+ public JSONObject getLayerInWorkspace(String ws, String layerName) throws RemoteException, Exception {
+ return get(WS_BASE_PATH+"/"+ws+"/"+LAYERS_BASE_PATH+"/"+layerName,JSONObject.class);
+ }
+
+
+ @Override
+ public List getLayers() throws RemoteException, Exception {
+ DocumentContext sourceCtx=JsonPath.using(JSON_PATH_ALWAYS_LIST_CONFIG).parse(
+ get(LAYERS_BASE_PATH).toString());
+ return sourceCtx.read("$..name");
+ }
+
+
+ @Override
+ public List getLayers(String workspace) throws RemoteException, Exception {
+ DocumentContext sourceCtx=JsonPath.using(JSON_PATH_ALWAYS_LIST_CONFIG).parse(
+ get(WS_BASE_PATH+"/"+workspace+"/"+LAYERS_BASE_PATH));
+ return sourceCtx.read("$..name");
}
//************* DELETE OPS
+
+
@Override
- public void deleteWorkspace(String ws) throws RemoteException, Exception {
- delete(WS_BASE_PATH+"/"+ws);
+ public void deleteWorkspace(String ws,boolean recurse) throws RemoteException, Exception {
+ check(resolve().path(WS_BASE_PATH+"/"+ws).queryParams(Collections.singletonMap("recurse", new Object[] {recurse})).delete(),null);
}
+
+
@Override
- public void deleteStyle(String style) throws RemoteException, Exception {
- delete(STYLES_BASE_PATH+"/"+style);
+ public void deleteStyle(String style,boolean purgeSLD,boolean updateReferences) throws RemoteException, Exception {
+ Map params=new HashMap<>();
+ params.put("recurse", new Object[] {updateReferences});
+ params.put("purge", new Object[] {purgeSLD});
+ check(resolve().path(STYLES_BASE_PATH+"/"+style).queryParams(params).delete(),null);
}
+
@Override
- public void deleteDataStore(String ds) throws RemoteException, Exception {
- delete(DATASTORE_BASE_PATH+"/"+ds);
+ public void deleteDataStore(String ds,boolean recurse) throws RemoteException, Exception {
+ check(resolve().path(DATASTORE_BASE_PATH+"/"+ds).queryParams(Collections.singletonMap("recurse", new Object[] {recurse})).delete(),null);
}
+
+
@Override
- public void deleteLayer(String layer) throws RemoteException, Exception {
- delete(LAYERS_BASE_PATH+"/"+layer);
+ public void deleteLayer(String layer,boolean recurse) throws RemoteException, Exception {
+ check(resolve().path(DATASTORE_BASE_PATH+"/"+layer).queryParams(Collections.singletonMap("recurse", new Object[] {recurse})).delete(),null);
}
//************************* CREATE OPS
-//
-// @Override
-// public void createStyle(String name, String content) throws RemoteException, Exception {
-// // TODO Auto-generated method stub
-//
-// }
-//
+
@Override
public void createWorkspace(String ws) throws RemoteException, Exception {
post(WS_BASE_PATH,Entity.entity(new JSONObject().put("name", ws),MediaType.APPLICATION_JSON));
}
+
+ @Override
+ public void publishDataStore(String ws, JSONObject parameters) throws Exception {
+ post(WS_BASE_PATH+"/"+ws+"/"+DATASTORE_BASE_PATH, Entity.entity(parameters, MediaType.APPLICATION_JSON_TYPE));
+ }
+
+
+
-
-
+ //************************* BASIC
@Override
public boolean exist() {
- // TODO Auto-generated method stub
- return false;
+ try {
+ GXWebTargetAdapterRequest request =GXWebTargetAdapterRequest.newHTTPSRequest(getConn().getEndpoint());
+ check(request.get(),null);
+ return true;
+ }catch(Exception e) {
+ return false;
+ }
}
diff --git a/gcube-geoserver-client/src/test/java/org/gcube/spatial/data/clients/geoserver/GSTests.java b/gcube-geoserver-client/src/test/java/org/gcube/spatial/data/clients/geoserver/GSTests.java
index 7721753..021d500 100644
--- a/gcube-geoserver-client/src/test/java/org/gcube/spatial/data/clients/geoserver/GSTests.java
+++ b/gcube-geoserver-client/src/test/java/org/gcube/spatial/data/clients/geoserver/GSTests.java
@@ -3,12 +3,16 @@ package org.gcube.spatial.data.clients.geoserver;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
+import java.util.Collections;
import java.util.UUID;
+import javax.sound.midi.SysexMessage;
+
import org.gcube.sdi.test.GCubeSDITest;
import org.gcube.spatial.data.clients.SDIGenericClient;
import org.gcube.spatial.data.clients.model.engine.Engine;
import org.gcube.spatial.data.sdi.model.faults.RemoteException;
+import org.json.simple.JSONObject;
import org.junit.Test;
public class GSTests extends GCubeSDITest{
@@ -20,32 +24,87 @@ public class GSTests extends GCubeSDITest{
return (GSRESTClient) obj.getRESTClient();
}
+ @Test
+ public void basics() throws RemoteException, Exception {
+ assumeTrue(isTestInfrastructureEnabled());
+ GSRESTClient client=getClient();
+ assertTrue(client.exist());
+ }
+
+
@Test
public void gets() throws RemoteException, Exception {
assumeTrue(isTestInfrastructureEnabled());
-
-
+
+
GSRESTClient client=getClient();
- for(String ws : client.getWorkspaceNames()){
- try {
+ client.authenticate();
+ client.getWorkspaceNames().forEach((String ws)->{
+ try {
+ if(ws!=null) {
+ System.out.println("************************************ WS ***************************");
System.out.println(client.getWorkspace(ws));
- System.out.println(client.getStylesNamesinWorkspace(ws));
- System.out.println(client.getDataStoresInWorkspace(ws));
- }catch(RemoteException e) {
- System.err.println("Unable to check "+ws+" : "+e.getRemoteMessage());
- }
- }
- }
-
+ for(String sld:client.getStylesNamesinWorkspace(ws))
+ if(sld!=null)try {
+ System.out.println(client.getSLD(sld));
+ }catch(RemoteException e ) {System.err.println("Unable to read SLD "+sld+" from "+ws+". Cause "+e.getResponseHTTPCode()+": "+e.getMessage());}
- @Test
- public void CRUDS() throws RemoteException, Exception {
- assumeTrue(isTestInfrastructureEnabled());
- GSRESTClient client=getClient();
- String ws=UUID.randomUUID().toString().replace("-", "_");
- client.createWorkspace(ws);
- client.getWorkspace(ws);
- client.deleteWorkspace(ws);
+
+ System.out.println(client.getDataStoresInWorkspace(ws));
+
+ for(String ds:client.getDataStoresNamesInWorkspace(ws))
+ if(ds!=null) {
+ try{ System.out.println(client.getDataStore(ws, ds));
+ }catch(RemoteException e ) {System.err.println("Unable to read DS "+ds+" from "+ws+". Cause "+e.getResponseHTTPCode()+": "+e.getMessage());}
+ }
+
+
+ for(String ft : client.getFeatureTypesInWorkspace(ws))
+ if(ft!=null)try {
+ System.out.println(client.getFeatureType(ws, ft));
+ }catch(RemoteException e ) {System.err.println("Unable to read FT "+ft+" from "+ws+". Cause "+e.getResponseHTTPCode()+": "+e.getMessage());}
+
+
+ for(String l : client.getLayers(ws))
+ if(l!=null)try {
+ System.out.println(client.getLayerInWorkspace(ws, l));
+ System.out.println(client.getLayer(l));
+ }catch(RemoteException e ) {System.err.println("Unable to read LA "+l+" from "+ws+". Cause "+e.getResponseHTTPCode()+": "+e.getMessage());}
+
+ }
+ }catch(Exception e) {
+ System.err.println("Unable to check "+ws+" : "+e);
+ }
+
+
+
+ });
+
+ System.out.println("Listing layers without ws");
+// client.getLayers().forEach((String l)->{
+// try{System.out.println(client.getLayer(l));
+// }catch(RemoteException e ) {System.err.println("Unable to read LA "+l+". Cause "+e.getResponseHTTPCode()+": "+e.getMessage());}
+// catch(Exception e ) {System.err.println("Unable to read LA "+l+". Cause : "+e.getMessage());}
+// });
}
+
+
+ @Test
+ public void CRUDS() throws RemoteException, Exception {
+ assumeTrue(isTestInfrastructureEnabled());
+ GSRESTClient client=getClient();
+
+ client.authenticate();
+ String ws=UUID.randomUUID().toString().replace("-", "_");
+ client.createWorkspace(ws);
+ client.getWorkspace(ws);
+
+
+ String myDS=UUID.randomUUID().toString().replace("-", "_");
+
+ client.publishDataStore(ws, new DataStoreRegistrationRequest(myDS).getDatastore());
+
+ client.deleteWorkspace(ws,true);
+ }
}
diff --git a/sdi-generic-client/pom.xml b/sdi-generic-client/pom.xml
index c49208f..c8b73ff 100644
--- a/sdi-generic-client/pom.xml
+++ b/sdi-generic-client/pom.xml
@@ -31,21 +31,31 @@
- org.gcube.core
- common-fw-clients
+ org.gcube.core
+ common-fw-clients
- org.gcube.core
- common-generic-clients
+ org.gcube.core
+ common-generic-clients
- org.glassfish.jersey.core
- jersey-client
+ org.glassfish.jersey.core
+ jersey-client
+
+
+
+
+
+
+
+
+
+
@@ -63,7 +73,7 @@
-
+
@@ -92,7 +102,13 @@
org.gcube.spatial.data
test
-
+
+
+ com.googlecode.json-simple
+ json-simple
+ 1.1.1
+ test
+
diff --git a/sdi-generic-client/src/main/java/org/gcube/spatial/data/clients/AbstractGenericRESTClient.java b/sdi-generic-client/src/main/java/org/gcube/spatial/data/clients/AbstractGenericRESTClient.java
index 715c9c8..b87c1c7 100644
--- a/sdi-generic-client/src/main/java/org/gcube/spatial/data/clients/AbstractGenericRESTClient.java
+++ b/sdi-generic-client/src/main/java/org/gcube/spatial/data/clients/AbstractGenericRESTClient.java
@@ -6,19 +6,25 @@ import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.MediaType;
import org.gcube.common.clients.Call;
import org.gcube.common.gxrest.request.GXWebTargetAdapterRequest;
import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
import org.gcube.spatial.data.clients.model.ConnectionDescriptor;
+import org.gcube.spatial.data.sdi.model.credentials.AccessType;
+import org.gcube.spatial.data.sdi.model.credentials.Credentials;
import org.gcube.spatial.data.sdi.model.faults.RemoteException;
+import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
+import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@Slf4j
-public abstract class AbstractGenericRESTClient {
+public abstract class AbstractGenericRESTClient implements GenericLoginClient{
+ @Getter
private ConnectionDescriptor conn;
@@ -26,11 +32,43 @@ public abstract class AbstractGenericRESTClient {
@Setter
private String basePath=null;
+ @Setter
+ private MediaType defaultMediaType=MediaType.APPLICATION_JSON_TYPE;
+
+
+
private Set> toRegisterClasses=new HashSet>();
private Set