|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.geosolutions.geoserver.rest.manager.GeoServerRESTAbstractManager
it.geosolutions.geoserver.rest.manager.GeoServerRESTStyleManager
public class GeoServerRESTStyleManager
| Field Summary |
|---|
| Fields inherited from class it.geosolutions.geoserver.rest.manager.GeoServerRESTAbstractManager |
|---|
gsBaseUrl, gspass, gsuser |
| Constructor Summary | |
|---|---|
GeoServerRESTStyleManager(URL restURL,
String username,
String password)
Default constructor. |
|
| Method Summary | |
|---|---|
protected String |
buildPostUrl(String workspace,
String name)
Creates a URL for the given stylename with the name in querystring |
protected String |
buildUrl(String workspace,
String name,
String ext)
Creates a URL for the given stylename with the name in the REST path |
protected String |
buildXmlUrl(String workspace,
String name)
|
boolean |
existsStyle(String name)
Check if a Style exists in the configured GeoServer instance. |
boolean |
existsStyle(String workspace,
String name)
|
String |
getSLD(String styleName)
Get the SLD body of a Style. |
String |
getSLD(String workspace,
String name)
Get the SLD body of a Style. |
RESTStyle |
getStyle(String name)
|
RESTStyle |
getStyle(String workspace,
String name)
|
RESTStyleList |
getStyles()
Get summary info about all Styles. |
RESTStyleList |
getStyles(String workspace)
Get summary info about Styles in a workspace. |
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 |
publishStyleInWorkspace(String workspace,
File sldFile)
Store and publish a Style. |
boolean |
publishStyleInWorkspace(String workspace,
File sldFile,
String name)
Store and publish a Style, assigning it a name. |
boolean |
publishStyleInWorkspace(String workspace,
String sldBody)
Store and publish a Style. |
boolean |
publishStyleInWorkspace(String workspace,
String sldBody,
String name)
Store and publish a Style, assigning it a name. |
boolean |
removeStyle(String styleName)
Remove a Style. |
boolean |
removeStyle(String styleName,
boolean purge)
Remove a Style. |
boolean |
removeStyleInWorkspace(String workspace,
String styleName)
Remove a Style. |
boolean |
removeStyleInWorkspace(String workspace,
String styleName,
boolean purge)
Remove a Style. |
boolean |
updateStyle(File sldFile,
String name)
Update a Style. |
boolean |
updateStyle(String sldBody,
String name)
Update a Style. |
boolean |
updateStyleInWorkspace(String workspace,
File sldFile,
String name)
Update a Style. |
boolean |
updateStyleInWorkspace(String workspace,
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 |
| Constructor Detail |
|---|
public GeoServerRESTStyleManager(URL restURL,
String username,
String password)
throws IllegalArgumentException
restURL - GeoServer REST API endpointusername - GeoServer REST API authorized usernamepassword - GeoServer REST API password for the former username
IllegalArgumentException| Method Detail |
|---|
public boolean existsStyle(String name)
throws RuntimeException
name - the name of the style to check for.
RuntimeException - if any other HTTP code than 200 or 404 was retrieved.public RESTStyleList getStyles()
RESTStyleListpublic RESTStyle getStyle(String name)
public String getSLD(String styleName)
public boolean existsStyle(String workspace,
String name)
public RESTStyleList getStyles(String workspace)
RESTStyleList
public RESTStyle getStyle(String workspace,
String name)
public String getSLD(String workspace,
String name)
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 publishStyleInWorkspace(String workspace,
String sldBody)
sldBody - the full SLD document as a String.
public boolean publishStyleInWorkspace(String workspace,
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 publishStyleInWorkspace(String workspace,
File sldFile)
sldFile - the File containing the SLD document.
public boolean publishStyleInWorkspace(String workspace,
File sldFile,
String name)
sldFile - the File containing the SLD document.name - the Style name.
public boolean updateStyleInWorkspace(String workspace,
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 updateStyleInWorkspace(String workspace,
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 removeStyleInWorkspace(String workspace,
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 removeStyleInWorkspace(String workspace,
String styleName)
The Style will be unpublished and the related SLD file will be removed.
styleName - the name of the Style to remove.
protected String buildPostUrl(String workspace,
String name)
workspace - nullable workspace namename - style name
protected String buildXmlUrl(String workspace,
String name)
protected String buildUrl(String workspace,
String name,
String ext)
workspace - nullable workspace namename - style nameext - nullable output extension (e.g. ".xml" ".sld")
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||