Class GeoServerRESTReader


  • public class GeoServerRESTReader
    extends java.lang.Object
    Connect to a GeoServer instance to read its data.
    Info are returned as Strings or, for complex data, as XML elements wrapped in proper parsers (e.g.: RESTLayer, RESTCoverageStore, ...).
    Version:
    $Id: $
    Author:
    ETj (etj at geo-solutions.it)
    • Constructor Summary

      Constructors 
      Constructor Description
      GeoServerRESTReader​(java.lang.String gsUrl)
      Creates a GeoServerRESTReader for a given GeoServer instance and no auth credentials.
      GeoServerRESTReader​(java.lang.String gsUrl, java.lang.String username, java.lang.String password)
      Creates a GeoServerRESTReader for a given GeoServer instance with the given auth credentials.
      GeoServerRESTReader​(java.net.URL gsUrl)
      Creates a GeoServerRESTReader for a given GeoServer instance and no auth credentials.
      GeoServerRESTReader​(java.net.URL gsUrl, java.lang.String username, java.lang.String password)
      Creates a GeoServerRESTReader for a given GeoServer instance with the given auth credentials.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean existGeoserver()
      Check if a GeoServer instance is running at the given URL.
      boolean existsCoverage​(java.lang.String workspace, java.lang.String store, java.lang.String name)
      Checks if the selected Coverage is present.
      boolean existsCoverage​(java.lang.String workspace, java.lang.String store, java.lang.String name, boolean quietOnNotFound)
      Checks if the selected Coverage is present.
      boolean existsCoveragestore​(java.lang.String workspace, java.lang.String csName)
      Checks if the selected Coverage store is present.
      boolean existsCoveragestore​(java.lang.String workspace, java.lang.String csName, boolean quietOnNotFound)
      Checks if the selected Coverage store is present.
      boolean existsDatastore​(java.lang.String workspace, java.lang.String dsName)
      Checks if the selected DataStore is present
      boolean existsDatastore​(java.lang.String workspace, java.lang.String dsName, boolean quietOnNotFound)
      Checks if the selected DataStore is present.
      boolean existsFeatureType​(java.lang.String workspace, java.lang.String dsName, java.lang.String ftName)
      Checks if the selected FeatureType is present.
      boolean existsFeatureType​(java.lang.String workspace, java.lang.String dsName, java.lang.String ftName, boolean quietOnNotFound)
      Checks if the selected FeatureType is present.
      boolean existsGranule​(java.lang.String workspace, java.lang.String coverageStore, java.lang.String coverage, java.lang.String id)
      Checks if the selected Granule is present.
      boolean existsGranule​(java.lang.String workspace, java.lang.String coverageStore, java.lang.String coverage, java.lang.String id, boolean quietOnNotFound)
      Checks if the selected Granule is present.
      boolean existsLayer​(java.lang.String workspace, java.lang.String name)
      Checks if the selected Layer is present.
      boolean existsLayer​(java.lang.String workspace, java.lang.String name, boolean quietOnNotFound)
      Checks if the selected Layer is present.
      boolean existsLayerGroup​(java.lang.String workspace, java.lang.String name)
      Checks if the selected LayerGroup is present.
      boolean existsLayerGroup​(java.lang.String workspace, java.lang.String name, boolean quietOnNotFound)
      Checks if the selected LayerGroup is present.
      boolean existsNamespace​(java.lang.String prefix)
      Checks if the selected Namespace is present.
      boolean existsNamespace​(java.lang.String prefix, boolean quietOnNotFound)
      Checks if the selected Namespace is present.
      boolean existsStyle​(java.lang.String styleName)
      Check if a Style exists in the configured GeoServer instance.
      boolean existsStyle​(java.lang.String styleName, boolean quietOnNotFound)
      Check if a Style exists in the configured GeoServer instance.
      boolean existsStyle​(java.lang.String workspace, java.lang.String styleName)
      existsStyle
      boolean existsWms​(java.lang.String workspace, java.lang.String store, java.lang.String name)
      Checks if the selected wms is present.
      boolean existsWms​(java.lang.String workspace, java.lang.String store, java.lang.String name, boolean quietOnNotFound)
      Checks if the selected Wms is present.
      boolean existsWmsstore​(java.lang.String workspace, java.lang.String wsName)
      Checks if the selected wms store is present.
      boolean existsWmsstore​(java.lang.String workspace, java.lang.String wsName, boolean quietOnNotFound)
      Checks if the selected Wms store is present.
      boolean existsWorkspace​(java.lang.String prefix)
      Checks if the selected Workspace is present.
      boolean existsWorkspace​(java.lang.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​(java.lang.String workspace, java.lang.String store, java.lang.String name)
      Get detailed info about a given Coverage.
      RESTCoverageList getCoverages​(java.lang.String workspace, java.lang.String csName)
      Get list of coverages (usually only one).
      RESTCoverageStore getCoverageStore​(RESTCoverage coverage)
      Get detailed info about a Coverage's Datastore.
      RESTCoverageStore getCoverageStore​(java.lang.String workspace, java.lang.String csName)
      Get detailed info about a given CoverageStore in a given Workspace.
      RESTCoverageStoreList getCoverageStores​(java.lang.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​(java.lang.String workspace, java.lang.String dsName)
      Get detailed info about a given Datastore in a given Workspace.
      RESTDataStoreList getDatastores​(java.lang.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​(java.lang.String workspace)
      Get summary info about all FeatureTypes of a workspace.
      GSVersionDecoder getGeoserverVersion()
      Return the version of the target GeoServer
      RESTStructuredCoverageGranulesList getGranuleById​(java.lang.String workspace, java.lang.String coverageStore, java.lang.String coverage, java.lang.String id)
      Get information about a granule for a structured coverage.
      RESTStructuredCoverageIndexSchema getGranuleIndexSchema​(java.lang.String workspace, java.lang.String coverageStore, java.lang.String coverage)
      Get information about the schema of the index for a structured coverage.
      RESTStructuredCoverageGranulesList getGranules​(java.lang.String workspace, java.lang.String coverageStore, java.lang.String coverage, java.lang.String filter, java.lang.Integer offset, java.lang.Integer limit)
      Get information about the granules for a coverage with optional filter and paging.
      RESTLayer getLayer​(java.lang.String name)
      Deprecated.
      RESTLayer getLayer​(java.lang.String workspace, java.lang.String name)
      Get detailed info about a given Layer.
      RESTLayerGroup getLayerGroup​(java.lang.String name)
      Get detailed info about a given LayerGroup.
      RESTLayerGroup getLayerGroup​(java.lang.String workspace, java.lang.String name)
      Get detailed info about a given LayerGroup.
      RESTLayerGroupList getLayerGroups()
      Get summary info about all LayerGroups.
      RESTLayerGroupList getLayerGroups​(java.lang.String workspace)
      Get summary info about all LayerGroups in the given workspace.
      RESTLayerList getLayers()
      Get summary info about all Layers.
      RESTNamespace getNamespace​(java.lang.String prefix)
      Get a namespace.
      java.util.List<java.lang.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.
      java.lang.String getSLD​(java.lang.String styleName)
      Get the SLD body of a Style.
      java.lang.String getSLD​(java.lang.String workspace, java.lang.String styleName)
      getSLD
      RESTStyle getStyle​(java.lang.String name)
      getStyle
      RESTStyle getStyle​(java.lang.String workspace, java.lang.String name)
      getStyle
      RESTStyleList getStyles()
      Get summary info about all Styles.
      RESTStyleList getStyles​(java.lang.String workspace)
      getStyles
      RESTWms getWms​(RESTLayer layer)
      Get detailed info about a Wms given the Layer where it's published with.
      RESTWmsList getWms​(java.lang.String workspace, java.lang.String wsName)
      Get list of wmss (usually only one).
      RESTWms getWms​(java.lang.String workspace, java.lang.String store, java.lang.String name)
      Get detailed info about a given Wms.
      RESTWmsStore getWmsStore​(RESTWms wms)
      Get detailed info about a Wms's Datastore.
      RESTWmsStore getWmsStore​(java.lang.String workspace, java.lang.String wsName)
      Get detailed info about a given WmsStore in a given Workspace.
      RESTWmsStoreList getWmsStores​(java.lang.String workspace)
      Get summary info about all WmsStore in a WorkSpace.
      java.util.List<java.lang.String> getWorkspaceNames()
      Get the names of all the Workspaces.
      RESTWorkspaceList getWorkspaces()
      Get summary info about all Workspaces.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GeoServerRESTReader

        public GeoServerRESTReader​(java.net.URL gsUrl)
        Creates a GeoServerRESTReader for a given GeoServer instance and no auth credentials.

        Note that GeoServer 2.0 REST interface requires username/password credentials by default, if not otherwise configured. .

        Parameters:
        gsUrl - the base GeoServer URL(e.g.: http://localhost:8080/geoserver)
      • GeoServerRESTReader

        public GeoServerRESTReader​(java.lang.String gsUrl)
                            throws java.net.MalformedURLException
        Creates a GeoServerRESTReader for a given GeoServer instance and no auth credentials.

        Note that GeoServer 2.0 REST interface requires username/password credentials by default, if not otherwise configured. .

        Parameters:
        gsUrl - the base GeoServer URL (e.g.: http://localhost:8080/geoserver)
        Throws:
        java.net.MalformedURLException - if any.
      • GeoServerRESTReader

        public GeoServerRESTReader​(java.lang.String gsUrl,
                                   java.lang.String username,
                                   java.lang.String password)
                            throws java.net.MalformedURLException
        Creates a GeoServerRESTReader for a given GeoServer instance with the given auth credentials.
        Parameters:
        gsUrl - the base GeoServer URL (e.g.: http://localhost:8080/geoserver)
        username - username auth credential
        password - password auth credential
        Throws:
        java.net.MalformedURLException - if any.
      • GeoServerRESTReader

        public GeoServerRESTReader​(java.net.URL gsUrl,
                                   java.lang.String username,
                                   java.lang.String password)
        Creates a GeoServerRESTReader for a given GeoServer instance with the given auth credentials.
        Parameters:
        gsUrl - the base GeoServer URL (e.g.: http://localhost:8080/geoserver)
        username - username auth credential
        password - password auth credential
    • Method Detail

      • existGeoserver

        public boolean existGeoserver()
        Check if a GeoServer instance is running at the given URL.
        Return true if the configured GeoServer is up and replies to REST requests.
        Send a HTTP GET request to the configured URL.
        Return true if a HTTP 200 code (OK) is read from the HTTP response; any other response code, or connection error, will return a false boolean.
        Returns:
        true if a GeoServer instance was found at the configured URL.
      • existsStyle

        public boolean existsStyle​(java.lang.String styleName)
                            throws java.lang.RuntimeException
        Check if a Style exists in the configured GeoServer instance.
        Parameters:
        styleName - the name of the style to check for.
        Returns:
        true on HTTP 200, false on HTTP 404
        Throws:
        java.lang.RuntimeException - if any other HTTP code than 200 or 404 was retrieved.
      • existsStyle

        public boolean existsStyle​(java.lang.String styleName,
                                   boolean quietOnNotFound)
                            throws java.lang.RuntimeException
        Check if a Style exists in the configured GeoServer instance.
        Parameters:
        styleName - the name of the style to check for.
        quietOnNotFound - if true, mute exception if false is returned
        Returns:
        true on HTTP 200, false on HTTP 404
        Throws:
        java.lang.RuntimeException - if any other HTTP code than 200 or 404 was retrieved.
      • existsStyle

        public boolean existsStyle​(java.lang.String workspace,
                                   java.lang.String styleName)
                            throws java.lang.RuntimeException

        existsStyle

        Parameters:
        workspace - a String object.
        styleName - a String object.
        Returns:
        a boolean.
        Throws:
        java.lang.RuntimeException - if any.
        Since:
        GeoServer 2.2
        See Also:
        GeoServerRESTStyleManager.existsStyle(java.lang.String, java.lang.String)
      • getStyles

        public RESTStyleList getStyles()
        Get summary info about all Styles.
        Returns:
        summary info about Styles as a RESTStyleList
      • getSLD

        public java.lang.String getSLD​(java.lang.String styleName)
        Get the SLD body of a Style.
        Parameters:
        styleName - a String object.
        Returns:
        a String object.
      • getDatastores

        public RESTDataStoreList getDatastores​(java.lang.String workspace)
        Get summary info about all DataStores in a WorkSpace.
        Parameters:
        workspace - The name of the workspace
        Returns:
        summary info about Datastores as a RESTDataStoreList
      • getDatastore

        public RESTDataStore getDatastore​(java.lang.String workspace,
                                          java.lang.String dsName)
        Get detailed info about a given Datastore in a given Workspace.
        Parameters:
        workspace - The name of the workspace
        dsName - The name of the Datastore
        Returns:
        DataStore details as a RESTDataStore
      • getDatastore

        public RESTDataStore getDatastore​(RESTFeatureType featureType)
        Get detailed info about a FeatureType's Datastore.
        Parameters:
        featureType - the RESTFeatureType
        Returns:
        DataStore details as a RESTDataStore
      • existsDatastore

        public boolean existsDatastore​(java.lang.String workspace,
                                       java.lang.String dsName)
        Checks if the selected DataStore is present
        Parameters:
        workspace - workspace of the datastore
        dsName - name of the datastore
        Returns:
        boolean indicating if the datastore exists
      • existsDatastore

        public boolean existsDatastore​(java.lang.String workspace,
                                       java.lang.String dsName,
                                       boolean quietOnNotFound)
        Checks if the selected DataStore is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        workspace - workspace of the datastore
        dsName - name of the datastore
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the datastore exists
      • getFeatureType

        public RESTFeatureType getFeatureType​(RESTLayer layer)
        Get detailed info about a FeatureType given the Layer where it's published with.
        Parameters:
        layer - A layer publishing the FeatureType
        Returns:
        FeatureType details as a RESTCoverage
      • existsFeatureType

        public boolean existsFeatureType​(java.lang.String workspace,
                                         java.lang.String dsName,
                                         java.lang.String ftName)
        Checks if the selected FeatureType is present.
        Parameters:
        workspace - workspace of the datastore
        dsName - name of the datastore
        ftName - name of the featuretype
        Returns:
        boolean indicating if the featuretype exists
      • existsFeatureType

        public boolean existsFeatureType​(java.lang.String workspace,
                                         java.lang.String dsName,
                                         java.lang.String ftName,
                                         boolean quietOnNotFound)
        Checks if the selected FeatureType is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        workspace - workspace of the datastore
        dsName - name of the datastore
        ftName - name of the featuretype
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the featuretype exists
      • getCoverageStores

        public RESTCoverageStoreList getCoverageStores​(java.lang.String workspace)
        Get summary info about all CoverageStores in a WorkSpace.
        Parameters:
        workspace - The name of the workspace
        Returns:
        summary info about CoverageStores as a RESTDataStoreList
      • getCoverageStore

        public RESTCoverageStore getCoverageStore​(java.lang.String workspace,
                                                  java.lang.String csName)
        Get detailed info about a given CoverageStore in a given Workspace.
        Parameters:
        workspace - The name of the workspace
        csName - The name of the CoverageStore
        Returns:
        CoverageStore details as a RESTCoverageStore
      • getCoverageStore

        public RESTCoverageStore getCoverageStore​(RESTCoverage coverage)
        Get detailed info about a Coverage's Datastore.
        Parameters:
        coverage - the RESTFeatureType
        Returns:
        CoverageStore details as a RESTCoverageStore
      • existsCoveragestore

        public boolean existsCoveragestore​(java.lang.String workspace,
                                           java.lang.String csName,
                                           boolean quietOnNotFound)
        Checks if the selected Coverage store is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        workspace - workspace of the coveragestore
        csName - name of the coveragestore
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the coveragestore exists
      • existsCoveragestore

        public boolean existsCoveragestore​(java.lang.String workspace,
                                           java.lang.String csName)
        Checks if the selected Coverage store is present.
        Parameters:
        workspace - workspace of the coveragestore
        csName - name of the coveragestore
        Returns:
        boolean indicating if the coveragestore exists
      • getCoverages

        public RESTCoverageList getCoverages​(java.lang.String workspace,
                                             java.lang.String csName)
        Get list of coverages (usually only one).
        Parameters:
        workspace - The name of the workspace
        csName - The name of the CoverageStore
        Returns:
        Coverages list as a RESTCoverageList
      • getCoverage

        public RESTCoverage getCoverage​(java.lang.String workspace,
                                        java.lang.String store,
                                        java.lang.String name)
        Get detailed info about a given Coverage.
        Parameters:
        workspace - The name of the workspace
        store - The name of the CoverageStore
        name - The name of the Coverage
        Returns:
        Coverage details as a RESTCoverage
      • existsCoverage

        public boolean existsCoverage​(java.lang.String workspace,
                                      java.lang.String store,
                                      java.lang.String name,
                                      boolean quietOnNotFound)
        Checks if the selected Coverage is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        workspace - workspace of the coveragestore
        store - name of the coveragestore
        name - name of the coverage
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the coverage exists
      • existsCoverage

        public boolean existsCoverage​(java.lang.String workspace,
                                      java.lang.String store,
                                      java.lang.String name)
        Checks if the selected Coverage is present.
        Parameters:
        workspace - workspace of the coveragestore
        store - name of the coveragestore
        name - name of the coverage
        Returns:
        boolean indicating if the coverage exists
      • getCoverage

        public RESTCoverage getCoverage​(RESTLayer layer)
        Get detailed info about a Coverage given the Layer where it's published with.
        Parameters:
        layer - A layer publishing the CoverageStore
        Returns:
        Coverage details as a RESTCoverage
      • getWmsStores

        public RESTWmsStoreList getWmsStores​(java.lang.String workspace)
        Get summary info about all WmsStore in a WorkSpace.
        Parameters:
        workspace - The name of the workspace
        Returns:
        summary info about CoverageStores as a RESTWmsStoreList
      • getWmsStore

        public RESTWmsStore getWmsStore​(java.lang.String workspace,
                                        java.lang.String wsName)
        Get detailed info about a given WmsStore in a given Workspace.
        Parameters:
        workspace - The name of the workspace
        wsName - The name of the WmsStore
        Returns:
        WmsStore details as a RESTWmsStore
      • getWmsStore

        public RESTWmsStore getWmsStore​(RESTWms wms)
        Get detailed info about a Wms's Datastore.
        Parameters:
        wms - the RESTWms
        Returns:
        wmsStore details as a RESTWmsStore
      • existsWmsstore

        public boolean existsWmsstore​(java.lang.String workspace,
                                      java.lang.String wsName,
                                      boolean quietOnNotFound)
        Checks if the selected Wms store is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        workspace - workspace of the wmsstore
        wsName - name of the wmsstore
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the wmsstore exists
      • existsWmsstore

        public boolean existsWmsstore​(java.lang.String workspace,
                                      java.lang.String wsName)
        Checks if the selected wms store is present.
        Parameters:
        workspace - workspace of the wmsstore
        wsName - name of the wmsstore
        Returns:
        boolean indicating if the wmsstore exists
      • getWms

        public RESTWmsList getWms​(java.lang.String workspace,
                                  java.lang.String wsName)
        Get list of wmss (usually only one).
        Parameters:
        workspace - The name of the workspace
        wsName - The name of the WmsStore
        Returns:
        wms list as a RESTWmsList
      • getWms

        public RESTWms getWms​(java.lang.String workspace,
                              java.lang.String store,
                              java.lang.String name)
        Get detailed info about a given Wms.
        Parameters:
        workspace - The name of the workspace
        store - The name of the WmsStore
        name - The name of the Wms
        Returns:
        wms details as a RESTWms
      • existsWms

        public boolean existsWms​(java.lang.String workspace,
                                 java.lang.String store,
                                 java.lang.String name,
                                 boolean quietOnNotFound)
        Checks if the selected Wms is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        workspace - workspace of the wmsstore
        name - name of the wms
        quietOnNotFound - if true, no exception is logged
        store - a String object.
        Returns:
        boolean indicating if the coverage exists
      • existsWms

        public boolean existsWms​(java.lang.String workspace,
                                 java.lang.String store,
                                 java.lang.String name)
        Checks if the selected wms is present.
        Parameters:
        workspace - workspace of the wmsstore
        store - name of the wmsstore
        name - name of the wms
        Returns:
        boolean indicating if the coverage exists
      • getWms

        public RESTWms getWms​(RESTLayer layer)
        Get detailed info about a Wms given the Layer where it's published with.
        Parameters:
        layer - A layer publishing the wmsStore
        Returns:
        Wms details as a RESTWms
      • getResource

        public RESTResource getResource​(RESTLayer layer)
        Get detailed info about a Resource given the Layer where it's published with. The Resource can then be converted to RESTCoverage or RESTFeatureType
        Parameters:
        layer - a RESTLayer object.
        Returns:
        Resource details as a RESTResource
      • getLayerGroups

        public RESTLayerGroupList getLayerGroups​(java.lang.String workspace)
        Get summary info about all LayerGroups in the given workspace.
        Parameters:
        workspace - name of the workspace
        Returns:
        summary info about LayerGroups as a RESTLayerGroupList
      • getLayerGroup

        public RESTLayerGroup getLayerGroup​(java.lang.String workspace,
                                            java.lang.String name)
        Get detailed info about a given LayerGroup.
        Parameters:
        workspace - name of the workspace
        name - the name of the LayerGroup
        Returns:
        LayerGroup details as a RESTLayerGroup
      • getLayerGroup

        public RESTLayerGroup getLayerGroup​(java.lang.String name)
        Get detailed info about a given LayerGroup.
        Parameters:
        name - The name of the LayerGroup
        Returns:
        LayerGroup details as a RESTLayerGroup
      • existsLayerGroup

        public boolean existsLayerGroup​(java.lang.String workspace,
                                        java.lang.String name,
                                        boolean quietOnNotFound)
        Checks if the selected LayerGroup is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        workspace - workspace of the LayerGroup
        name - name of the LayerGroup
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the LayerGroup exists
      • existsLayerGroup

        public boolean existsLayerGroup​(java.lang.String workspace,
                                        java.lang.String name)
        Checks if the selected LayerGroup is present.
        Parameters:
        workspace - workspace of the LayerGroup
        name - name of the LayerGroup
        Returns:
        boolean indicating if the LayerGroup exists
      • getLayers

        public RESTLayerList getLayers()
        Get summary info about all Layers.
        Returns:
        summary info about Layers as a RESTLayerList
      • getFeatureTypes

        public RESTFeatureTypeList getFeatureTypes​(java.lang.String workspace)
        Get summary info about all FeatureTypes of a workspace.
        Parameters:
        workspace - a String object.
        Returns:
        summary info about Layers as a RESTLayerList
      • getLayer

        public RESTLayer getLayer​(java.lang.String name)
        Deprecated.
        Get detailed info about a given Layer.
        Parameters:
        name - The name of the Layer
        Returns:
        Layer details as a RESTLayer
      • getLayer

        public RESTLayer getLayer​(java.lang.String workspace,
                                  java.lang.String name)
        Get detailed info about a given Layer.
        Parameters:
        workspace - the workspace name
        name - the layer name
        Returns:
        a RESTLayer with layer information or null
      • existsLayer

        public boolean existsLayer​(java.lang.String workspace,
                                   java.lang.String name,
                                   boolean quietOnNotFound)
        Checks if the selected Layer is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        workspace - workspace of the Layer
        name - name of the Layer
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the Layer exists
      • existsLayer

        public boolean existsLayer​(java.lang.String workspace,
                                   java.lang.String name)
        Checks if the selected Layer is present.
        Parameters:
        workspace - workspace of the Layer
        name - name of the Layer
        Returns:
        boolean indicating if the Layer exists
      • getNamespace

        public RESTNamespace getNamespace​(java.lang.String prefix)
        Get a namespace.
        Parameters:
        prefix - namespace prefix.
        Returns:
        a RESTNamespace, or null if couldn't be created.
      • getNamespaceNames

        public java.util.List<java.lang.String> getNamespaceNames()
        Get the names of all the Namespaces.
        This is a shortcut call: These info could be retrieved using getNamespaces
        Returns:
        the list of the names of all Namespaces.
      • existsNamespace

        public boolean existsNamespace​(java.lang.String prefix,
                                       boolean quietOnNotFound)
        Checks if the selected Namespace is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        prefix - namespace prefix.
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the Namespace exists
      • existsNamespace

        public boolean existsNamespace​(java.lang.String prefix)
        Checks if the selected Namespace is present.
        Parameters:
        prefix - namespace prefix.
        Returns:
        boolean indicating if the Namespace exists
      • getWorkspaceNames

        public java.util.List<java.lang.String> getWorkspaceNames()
        Get the names of all the Workspaces.
        This is a shortcut call: These info could be retrieved using getWorkspaces
        Returns:
        the list of the names of all Workspaces or an empty list.
      • existsWorkspace

        public boolean existsWorkspace​(java.lang.String prefix,
                                       boolean quietOnNotFound)
        Checks if the selected Workspace is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        prefix - Workspace prefix.
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the Workspace exists
      • existsWorkspace

        public boolean existsWorkspace​(java.lang.String prefix)
        Checks if the selected Workspace is present.
        Parameters:
        prefix - Workspace prefix.
        Returns:
        boolean indicating if the Workspace exists
      • getGranuleById

        public RESTStructuredCoverageGranulesList getGranuleById​(java.lang.String workspace,
                                                                 java.lang.String coverageStore,
                                                                 java.lang.String coverage,
                                                                 java.lang.String id)
                                                          throws java.net.MalformedURLException,
                                                                 java.io.UnsupportedEncodingException
        Get information about a granule for a structured coverage.
        Parameters:
        workspace - the GeoServer workspace
        coverageStore - the GeoServer coverageStore
        id - the ID of the granule to get information for
        coverage - a String object.
        Returns:
        null in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.
        Throws:
        java.net.MalformedURLException - if any.
        java.io.UnsupportedEncodingException - if any.
      • existsGranule

        public boolean existsGranule​(java.lang.String workspace,
                                     java.lang.String coverageStore,
                                     java.lang.String coverage,
                                     java.lang.String id,
                                     boolean quietOnNotFound)
        Checks if the selected Granule is present. Parameter quietOnNotFound can be used for controlling the logging when 404 is returned.
        Parameters:
        workspace - workspace of the coveragestore
        coverageStore - name of the coveragestore
        coverageStore - name of the coveragestore
        coverage - name of the coverage
        id - id of the granule
        quietOnNotFound - if true, no exception is logged
        Returns:
        boolean indicating if the Granule exists
      • existsGranule

        public boolean existsGranule​(java.lang.String workspace,
                                     java.lang.String coverageStore,
                                     java.lang.String coverage,
                                     java.lang.String id)
        Checks if the selected Granule is present.
        Parameters:
        workspace - workspace of the coveragestore
        coverageStore - name of the coveragestore
        coverageStore - name of the coveragestore
        coverage - name of the coverage
        id - id of the granule
        Returns:
        boolean indicating if the Granule exists
      • getGranuleIndexSchema

        public RESTStructuredCoverageIndexSchema getGranuleIndexSchema​(java.lang.String workspace,
                                                                       java.lang.String coverageStore,
                                                                       java.lang.String coverage)
        Get information about the schema of the index for a structured coverage.
        Parameters:
        workspace - the GeoServer workspace
        coverageStore - the GeoServer coverageStore
        coverage - a String object.
        Returns:
        null in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.
      • getGranules

        public RESTStructuredCoverageGranulesList getGranules​(java.lang.String workspace,
                                                              java.lang.String coverageStore,
                                                              java.lang.String coverage,
                                                              java.lang.String filter,
                                                              java.lang.Integer offset,
                                                              java.lang.Integer limit)
                                                       throws java.io.UnsupportedEncodingException
        Get information about the granules for a coverage with optional filter and paging.
        Parameters:
        workspace - the GeoServer workspace
        coverageStore - the GeoServer coverageStore
        coverageStore - the GeoServer coverageStore
        coverage - the name of the target coverage
        filter - the format of the file to upload, can be null to include all the granules
        offset - the start page, can be null or an integer
        limit - the dimension of the page, can be null or a positive integer
        Returns:
        null in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.
        Throws:
        java.io.UnsupportedEncodingException - if any.