Class GeoserverWorkspace
- java.lang.Object
-
- de.narimo.georepo.server.geoserver.GeoserverWorkspace
-
public class GeoserverWorkspace extends Object
-
-
Constructor Summary
Constructors Constructor Description GeoserverWorkspace(String workspaceName, String geoserverRestUrl, Map<String,String> headers, String geoserverAdmin, String geoserverPass)GeoserverWorkspace(String geoserverRestUrl, Map<String,String> headers, String geoserverAdmin, String geoserverPass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateNamespace(String namespace)Create a new namespace.voidcreateWFSService()Creates a WFS service which is disabled by default.voidcreateWMSService()voidcreateWorkspace()Creates a workspace by creating a namespace which auto-creates a bare workspace.StringgetDatasource(String workspace, GeoserverDatasourceType datasourceType)Gets the first available datasource on this workspace, that is of type datasourceType.List<String>getDatasources(String workspace)Returns all datasource names, that exist on this workspaceStringgetDatasourceXML(String workspace, String datasource)Get vector datasources that exist in the given workspace.List<GeoserverFeatureType>getWorkspaceFeatureTypes(String workspace, boolean includeDiffLayers)Retrieves all feature types/ layers per workspace.StringgetWorkspaceOWSSettings(String service)static voidmain(String[] args)voidmodifyWorkspaceOWSSettings(String service, ServiceSettings serviceSettings)voidmodifyWorkspaceSettings(String charset, String proxyBaseUrl, Contact contact, String onlineResource, boolean enabled)voidsetTransactional(boolean transactional, String workspace)Change transaction operation enabled in wfs settings.
-
-
-
Method Detail
-
createWorkspace
public void createWorkspace() throws IOExceptionCreates a workspace by creating a namespace which auto-creates a bare workspace.- Parameters:
workspaceName-- Throws:
ExceptionIOException
-
createNamespace
public void createNamespace(String namespace) throws IOException
Create a new namespace. This will automatically create a workspace too.- Parameters:
namespace-nsUri-- Throws:
ExceptionIOException
-
modifyWorkspaceSettings
public void modifyWorkspaceSettings(String charset, String proxyBaseUrl, Contact contact, String onlineResource, boolean enabled) throws IOException
- Throws:
IOException
-
modifyWorkspaceOWSSettings
public void modifyWorkspaceOWSSettings(String service, ServiceSettings serviceSettings) throws IOException
- Throws:
IOException
-
getWorkspaceOWSSettings
public String getWorkspaceOWSSettings(String service) throws Exception
- Throws:
Exception
-
setTransactional
public void setTransactional(boolean transactional, String workspace) throws IOExceptionChange transaction operation enabled in wfs settings. Can be BASIC := read access, TRANSACTIONAL := write access, COMPLETE := read+write access Workspace must be enabled to do this!- Parameters:
transactional-- Throws:
IOException
-
getDatasources
public List<String> getDatasources(String workspace) throws IOException
Returns all datasource names, that exist on this workspace- Parameters:
geoserverRestUrl-workspace-- Returns:
- Throws:
ExceptionIOException
-
getDatasource
public String getDatasource(String workspace, GeoserverDatasourceType datasourceType) throws IOException
Gets the first available datasource on this workspace, that is of type datasourceType.- Parameters:
workspace-datasourceType-- Returns:
- Throws:
ExceptionIOException
-
getDatasourceXML
public String getDatasourceXML(String workspace, String datasource) throws IOException
Get vector datasources that exist in the given workspace.- Parameters:
workspace-datasource-- Throws:
ExceptionIOException
-
getWorkspaceFeatureTypes
public List<GeoserverFeatureType> getWorkspaceFeatureTypes(String workspace, boolean includeDiffLayers) throws IOException
Retrieves all feature types/ layers per workspace.- Parameters:
workspace-- Returns:
- list of feature types on this workspace
- Throws:
IOException
-
createWFSService
public void createWFSService() throws IOExceptionCreates a WFS service which is disabled by default.- Parameters:
workspace-- Throws:
IOException
-
createWMSService
public void createWMSService() throws IOException- Throws:
IOException
-
main
public static void main(String[] args) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-