|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.geosolutions.geoserver.rest.GeoServerRESTReader
public class GeoServerRESTReader
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, ...).
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
boolean |
existGeoserver()
Check if a GeoServer instance is running at the given URL. |
boolean |
existsStyle(String styleName)
Check if a Style exists in the configured GeoServer instance. |
boolean |
existsStyle(String workspace,
String styleName)
|
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 |
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. |
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. use getLayer(String, String) |
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)
|
List<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 |
|---|
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)
MalformedURLException
public 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 credential
MalformedURLException
public GeoServerRESTReader(URL gsUrl,
String username,
String password)
gsUrl - the base GeoServer URL (e.g.: http://localhost:8080/geoserver)username - username auth credentialpassword - password auth credential| Method Detail |
|---|
public 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 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 styleName)
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 workspace
RESTDataStoreList
public RESTDataStore getDatastore(String workspace,
String dsName)
workspace - The name of the workspacedsName - The name of the Datastore
RESTDataStorepublic RESTDataStore getDatastore(RESTFeatureType featureType)
featureType - the RESTFeatureType
RESTDataStorepublic RESTFeatureType getFeatureType(RESTLayer layer)
layer - A layer publishing the FeatureType
RESTCoveragepublic RESTCoverageStoreList getCoverageStores(String workspace)
workspace - The name of the workspace
RESTDataStoreList
public RESTCoverageStore getCoverageStore(String workspace,
String csName)
workspace - The name of the workspacecsName - The name of the CoverageStore
RESTCoverageStorepublic RESTCoverageStore getCoverageStore(RESTCoverage coverage)
coverage - the RESTFeatureType
RESTCoverageStore
public RESTCoverageList getCoverages(String workspace,
String csName)
workspace - The name of the workspacecsName - The name of the CoverageStore
RESTCoverageList
public RESTCoverage getCoverage(String workspace,
String store,
String name)
workspace - The name of the workspacestore - The name of the CoverageStorename - The name of the Coverage
RESTCoveragepublic RESTCoverage getCoverage(RESTLayer layer)
layer - A layer publishing the CoverageStore
RESTCoveragepublic RESTResource getResource(RESTLayer layer)
RESTResourcepublic RESTLayerGroupList getLayerGroups(String workspace)
workspace - name of the workspace
RESTLayerGroupList
public RESTLayerGroup getLayerGroup(String workspace,
String name)
workspace - name of the workspacename - the name of the LayerGroup
RESTLayerGrouppublic RESTLayerGroupList getLayerGroups()
RESTLayerGroupListpublic RESTLayerGroup getLayerGroup(String name)
name - The name of the LayerGroup
RESTLayerGrouppublic RESTLayerList getLayers()
RESTLayerListpublic RESTFeatureTypeList getFeatureTypes(String workspace)
RESTLayerListpublic RESTLayer getLayer(String name)
getLayer(String, String)
name - The name of the Layer
RESTLayer
public RESTLayer getLayer(String workspace,
String name)
workspace - the workspace namename - the layer name
public RESTNamespace getNamespace(String prefix)
prefix - namespace prefix.
public RESTNamespaceList getNamespaces()
RESTNamespaceListpublic List<String> getNamespaceNames()
getNamespaces
public RESTWorkspaceList getWorkspaces()
RESTWorkspaceListpublic List<String> getWorkspaceNames()
getWorkspaces
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 for
null in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.
MalformedURLException
UnsupportedEncodingException
public RESTStructuredCoverageIndexSchema getGranuleIndexSchema(String workspace,
String coverageStore,
String coverage)
throws MalformedURLException
workspace - the GeoServer workspacecoverageStore - the GeoServer coverageStoreformat - the format of the file to upload
null in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.
MalformedURLException
UnsupportedEncodingException
public 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 integer
null in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.
MalformedURLException
UnsupportedEncodingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||