gcube-sdi-suite/gcube-geoserver-client/src/main/java/org/gcube/spatial/data/clients/geoserver/GSRESTClient.java

99 lines
3.7 KiB
Java
Raw Normal View History

2021-02-16 18:03:10 +01:00
package org.gcube.spatial.data.clients.geoserver;
2021-02-19 18:45:01 +01:00
import java.util.List;
2021-04-13 18:10:02 +02:00
import org.gcube.spatial.data.clients.GenericLoginClient;
2021-04-29 15:54:02 +02:00
import org.gcube.spatial.data.clients.geoserver.model.FeatureTypeInfo;
2021-02-17 13:39:10 +01:00
import org.gcube.spatial.data.sdi.model.faults.RemoteException;
2021-02-17 16:40:34 +01:00
import org.json.simple.JSONObject;
2021-02-17 13:39:10 +01:00
2021-04-29 19:39:52 +02:00
/**
*
* Based on https://docs.geoserver.org/latest/en/user/rest/index.html
*
* @author FabioISTI
*
*/
2021-04-13 18:10:02 +02:00
public interface GSRESTClient extends GenericLoginClient{
2021-04-09 18:15:10 +02:00
2021-02-16 18:03:10 +01:00
// ********** READ OPS
// WS
2021-02-18 18:12:58 +01:00
public JSONObject getWorkspaces()throws RemoteException,Exception;
2021-02-19 18:45:01 +01:00
public List<String> getWorkspaceNames()throws RemoteException,Exception;
2021-02-17 16:40:34 +01:00
public JSONObject getWorkspace(String workspace)throws RemoteException, Exception;
2021-02-16 18:03:10 +01:00
// DS
2021-02-18 18:12:58 +01:00
public JSONObject getDataStoresInWorkspace(String ws)throws RemoteException,Exception;
2021-02-19 18:45:01 +01:00
public List<String> getDataStoresNamesInWorkspace(String ws)throws RemoteException,Exception;
2021-04-09 18:15:10 +02:00
public JSONObject getDataStore(String workspace,String dsName)throws RemoteException,Exception;
2021-02-16 18:03:10 +01:00
// SLD
2021-02-18 18:12:58 +01:00
public JSONObject getStyles()throws RemoteException,Exception;
2021-02-19 18:45:01 +01:00
public List<String> getStylesNames()throws RemoteException,Exception;
2021-02-18 18:12:58 +01:00
public JSONObject getStylesInWorkspace(String ws)throws RemoteException,Exception;
2021-02-19 18:45:01 +01:00
public List<String> getStylesNamesinWorkspace(String ws)throws RemoteException,Exception;
2021-02-18 18:12:58 +01:00
public JSONObject getStylesByLayer(String layer)throws RemoteException,Exception;
2021-02-19 18:45:01 +01:00
public List<String> getStylesNamesByLayer(String layer)throws RemoteException,Exception;
2021-04-09 18:15:10 +02:00
public String getSLD(String styleName)throws RemoteException,Exception;
// FeatureTypes
2021-04-13 18:10:02 +02:00
public List<String> getFeatureTypesInWorkspace(String workspace)throws RemoteException,Exception;
public List<String> getFeatureTypesInDataStore(String workspace,String datastore)throws RemoteException,Exception;
2021-04-29 15:54:02 +02:00
public FeatureTypeInfo getFeatureType(String workspace,String featureName)throws RemoteException,Exception;
2021-04-13 18:10:02 +02:00
//Layers
public List<String> getLayers()throws RemoteException,Exception;
public List<String> getLayers(String workspace)throws RemoteException, Exception;
public JSONObject getLayer(String layerName)throws RemoteException, Exception;
public JSONObject getLayerInWorkspace(String ws,String layerName)throws RemoteException, Exception;
2021-02-19 18:45:01 +01:00
2021-02-16 18:03:10 +01:00
// *********** CREATE OPS
2021-02-17 13:39:10 +01:00
public void createWorkspace(String ws)throws RemoteException,Exception;
2021-04-21 12:48:12 +02:00
public void createStyle(String name,String content)throws RemoteException,Exception;
2021-02-16 18:03:10 +01:00
2021-04-09 18:15:10 +02:00
/**
2021-04-29 19:39:52 +02:00
* 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.
2021-04-09 18:15:10 +02:00
*
2021-04-29 19:39:52 +02:00
* @param ws
* @param parameters
* @return
2021-04-09 18:15:10 +02:00
*/
2021-04-29 19:39:52 +02:00
public void publishDataStore(String ws, JSONObject parameters)throws RemoteException,Exception;
2021-04-09 18:15:10 +02:00
/**
2021-04-29 19:39:52 +02:00
*
* /workspaces/{workspaceName}/coveragestores/{coveragestoreName}/coverages,
* /workspaces/{workspaceName}/datastores/{datastoreName}/featuretypes,
* /workspaces/{workspaceName}/wmsstores/{wmsstoreName}/wmslayers, or
* /workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers
2021-04-13 18:10:02 +02:00
*
2021-04-09 18:15:10 +02:00
* @param ws
2021-04-29 19:39:52 +02:00
* @param recurse
* @throws RemoteException
* @throws Exception
2021-04-09 18:15:10 +02:00
*/
2021-04-29 19:39:52 +02:00
public void createLayerAsFeatureType(String ws,String dataStoreName,FeatureTypeInfo ft)throws RemoteException, Exception;
2021-04-13 18:10:02 +02:00
2021-04-20 17:24:34 +02:00
2021-04-13 18:10:02 +02:00
// // +********** DELETE OPS
public void deleteWorkspace(String ws, boolean recurse)throws RemoteException,Exception;
public void deleteStyle(String style, boolean purgeSLDFile,boolean updateReferences)throws RemoteException,Exception;
public void deleteDataStore(String ds, boolean recurse)throws RemoteException,Exception;
public void deleteLayer(String layer,boolean recurse)throws RemoteException,Exception;
2021-02-16 18:03:10 +01:00
}