public class GeoServerRESTReader extends Object
RESTLayer, RESTCoverageStore, ...).| Constructor and Description |
|---|
GeoServerRESTReader(String gsUrl)
Creates a GeoServerRESTReader for a given GeoServer instance and
no auth credentials.
|
GeoServerRESTReader(String gsUrl,
String username,
String password)
Creates a GeoServerRESTReader for a given GeoServer instance
with the given auth credentials.
|
GeoServerRESTReader(URL gsUrl)
Creates a GeoServerRESTReader for a given GeoServer instance and
no auth credentials.
|
GeoServerRESTReader(URL gsUrl,
String username,
String password)
Creates a GeoServerRESTReader for a given GeoServer instance
with the given auth credentials.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
existGeoserver()
Check if a GeoServer instance is running at the given URL.
|
boolean |
existsCoverage(String workspace,
String store,
String name)
Checks if the selected Coverage is present.
|
boolean |
existsCoverage(String workspace,
String store,
String name,
boolean quietOnNotFound)
Checks if the selected Coverage is present.
|
boolean |
existsCoveragestore(String workspace,
String csName)
Checks if the selected Coverage store is present.
|
boolean |
existsCoveragestore(String workspace,
String csName,
boolean quietOnNotFound)
Checks if the selected Coverage store is present.
|
boolean |
existsDatastore(String workspace,
String dsName)
Checks if the selected DataStore is present
|
boolean |
existsDatastore(String workspace,
String dsName,
boolean quietOnNotFound)
Checks if the selected DataStore is present.
|
boolean |
existsFeatureType(String workspace,
String dsName,
String ftName)
Checks if the selected FeatureType is present.
|
boolean |
existsFeatureType(String workspace,
String dsName,
String ftName,
boolean quietOnNotFound)
Checks if the selected FeatureType is present.
|
boolean |
existsGranule(String workspace,
String coverageStore,
String coverage,
String id)
Checks if the selected Granule is present.
|
boolean |
existsGranule(String workspace,
String coverageStore,
String coverage,
String id,
boolean quietOnNotFound)
Checks if the selected Granule is present.
|
boolean |
existsLayer(String workspace,
String name)
Checks if the selected Layer is present.
|
boolean |
existsLayer(String workspace,
String name,
boolean quietOnNotFound)
Checks if the selected Layer is present.
|
boolean |
existsLayerGroup(String workspace,
String name)
Checks if the selected LayerGroup is present.
|
boolean |
existsLayerGroup(String workspace,
String name,
boolean quietOnNotFound)
Checks if the selected LayerGroup is present.
|
boolean |
existsNamespace(String prefix)
Checks if the selected Namespace is present.
|
boolean |
existsNamespace(String prefix,
boolean quietOnNotFound)
Checks if the selected Namespace is present.
|
boolean |
existsStyle(String styleName)
Check if a Style exists in the configured GeoServer instance.
|
boolean |
existsStyle(String styleName,
boolean quietOnNotFound)
Check if a Style exists in the configured GeoServer instance.
|
boolean |
existsStyle(String workspace,
String styleName) |
boolean |
existsWms(String workspace,
String store,
String name)
Checks if the selected wms is present.
|
boolean |
existsWms(String workspace,
String store,
String name,
boolean quietOnNotFound)
Checks if the selected Wms is present.
|
boolean |
existsWmsstore(String workspace,
String wsName)
Checks if the selected wms store is present.
|
boolean |
existsWmsstore(String workspace,
String wsName,
boolean quietOnNotFound)
Checks if the selected Wms store is present.
|
boolean |
existsWorkspace(String prefix)
Checks if the selected Workspace is present.
|
boolean |
existsWorkspace(String prefix,
boolean quietOnNotFound)
Checks if the selected Workspace is present.
|
RESTCoverage |
getCoverage(RESTLayer layer)
Get detailed info about a Coverage given the Layer where it's published with.
|
RESTCoverage |
getCoverage(String workspace,
String store,
String name)
Get detailed info about a given Coverage.
|
RESTCoverageList |
getCoverageNames(String workspace,
String coveragestorename,
String list) |
RESTCoverageList |
getCoverages(String workspace,
String csName)
Get list of coverages (usually only one).
|
RESTCoverageStore |
getCoverageStore(RESTCoverage coverage)
Get detailed info about a Coverage's Datastore.
|
RESTCoverageStore |
getCoverageStore(String workspace,
String csName)
Get detailed info about a given CoverageStore in a given Workspace.
|
RESTCoverageStoreList |
getCoverageStores(String workspace)
Get summary info about all CoverageStores in a WorkSpace.
|
RESTDataStore |
getDatastore(RESTFeatureType featureType)
Get detailed info about a FeatureType's Datastore.
|
RESTDataStore |
getDatastore(String workspace,
String dsName)
Get detailed info about a given Datastore in a given Workspace.
|
RESTDataStoreList |
getDatastores(String workspace)
Get summary info about all DataStores in a WorkSpace.
|
RESTFeatureType |
getFeatureType(RESTLayer layer)
Get detailed info about a FeatureType given the Layer where it's published with.
|
RESTFeatureTypeList |
getFeatureTypes(String workspace)
Get summary info about all FeatureTypes of a workspace.
|
RESTFeatureTypeList |
getFeatureTypes(String workspace,
String list) |
GSVersionDecoder |
getGeoserverVersion()
Return the version of the target GeoServer
|
RESTStructuredCoverageGranulesList |
getGranuleById(String workspace,
String coverageStore,
String coverage,
String id)
Get information about a granule for a structured coverage.
|
RESTStructuredCoverageIndexSchema |
getGranuleIndexSchema(String workspace,
String coverageStore,
String coverage)
Get information about the schema of the index for a structured coverage.
|
RESTStructuredCoverageGranulesList |
getGranules(String workspace,
String coverageStore,
String coverage,
String filter,
Integer offset,
Integer limit)
Get information about the granules for a coverage with optional filter and paging.
|
RESTLayer |
getLayer(String name)
Deprecated.
|
RESTLayer |
getLayer(String workspace,
String name)
Get detailed info about a given Layer.
|
RESTLayerGroup |
getLayerGroup(String name)
Get detailed info about a given LayerGroup.
|
RESTLayerGroup |
getLayerGroup(String workspace,
String name)
Get detailed info about a given LayerGroup.
|
RESTLayerGroupList |
getLayerGroups()
Get summary info about all LayerGroups.
|
RESTLayerGroupList |
getLayerGroups(String workspace)
Get summary info about all LayerGroups in the given workspace.
|
RESTLayerList |
getLayers()
Get summary info about all Layers.
|
RESTNamespace |
getNamespace(String prefix)
Get a namespace.
|
List<String> |
getNamespaceNames()
Get the names of all the Namespaces.
|
RESTNamespaceList |
getNamespaces()
Get summary info about all Namespaces.
|
RESTResource |
getResource(RESTLayer layer)
Get detailed info about a Resource given the Layer where it's published with.
|
String |
getSLD(String styleName)
Get the SLD body of a Style.
|
String |
getSLD(String workspace,
String styleName) |
RESTStyle |
getStyle(String name) |
RESTStyle |
getStyle(String workspace,
String name) |
RESTStyleList |
getStyles()
Get summary info about all Styles.
|
RESTStyleList |
getStyles(String workspace) |
RESTWms |
getWms(RESTLayer layer)
Get detailed info about a Wms given the Layer where it's published with.
|
RESTWmsList |
getWms(String workspace,
String wsName)
Get list of wmss (usually only one).
|
RESTWms |
getWms(String workspace,
String store,
String name)
Get detailed info about a given Wms.
|
RESTWmsStore |
getWmsStore(RESTWms wms)
Get detailed info about a Wms's Datastore.
|
RESTWmsStore |
getWmsStore(String workspace,
String wsName)
Get detailed info about a given WmsStore in a given Workspace.
|
RESTWmsStoreList |
getWmsStores(String workspace)
Get summary info about all WmsStore in a WorkSpace.
|
List<String> |
getWorkspaceNames()
Get the names of all the Workspaces.
|
RESTWorkspaceList |
getWorkspaces()
Get summary info about all Workspaces.
|
public GeoServerRESTReader(URL gsUrl)
Note that GeoServer 2.0 REST interface requires username/password credentials by default, if not otherwise configured. .
gsUrl - the base GeoServer URL(e.g.: http://localhost:8080/geoserver)public GeoServerRESTReader(String gsUrl) throws MalformedURLException
Note that GeoServer 2.0 REST interface requires username/password credentials by default, if not otherwise configured. .
gsUrl - the base GeoServer URL (e.g.: http://localhost:8080/geoserver)MalformedURLExceptionpublic GeoServerRESTReader(String gsUrl, String username, String password) throws MalformedURLException
gsUrl - the base GeoServer URL (e.g.: http://localhost:8080/geoserver)username - username auth credentialpassword - password auth credentialMalformedURLExceptionpublic GeoServerRESTReader(URL gsUrl, String username, String password)
gsUrl - the base GeoServer URL (e.g.: http://localhost:8080/geoserver)username - username auth credentialpassword - password auth credentialpublic boolean existGeoserver()
public GSVersionDecoder getGeoserverVersion()
public boolean existsStyle(String styleName) throws RuntimeException
styleName - the name of the style to check for.RuntimeException - if any other HTTP code than 200 or 404 was retrieved.public boolean existsStyle(String styleName, boolean quietOnNotFound) throws RuntimeException
styleName - the name of the style to check for.quietOnNotFound - if true, mute exception if false is returnedRuntimeException - if any other HTTP code than 200 or 404 was retrieved.public boolean existsStyle(String workspace, String styleName) throws RuntimeException
RuntimeExceptionGeoServerRESTStyleManager.existsStyle(java.lang.String, java.lang.String)public RESTStyle getStyle(String name)
GeoServerRESTStyleManager.getStyle(java.lang.String)public RESTStyle getStyle(String workspace, String name)
GeoServerRESTStyleManager.getStyle(java.lang.String, java.lang.String)public RESTStyleList getStyles()
RESTStyleListpublic RESTStyleList getStyles(String workspace)
GeoServerRESTStyleManager.getStyles(java.lang.String)public String getSLD(String workspace, String styleName)
GeoServerRESTStyleManager.getSLD(java.lang.String, java.lang.String)public RESTDataStoreList getDatastores(String workspace)
workspace - The name of the workspaceRESTDataStoreListpublic RESTDataStore getDatastore(String workspace, String dsName)
workspace - The name of the workspacedsName - The name of the DatastoreRESTDataStorepublic RESTDataStore getDatastore(RESTFeatureType featureType)
featureType - the RESTFeatureTypeRESTDataStorepublic boolean existsDatastore(String workspace, String dsName)
workspace - workspace of the datastoredsName - name of the datastorepublic boolean existsDatastore(String workspace, String dsName, boolean quietOnNotFound)
workspace - workspace of the datastoredsName - name of the datastorequietOnNotFound - if true, no exception is loggedpublic RESTFeatureType getFeatureType(RESTLayer layer)
layer - A layer publishing the FeatureTypeRESTCoveragepublic boolean existsFeatureType(String workspace, String dsName, String ftName)
workspace - workspace of the datastoredsName - name of the datastoreftName - name of the featuretypepublic boolean existsFeatureType(String workspace, String dsName, String ftName, boolean quietOnNotFound)
workspace - workspace of the datastoredsName - name of the datastoreftName - name of the featuretypequietOnNotFound - if true, no exception is loggedpublic RESTCoverageStoreList getCoverageStores(String workspace)
workspace - The name of the workspaceRESTDataStoreListpublic RESTCoverageStore getCoverageStore(String workspace, String csName)
workspace - The name of the workspacecsName - The name of the CoverageStoreRESTCoverageStorepublic RESTCoverageStore getCoverageStore(RESTCoverage coverage)
coverage - the RESTFeatureTypeRESTCoverageStorepublic boolean existsCoveragestore(String workspace, String csName, boolean quietOnNotFound)
workspace - workspace of the coveragestoredsName - name of the coveragestorequietOnNotFound - if true, no exception is loggedpublic boolean existsCoveragestore(String workspace, String csName)
workspace - workspace of the coveragestoredsName - name of the coveragestorepublic RESTCoverageList getCoverages(String workspace, String csName)
workspace - The name of the workspacecsName - The name of the CoverageStoreRESTCoverageListpublic RESTCoverage getCoverage(String workspace, String store, String name)
workspace - The name of the workspacestore - The name of the CoverageStorename - The name of the CoverageRESTCoveragepublic boolean existsCoverage(String workspace, String store, String name, boolean quietOnNotFound)
workspace - workspace of the coveragestoredsName - name of the coveragestorename - name of the coveragequietOnNotFound - if true, no exception is loggedpublic boolean existsCoverage(String workspace, String store, String name)
workspace - workspace of the coveragestorestore - name of the coveragestorename - name of the coveragepublic RESTCoverage getCoverage(RESTLayer layer)
layer - A layer publishing the CoverageStoreRESTCoveragepublic RESTWmsStoreList getWmsStores(String workspace)
workspace - The name of the workspaceRESTWmsStoreListpublic RESTWmsStore getWmsStore(String workspace, String wsName)
workspace - The name of the workspacewsName - The name of the WmsStoreRESTWmsStorepublic RESTWmsStore getWmsStore(RESTWms wms)
wms - the RESTWmsRESTWmsStorepublic boolean existsWmsstore(String workspace, String wsName, boolean quietOnNotFound)
workspace - workspace of the wmsstorewsName - name of the wmsstorequietOnNotFound - if true, no exception is loggedpublic boolean existsWmsstore(String workspace, String wsName)
workspace - workspace of the wmsstorewsName - name of the wmsstorepublic RESTWmsList getWms(String workspace, String wsName)
workspace - The name of the workspacewsName - The name of the WmsStoreRESTWmsListpublic RESTWms getWms(String workspace, String store, String name)
workspace - The name of the workspacestore - The name of the WmsStorename - The name of the WmsRESTwmspublic boolean existsWms(String workspace, String store, String name, boolean quietOnNotFound)
workspace - workspace of the wmsstorewsName - name of the wmsstorename - name of the wmsquietOnNotFound - if true, no exception is loggedpublic boolean existsWms(String workspace, String store, String name)
workspace - workspace of the wmsstorestore - name of the wmsstorename - name of the wmspublic RESTWms getWms(RESTLayer layer)
layer - A layer publishing the wmsStoreRESTWmspublic RESTResource getResource(RESTLayer layer)
RESTResourcepublic RESTLayerGroupList getLayerGroups(String workspace)
workspace - name of the workspaceRESTLayerGroupListpublic RESTLayerGroup getLayerGroup(String workspace, String name)
workspace - name of the workspacename - the name of the LayerGroupRESTLayerGrouppublic RESTLayerGroupList getLayerGroups()
RESTLayerGroupListpublic RESTLayerGroup getLayerGroup(String name)
name - The name of the LayerGroupRESTLayerGrouppublic boolean existsLayerGroup(String workspace, String name, boolean quietOnNotFound)
workspace - workspace of the LayerGroupname - name of the LayerGroupquietOnNotFound - if true, no exception is loggedpublic boolean existsLayerGroup(String workspace, String name)
workspace - workspace of the LayerGroupname - name of the LayerGrouppublic RESTLayerList getLayers()
RESTLayerListpublic RESTFeatureTypeList getFeatureTypes(String workspace)
RESTLayerListpublic RESTFeatureTypeList getFeatureTypes(String workspace, String list)
public RESTCoverageList getCoverageNames(String workspace, String coveragestorename, String list)
public RESTLayer getLayer(String name)
getLayer(String, String)name - The name of the LayerRESTLayerpublic RESTLayer getLayer(String workspace, String name)
workspace - the workspace namename - the layer namepublic boolean existsLayer(String workspace, String name, boolean quietOnNotFound)
workspace - workspace of the Layername - name of the LayerquietOnNotFound - if true, no exception is loggedpublic boolean existsLayer(String workspace, String name)
workspace - workspace of the Layername - name of the Layerpublic RESTNamespace getNamespace(String prefix)
prefix - namespace prefix.public RESTNamespaceList getNamespaces()
RESTNamespaceListpublic List<String> getNamespaceNames()
getNamespacespublic boolean existsNamespace(String prefix, boolean quietOnNotFound)
prefix - namespace prefix.quietOnNotFound - if true, no exception is loggedpublic boolean existsNamespace(String prefix)
prefix - namespace prefix.public RESTWorkspaceList getWorkspaces()
RESTWorkspaceListpublic List<String> getWorkspaceNames()
getWorkspacespublic boolean existsWorkspace(String prefix, boolean quietOnNotFound)
prefix - Workspace prefix.quietOnNotFound - if true, no exception is loggedpublic boolean existsWorkspace(String prefix)
prefix - Workspace prefix.public RESTStructuredCoverageGranulesList getGranuleById(String workspace, String coverageStore, String coverage, String id) throws MalformedURLException, UnsupportedEncodingException
workspace - the GeoServer workspacecoverageStore - the GeoServer coverageStoreformat - the format of the file to uploadthe - absolute path to the file to uploadid - the ID of the granule to get information fornull in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.MalformedURLExceptionUnsupportedEncodingExceptionpublic boolean existsGranule(String workspace, String coverageStore, String coverage, String id, boolean quietOnNotFound)
workspace - workspace of the coveragestorecoverageStore - name of the coveragestorecoverage - name of the coverageid - id of the granulequietOnNotFound - if true, no exception is loggedpublic boolean existsGranule(String workspace, String coverageStore, String coverage, String id)
workspace - workspace of the coveragestorecoverageStore - name of the coveragestorecoverage - name of the coverageid - id of the granulepublic RESTStructuredCoverageIndexSchema getGranuleIndexSchema(String workspace, String coverageStore, String coverage) throws MalformedURLException
workspace - the GeoServer workspacecoverageStore - the GeoServer coverageStoreformat - the format of the file to uploadnull in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.MalformedURLExceptionUnsupportedEncodingExceptionpublic RESTStructuredCoverageGranulesList getGranules(String workspace, String coverageStore, String coverage, String filter, Integer offset, Integer limit) throws MalformedURLException, UnsupportedEncodingException
workspace - the GeoServer workspacecoverageStore - the GeoServer coverageStorecoverage - the name of the target coveragefilter - the format of the file to upload, can be null to include all the granulesoffset - the start page, can be null or an integerlimit - the dimension of the page, can be null or a positive integernull in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.MalformedURLExceptionUnsupportedEncodingExceptionCopyright © 2007–2016 PDOK. All rights reserved.