|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.geosolutions.geoserver.rest.GeoServerRESTPublisher
public class GeoServerRESTPublisher
Connect to a GeoServer instance to publish or modify its contents via REST API.
There are no modifiable instance fields, so all the calls are thread-safe.
Nested Class Summary | |
---|---|
static class |
GeoServerRESTPublisher.CoverageStoreExtension
Raster data format being uploaded. |
static class |
GeoServerRESTPublisher.DataStoreExtension
Vector data format being uploaded. |
static class |
GeoServerRESTPublisher.DataStoreType
Deprecated. use GeoServerRESTPublisher.DataStoreType |
static class |
GeoServerRESTPublisher.Format
Represents the format used to GET, PUT or POST information via REST. |
static class |
GeoServerRESTPublisher.ParameterConfigure
Control if feature types are to be automatically configured upon file upload. |
static class |
GeoServerRESTPublisher.ParameterUpdate
Controls how existing data is handled when the file is PUT into a datastore that (a) already exists and (b) already contains a schema that matches the content of the file. |
static class |
GeoServerRESTPublisher.StoreType
DataStoreType definitions. |
static class |
GeoServerRESTPublisher.UploadMethod
Specifies the method used to publish a resource. |
Field Summary | |
---|---|
static String |
DEFAULT_CRS
|
Constructor Summary | |
---|---|
GeoServerRESTPublisher(String restURL,
String username,
String password)
Creates a GeoServerRESTPublisher to connect against a GeoServer instance with the given URL and user credentials. |
Method Summary | |
---|---|
String |
backup(String backupDir)
Issues a GeoServer BACKUP. |
String |
backup(String backupDir,
boolean includedata,
boolean includegwc,
boolean includelog)
Issues a GeoServer BACKUP. |
boolean |
configureCoverage(GSCoverageEncoder ce,
String wsname,
String csname)
Configure an existent coverage in a given workspace and coverage store |
boolean |
configureLayer(String workspace,
String resourceName,
GSLayerEncoder layer)
Allows to configure some layer attributes such and DefaultStyle |
boolean |
configureLayerGroup(String name,
GSLayerGroupEncoder group)
Update a LayerGroup using the specified encoder |
boolean |
configureLayerGroup(String workspace,
String name,
GSLayerGroupEncoder group)
Update a LayerGroup using the specified encoder |
boolean |
createCoverage(GSCoverageEncoder ce,
String wsname,
String csname)
Deprecated. use createCoverage(String, String, GSCoverageEncoder) |
boolean |
createCoverage(String wsname,
String storeName,
GSCoverageEncoder ce)
Create a new coverage in a given workspace and coverage store |
boolean |
createExternalMosaic(String workspace,
String storeName,
File mosaicDir,
GSCoverageEncoder coverageEncoder,
GSLayerEncoder layerEncoder)
Deprecated. use publishExternalMosaic(String, String, File, GSCoverageEncoder, GSLayerEncoder) |
RESTCoverageStore |
createExternaMosaicDatastore(String workspace,
String storeName,
File mosaicDir,
GeoServerRESTPublisher.ParameterConfigure configure,
GeoServerRESTPublisher.ParameterUpdate update)
Publish a Mosaic from a filesystem currently readable by GeoServer. |
boolean |
createLayerGroup(String name,
GSLayerGroupEncoder group)
Create a new LayerGroup using the specified encoder |
boolean |
createLayerGroup(String workspace,
String name,
GSLayerGroupEncoder group)
Create a new LayerGroup using the specified encoder |
boolean |
createNamespace(String prefix,
URI uri)
Create a new Namespace. |
boolean |
createPostGISDatastore(String workspace,
GSPostGISDatastoreEncoder datastoreEncoder)
Deprecated. Will be deleted in next version 1.5.x, use GeoServerRESTDatastoreManager instead. |
boolean |
createWorkspace(String workspace)
Create a new Workspace. |
boolean |
createWorkspace(String name,
URI uri)
Create both a workspace and its associated namespace. |
protected String |
encode(String s)
URL-encodes a String. |
boolean |
publishDBLayer(String workspace,
String storename,
GSFeatureTypeEncoder fte,
GSLayerEncoder layerEncoder)
Publish and configure a new layer from an existing DataStore (v. |
boolean |
publishDBLayer(String workspace,
String storename,
String layername,
String srs,
String defaultStyle)
Deprecated. Will be removed in the next release. |
RESTCoverageStore |
publishExternalGeoTIFF(String workspace,
String storeName,
File geotiff,
GSCoverageEncoder coverageEncoder,
GSLayerEncoder layerEncoder)
Publish a GeoTiff already in a filesystem readable by GeoServer. |
boolean |
publishExternalGeoTIFF(String workspace,
String storeName,
File geotiff,
String coverageName,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle)
Publish a GeoTiff already in a filesystem readable by GeoServer. |
boolean |
publishExternalMosaic(String workspace,
String storeName,
File mosaicDir,
GSCoverageEncoder coverageEncoder,
GSLayerEncoder layerEncoder)
Publish a Mosaic already in a filesystem readable by GeoServer. |
boolean |
publishExternalMosaic(String workspace,
String storeName,
File mosaicDir,
String srs,
String defaultStyle)
Publish a Mosaic already in a filesystem readable by GeoServer. |
boolean |
publishGeoTIFF(String workspace,
String storeName,
File geotiff)
Upload and publish a GeoTIFF image. |
boolean |
publishGeoTIFF(String workspace,
String storeName,
String coverageName,
File geotiff)
Upload and publish a GeoTIFF image. |
boolean |
publishGeoTIFF(String workspace,
String storeName,
String resourceName,
File geotiff,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle)
Deprecated. use the former method with bbox set to null. |
boolean |
publishGeoTIFF(String workspace,
String storeName,
String coverageName,
File geotiff,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle,
double[] bbox)
Upload and publish a GeoTIFF image. |
boolean |
publishImageMosaic(String workspace,
String storeName,
File zipFile)
Publish imagemosaic as zip file. |
boolean |
publishImageMosaic(String workspace,
String storeName,
File zipFile,
GeoServerRESTPublisher.ParameterConfigure configure,
org.apache.commons.httpclient.NameValuePair... params)
Publish imagemosaic as zip file. |
boolean |
publishShp(String workspace,
String storeName,
org.apache.commons.httpclient.NameValuePair[] storeParams,
String datasetName,
GeoServerRESTPublisher.UploadMethod method,
URI shapefile,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle)
Deprecated. use publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, String) instead as the behaviour of
this method is misleading as it allows you to use wrong ProjectionPolicy values. |
boolean |
publishShp(String workspace,
String storeName,
org.apache.commons.httpclient.NameValuePair[] storeParams,
String datasetName,
GeoServerRESTPublisher.UploadMethod method,
URI shapefile,
String srs,
String defaultStyle)
Publish a shapefile. |
boolean |
publishShp(String workspace,
String storeName,
org.apache.commons.httpclient.NameValuePair[] storeParams,
String datasetName,
GeoServerRESTPublisher.UploadMethod method,
URI shapefile,
String srs,
String nativeCRS,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle)
Publish a shapefile. |
boolean |
publishShp(String workspace,
String storename,
String datasetname,
File zipFile)
Upload an publish a local shapefile. |
boolean |
publishShp(String workspace,
String storename,
String layername,
File zipFile,
String srs)
Publish a zipped shapefile forcing the srs to the one provided. |
boolean |
publishShp(String workspace,
String storename,
String layername,
File zipFile,
String srs,
org.apache.commons.httpclient.NameValuePair... params)
Publish a zipped shapefile. |
boolean |
publishShp(String workspace,
String storename,
String layerName,
File zipFile,
String srs,
String defaultStyle)
Publish a zipped shapefile. |
boolean |
publishShpCollection(String workspace,
String storeName,
URI resource)
Publish a collection of shapefiles. |
boolean |
publishStyle(File sldFile)
Store and publish a Style. |
boolean |
publishStyle(File sldFile,
String name)
Store and publish a Style, assigning it a name. |
boolean |
publishStyle(String sldBody)
Store and publish a Style. |
boolean |
publishStyle(String sldBody,
String name)
Store and publish a Style, assigning it a name. |
boolean |
publishWorldImage(String workspace,
String coveragestore,
File zipFile)
Publish a zipped worldimage file. |
boolean |
publishWorldImage(String workspace,
String coveragestore,
File zipFile,
GeoServerRESTPublisher.ParameterConfigure configure,
org.apache.commons.httpclient.NameValuePair... params)
Publish a zipped worldimage file. |
boolean |
reload()
Reload the target geoserver configuration |
boolean |
reloadStore(String workspace,
String storeName,
GeoServerRESTPublisher.StoreType storeType)
/workspaces/ |
boolean |
removeCoverageStore(String workspace,
String storename)
Deprecated. use removeCoverageStore(String, String, boolean) |
boolean |
removeCoverageStore(String workspace,
String storename,
boolean recurse)
Remove a given CoverageStore in a given Workspace. |
boolean |
removeDatastore(String workspace,
String storename)
Deprecated. will be removed in next release use removeDatastore(String, String, boolean) |
boolean |
removeDatastore(String workspace,
String storename,
boolean recurse)
Remove a given Datastore in a given Workspace. |
boolean |
removeLayer(String workspace,
String layerName)
remove a generic given layer from a given workspace |
boolean |
removeLayerGroup(String name)
Remove a layer group. |
boolean |
removeLayerGroup(String workspace,
String name)
Remove a layer group. |
boolean |
removeNamespace(String prefix,
boolean recurse)
Remove a given Namespace. |
boolean |
removeStyle(String styleName)
Remove a Style. |
boolean |
removeStyle(String styleName,
boolean purge)
Remove a Style. |
boolean |
removeWorkspace(String workspace)
Deprecated. removeWorkspace(String, boolean) |
boolean |
removeWorkspace(String workspace,
boolean recurse)
Remove a given Workspace. |
boolean |
reset()
Reset the target geoserver configuration |
String |
restore(String backupDir)
Issues a GeoServer RESTORE. |
protected String |
sanitize(String s)
Appends ".DUMMY" to any string containing a dot (sic). |
boolean |
unpublishCoverage(String workspace,
String storename,
String layerName)
Remove the Coverage configuration from GeoServer. |
boolean |
unpublishFeatureType(String workspace,
String storename,
String layerName)
Removes the featuretype and the associated layer. |
boolean |
updateNamespace(String prefix,
URI uri)
Update a Namespace URI. |
boolean |
updateStyle(File sldFile,
String name)
Update a Style. |
boolean |
updateStyle(String sldBody,
String name)
Update a Style. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CRS
Constructor Detail |
---|
public GeoServerRESTPublisher(String restURL, String username, String password)
restURL
- the base GeoServer URL (e.g.: http://localhost:8080/geoserver)username
- auth credentialpassword
- auth credentialMethod Detail |
---|
public String backup(String backupDir) throws IllegalArgumentException
Won't include data, cached tiles, or logs. Use backup(String, boolean, boolean, boolean)
to control these parameters.
backupDir
- the target Backup Dir String.
IllegalArgumentException
- if the backupDir is null or emptypublic String backup(String backupDir, boolean includedata, boolean includegwc, boolean includelog) throws IllegalArgumentException
backupDir
- the target Backup Dir String.includedata
- whether or not include the data dir Boolean.includegwc
- whether or not include the geowebcache dir Boolean.includelog
- whether or not include the log dir Boolean.
IllegalArgumentException
- if the backupDir is null or empty.public String restore(String backupDir) throws IllegalArgumentException
backupDir
- the source backup dir.
IllegalArgumentException
- if the backupDir is null or emptypublic boolean createWorkspace(String workspace)
GeoServer will automatically create an associated Namespace with the URI being "http://{workspaceName}". To specify a custom Namespace URI, use
createWorkspace(String, URI)
.
workspace
- The name of the new workspace.
public boolean createWorkspace(String name, URI uri)
Note that this method is equivalent to createNamespace(java.lang.String, java.net.URI)
.
name
- Name for the new workspace, which will be also its associated namespace prefix.uri
- Namespace URI. Cannot be empty.
public boolean createNamespace(String prefix, URI uri)
prefix
- The name of the new Namespace.uri
- The URI of the new Namespace.
public boolean updateNamespace(String prefix, URI uri)
prefix
- The prefix of an existing Namespace.uri
- The new URI.
public boolean removeNamespace(String prefix, boolean recurse)
prefix
- The Namespace prefixrecurse
- The recurse parameter is used to recursively delete all resources contained in the workspace associated with this Namespace.
This includes data stores, coverage stores, feature types, etc... Allowable values for this parameter are true or false.
The default (safer) value is false.
public boolean publishStyle(String sldBody)
sldBody
- the full SLD document as a String.
public boolean publishStyle(String sldBody, String name) throws IllegalArgumentException
sldBody
- the full SLD document as a String.name
- the Style name.
IllegalArgumentException
- if the style body is null or empty.public boolean publishStyle(File sldFile)
sldFile
- the File containing the SLD document.
public boolean publishStyle(File sldFile, String name)
sldFile
- the File containing the SLD document.name
- the Style name.
public boolean updateStyle(String sldBody, String name) throws IllegalArgumentException
sldBody
- the new SLD document as a String.name
- the Style name to update.
IllegalArgumentException
- if the style body or name are null or empty.public boolean updateStyle(File sldFile, String name) throws IllegalArgumentException
sldFile
- the File containing the SLD document.name
- the Style name.
IllegalArgumentException
- if the sldFile file or name are null or name is empty.public boolean removeStyle(String styleName, boolean purge) throws IllegalArgumentException
The Style will be unpublished, and (optionally) the SLD file will be removed.
styleName
- the name of the Style to remove.purge
- remove the related SLD file from disk.
IllegalArgumentException
- if styleName is null or empty.public boolean removeStyle(String styleName)
The Style will be unpublished and the related SLD file will be removed.
styleName
- the name of the Style to remove.
public boolean createPostGISDatastore(String workspace, GSPostGISDatastoreEncoder datastoreEncoder)
GeoServerRESTDatastoreManager
instead.
workspace
- Name of the workspace to contain the database. This will also be the prefix of any layer names created from tables in the
database.datastoreEncoder
- the set of parameters to be set to the datastore (including connection params).
public boolean publishDBLayer(String workspace, String storename, String layername, String srs, String defaultStyle)
public boolean publishDBLayer(String workspace, String storename, GSFeatureTypeEncoder fte, GSLayerEncoder layerEncoder)
workspace
- Workspace name where DataStore is.storename
- DataStore name.fte
- FeatureType configuration details using a GSFeatureTypeEncoder
.
true
if layer is successfully created.public boolean publishShp(String workspace, String storename, String datasetname, File zipFile) throws FileNotFoundException, IllegalArgumentException
The SRS will be set to EPSG:4326.
workspace
- The workspace name.storename
- The store name.layername
- The layer name.zipFile
- The zipped file to publish.
true
if the operation completed successfully.
FileNotFoundException
- , IllegalArgumentException
IllegalArgumentException
#publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, ProjectionPolicy, String)}
public boolean publishShp(String workspace, String storeName, org.apache.commons.httpclient.NameValuePair[] storeParams, String datasetName, GeoServerRESTPublisher.UploadMethod method, URI shapefile, String srs, String nativeCRS, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
workspace
- the name of the workspace to usestorename
- the name of the store to createstoreParams
- parameters to append to the url (can be null).layername
- the name of the layer to configuremethod
- GeoServerRESTPublisher.UploadMethod
fileUri
- the uri of the file containing the shapefile.It should be:
srs
- the SRS for this shapefile. It must be an ESPG code or GeoServer will choke.nativeCRS
- the nativeCRS for this shapefile. It can be an EPSG code (for GSResourceEncoder.ProjectionPolicy.NONE
or a WKT for
GSResourceEncoder.ProjectionPolicy.REPROJECT_TO_DECLARED
.policy
- GSResourceEncoder.ProjectionPolicy
defaultStyle
- the default style to set (can be null).
FileNotFoundException
- if file to upload is not found
IllegalArgumentException
- if any of the mandatory arguments are null
.public boolean publishShp(String workspace, String storeName, org.apache.commons.httpclient.NameValuePair[] storeParams, String datasetName, GeoServerRESTPublisher.UploadMethod method, URI shapefile, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, String)
instead as the behaviour of
this method is misleading as it allows you to use wrong ProjectionPolicy values.
workspace
- the name of the workspace to usestorename
- the name of the store to createstoreParams
- parameters to append to the url (can be null).layername
- the name of the layer to configuremethod
- GeoServerRESTPublisher.UploadMethod
fileUri
- the uri of the file containing the shapefile.It should be:
srs
- the SRS for this shapefile. It must be an ESPG code or GeoServer will choke. Notice that we can only use
GSResourceEncoder.ProjectionPolicy.FORCE_DECLARED
.policy
- GSResourceEncoder.ProjectionPolicy
defaultStyle
- the default style to set (can be null).
FileNotFoundException
- if file to upload is not found
IllegalArgumentException
- if any of the mandatory arguments are null
.public boolean publishShp(String workspace, String storeName, org.apache.commons.httpclient.NameValuePair[] storeParams, String datasetName, GeoServerRESTPublisher.UploadMethod method, URI shapefile, String srs, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
workspace
- the name of the workspace to usestorename
- the name of the store to createstoreParams
- parameters to append to the url (can be null).layername
- the name of the layer to configuremethod
- GeoServerRESTPublisher.UploadMethod
fileUri
- the uri of the file containing the shapefile.It should be:
srs
- the SRS for this shapefile. It must be an ESPG code or GeoServer will choke.defaultStyle
- the default style to set (can be null).
FileNotFoundException
- if file to upload is not found
IllegalArgumentException
- if any of the mandatory arguments are null
.public boolean publishShp(String workspace, String storename, String layerName, File zipFile, String srs, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
workspace
- the name of the workspace to usestorename
- the name of the store to createlayerName
- the name of the layer to configurezipFile
- The zipped file to publishsrs
- the srs for this shapefile. It will be forced to use this one in GeoServer using GSResourceEncoder.ProjectionPolicy.FORCE_DECLARED
.defaultStyle
- the default style to set (can be null).
true
if the operation completed successfully
FileNotFoundException
- if file to upload is not found
IllegalArgumentException
- if any of the mandatory arguments are null
.#publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, ProjectionPolicy, String)}
public boolean publishShp(String workspace, String storename, String layername, File zipFile, String srs) throws FileNotFoundException
workspace
- the name of the workspace to usestorename
- the name of the store to createlayername
- the name of the layer to configurezipFile
- The zipped file to publishsrs
- the CRS for this shapefile. It must be an EPSG CODE !
true
if the operation completed successfully.
FileNotFoundException
- if file to upload is not found
IllegalArgumentException
- if any of the mandatory arguments are null
.#publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, ProjectionPolicy, String)}
public boolean publishShp(String workspace, String storename, String layername, File zipFile, String srs, org.apache.commons.httpclient.NameValuePair... params) throws FileNotFoundException, IllegalArgumentException
workspace
- the name of the workspace to usestorename
- the name of the store to createlayername
- the name of the layer to configurezipFile
- the zip file containing the shapefilesrs
- the shapefile srs. This must be an EPSG Codefor this code to work!params
- parameters to append to the url (can be null).true
if the operation completed successfully.
FileNotFoundException
- if file to upload is not found
IllegalArgumentException
- if any of the mandatory arguments are null
.#publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, ProjectionPolicy, String)}
public boolean publishShpCollection(String workspace, String storeName, URI resource) throws FileNotFoundException
Will automatically create the store and publish each shapefile as a layer.
workspace
- the name of the workspace to usestoreName
- the name of the store to createresource
- the shapefile collection. It can be:
true
if publication successful.
FileNotFoundException
- if the specified zip file does not exist.public boolean publishGeoTIFF(String workspace, String storeName, File geotiff) throws FileNotFoundException
workspace
- Workspace to usestoreName
- The store name to be used or created.geotiff
- The GeoTIFF file.
FileNotFoundException
- if GeoTIFF file does not exist.public boolean publishGeoTIFF(String workspace, String storeName, String coverageName, File geotiff) throws FileNotFoundException, IllegalArgumentException
workspace
- Workspace to usestoreName
- Name of the coveragestore (if null the file name will be used)coverageName
- the name of the coverage (if null the file name will be used)geotiff
- file to upload
FileNotFoundException
- if file does not exists
IllegalArgumentException
- if workspace or geotiff are nullpublic boolean publishGeoTIFF(String workspace, String storeName, String resourceName, File geotiff, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
#publishGeoTIFF(String, String, String, File, String, ProjectionPolicy, String, double[])
but without the last parameter
(bbox). Kept here for backwards compatibility.
FileNotFoundException
IllegalArgumentException
public boolean publishGeoTIFF(String workspace, String storeName, String coverageName, File geotiff, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle, double[] bbox) throws FileNotFoundException, IllegalArgumentException
workspace
- Workspace to usestoreName
- Name of the coveragestore (if null the file name will be used)coverageName
- the name of the coverage (if null the file name will be used)geotiff
- file to uploadsrs
- the native CRSpolicy
- projection policy. See GSResourceEncoder.ProjectionPolicy
.defaultStyle
- the default style to apply.bbox
- An array of 4 doubles indicating envelope in EPSG:4326. Order is [Xmin, Ymin, Xmax, Ymax].
FileNotFoundException
- if file does not exists
IllegalArgumentException
- if workspace or geotiff are nullpublic boolean publishExternalGeoTIFF(String workspace, String storeName, File geotiff, String coverageName, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
workspace
- an existing workspacestoreName
- the coverageStore to be createdgeotiff
- the geoTiff to be publishedsrs
- the native CRSpolicy
- projection policy. See GSResourceEncoder.ProjectionPolicy
.defaultStyle
- the default style to apply.
FileNotFoundException
- if file does not exists
IllegalArgumentException
- if any of the mandatory parameters are null.public RESTCoverageStore publishExternalGeoTIFF(String workspace, String storeName, File geotiff, GSCoverageEncoder coverageEncoder, GSLayerEncoder layerEncoder) throws IllegalArgumentException, FileNotFoundException
workspace
- an existing workspacestoreName
- the coverageStore to be createdgeotiff
- the geoTiff to be publishedcoverageEncoder
- coverage details. See GSCoverageEncoder
.layerEncoder
- layer details, See GSLayerEncoder
.
FileNotFoundException
- if file does not exists
IllegalArgumentException
- if any of the mandatory parameters are null.public boolean publishWorldImage(String workspace, String coveragestore, File zipFile) throws FileNotFoundException
workspace
- Workspace to usecoveragestore
- Name of the coveragestorezipFile
- zip file to upload
FileNotFoundException
public boolean publishWorldImage(String workspace, String coveragestore, File zipFile, GeoServerRESTPublisher.ParameterConfigure configure, org.apache.commons.httpclient.NameValuePair... params) throws FileNotFoundException
workspace
- Workspace to usecoveragestore
- Name of the coveragestorezipFile
- zip file to uploadconfigure
- Configure parameter. See GeoServerRESTPublisher.ParameterConfigure
. It can be null.params
- parameters to append to the url (can be null).GeoServerRESTPublisher.ParameterConfigure.NONE
.FileNotFoundException
public boolean publishImageMosaic(String workspace, String storeName, File zipFile) throws FileNotFoundException
workspace
- Workspace to usestoreName
- Name of the coveragestorezipFile
- file to upload
FileNotFoundException
public boolean publishImageMosaic(String workspace, String storeName, File zipFile, GeoServerRESTPublisher.ParameterConfigure configure, org.apache.commons.httpclient.NameValuePair... params) throws FileNotFoundException
workspace
- Workspace to usestoreName
- Name of the coveragestorezipFile
- file to uploadconfigure
- Configure parameter. See GeoServerRESTPublisher.ParameterConfigure
. It can be null.params
- parameters to append to the url (can be null).FileNotFoundException
public RESTCoverageStore createExternaMosaicDatastore(String workspace, String storeName, File mosaicDir, GeoServerRESTPublisher.ParameterConfigure configure, GeoServerRESTPublisher.ParameterUpdate update) throws FileNotFoundException
workspace
- an existing workspacestoreName
- the name of the coverageStore to be createdmosaicDir
- the directory where the raster images are locatedconfigure
- a specify if a coverage should be configured
FileNotFoundException
public boolean publishExternalMosaic(String workspace, String storeName, File mosaicDir, String srs, String defaultStyle) throws FileNotFoundException
workspace
- an existing workspacestoreName
- the name of the coverageStore to be createdmosaicDir
- the directory where the raster images are locatedsrs
- the coverage declared SRSdefaultStyle
- may be null
FileNotFoundException
public boolean createExternalMosaic(String workspace, String storeName, File mosaicDir, GSCoverageEncoder coverageEncoder, GSLayerEncoder layerEncoder) throws FileNotFoundException
publishExternalMosaic(String, String, File, GSCoverageEncoder, GSLayerEncoder)
FileNotFoundException
public boolean publishExternalMosaic(String workspace, String storeName, File mosaicDir, GSCoverageEncoder coverageEncoder, GSLayerEncoder layerEncoder) throws FileNotFoundException, IllegalArgumentException
workspace
- an existing workspacestoreName
- the name of the coverageStore to be createdmosaicDir
- the directory where the raster images are locatedcoverageEncoder
- the set of parameters to be set to the coverage (bbox, srs, ...)layerEncoder
- the set of parameters to be set to the layer (defaultstyle, wmspath, ...)
FileNotFoundException
IllegalArgumentException
public boolean unpublishCoverage(String workspace, String storename, String layerName)
First, the associated layer is removed, then the Coverage configuration itself.
CHECKME Maybe the coveragestore has to be removed as well.
public boolean unpublishFeatureType(String workspace, String storename, String layerName)
You may also want to remove the datastore
.
public boolean removeDatastore(String workspace, String storename)
removeDatastore(String, String, boolean)
workspace
- The name of the workspacestorename
- The name of the Datastore to remove.
public boolean removeDatastore(String workspace, String storename, boolean recurse) throws IllegalArgumentException
workspace
- The name of the workspacestorename
- The name of the Datastore to remove.recurse
- if remove should be performed recursively
IllegalArgumentException
- if workspace or storename are null or emptypublic boolean removeCoverageStore(String workspace, String storename)
removeCoverageStore(String, String, boolean)
workspace
- The name of the workspacestorename
- The name of the CoverageStore to remove.
public boolean removeCoverageStore(String workspace, String storename, boolean recurse) throws IllegalArgumentException
workspace
- The name of the workspacestorename
- The name of the CoverageStore to remove.recurse
- if remove should be performed recursively
IllegalArgumentException
public boolean removeWorkspace(String workspace)
removeWorkspace(String, boolean)
workspace
- the workspace to remove
GeoServerRESTPublisher#removeWorkspace(String, boolean)}
public boolean removeWorkspace(String workspace, boolean recurse) throws IllegalArgumentException
workspace
- The name of the workspacerecurse
- The recurse parameter is used to recursively delete all resources contained by the specified workspace. This includes data
stores, coverage stores, feature types, etc... Allowable values for this parameter are true or false. The default value is
false.
IllegalArgumentException
public boolean removeLayerGroup(String workspace, String name)
workspace
- the layer group workspace.name
- the layer group name.
public boolean removeLayerGroup(String name)
name
- the layer group name.
public boolean removeLayer(String workspace, String layerName)
workspace
- layerName
-
public boolean reloadStore(String workspace, String storeName, GeoServerRESTPublisher.StoreType storeType) throws IllegalArgumentException, MalformedURLException
workspace
- storeName
- mosaicDir
-
FileNotFoundException
IllegalArgumentException
MalformedURLException
public boolean reload()
public boolean reset()
public boolean configureLayer(String workspace, String resourceName, GSLayerEncoder layer) throws IllegalArgumentException
workspace
- resourceName
- the name of the resource to use (featureStore or coverageStore name)layer
- the layer encoder used to configure the layer
IllegalArgumentException
- if some arguments are null or emptypublic boolean createLayerGroup(String name, GSLayerGroupEncoder group)
name
- name of the layer groupgroup
- group encoder
public boolean createLayerGroup(String workspace, String name, GSLayerGroupEncoder group)
workspace
- name of the workspacename
- name of the layer groupgroup
- group encoder
public boolean configureLayerGroup(String name, GSLayerGroupEncoder group)
name
- name of the layer groupgroup
- group encoder
public boolean configureLayerGroup(String workspace, String name, GSLayerGroupEncoder group)
workspace
- name of the workspacename
- name of the layer groupgroup
- group encoder
public boolean configureCoverage(GSCoverageEncoder ce, String wsname, String csname)
ce
- contains the coverage name to configure and the configuration to applywsname
- the workspace to search for existent coveragecsname
- the coverage store to search for existent coverage
public boolean createCoverage(GSCoverageEncoder ce, String wsname, String csname)
createCoverage(String, String, GSCoverageEncoder)
public boolean createCoverage(String wsname, String storeName, GSCoverageEncoder ce) throws IllegalArgumentException
wsname
- the workspace to search for existent coveragestoreName
- an existent store name to use as data sourcece
- contains the coverage name to create and the configuration to apply
IllegalArgumentException
- if arguments are null or emptyprotected String sanitize(String s)
protected String encode(String s)
s
- The original string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |