it.geosolutions.geoserver.rest.GeoServerRESTManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geoserver-manager Show documentation
Show all versions of geoserver-manager Show documentation
GeoServer Manager is a library to interact with GeoServer
The scope of this library is to have a simple API, and use as few external
libs as possible.
/*
* GeoServer-Manager - Simple Manager Library for GeoServer
*
* Copyright (C) 2007,2016 GeoSolutions S.A.S.
* http://www.geo-solutions.it
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package it.geosolutions.geoserver.rest;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTAbstractManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStoreManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStyleManager;
import java.net.MalformedURLException;
import java.net.URL;
/**
* The single entry point to all of geoserver-manager functionality.
*
* Instance this one, and use getters to use different components. These are:
*
* - getReader() simple, high-level access methods.
*
- getPublisher() simple, high-level pubhish methods.
*
- getFooManager, full-fledged management of catalog objects.
*
*
* @author Oscar Fonts
* @author Carlo Cancellieri - [email protected]
* @version $Id: $
*/
public class GeoServerRESTManager extends GeoServerRESTAbstractManager {
private final GeoServerRESTPublisher publisher;
private final GeoServerRESTReader reader;
private final GeoServerRESTStoreManager storeManager;
private final GeoServerRESTStyleManager styleManager;
private final GeoServerRESTStructuredGridCoverageReaderManager structuredGridCoverageReader;
private final GeoWebCacheREST geoWebCacheRest;
/**
* Default constructor.
*
* Indicates connection parameters to remote GeoServer instance.
*
* @param restURL GeoServer REST API endpoint
* @param username GeoServer REST API authorized username
* @param password GeoServer REST API password for the former username
* @throws java.lang.IllegalArgumentException {@link GeoServerRESTAbstractManager#GeoServerRESTAbstractManager(URL, String, String)}
*/
public GeoServerRESTManager(URL restURL, String username, String password)
throws IllegalArgumentException {
super(restURL, username, password);
// Internal publisher and reader, provide simple access methods.
publisher = new GeoServerRESTPublisher(restURL.toString(), username, password);
reader = new GeoServerRESTReader(restURL, username, password);
structuredGridCoverageReader = new GeoServerRESTStructuredGridCoverageReaderManager(restURL, username, password);
storeManager = new GeoServerRESTStoreManager(restURL, gsuser, gspass);
styleManager = new GeoServerRESTStyleManager(restURL, gsuser, gspass);
geoWebCacheRest = new GeoWebCacheREST(restURL, gsuser, gspass);
}
/**
* Getter for the field publisher
.
*
* @return a {@link it.geosolutions.geoserver.rest.GeoServerRESTPublisher} object.
*/
public GeoServerRESTPublisher getPublisher() {
return publisher;
}
/**
* Getter for the field reader
.
*
* @return a {@link it.geosolutions.geoserver.rest.GeoServerRESTReader} object.
*/
public GeoServerRESTReader getReader() {
return reader;
}
/**
* Getter for the field storeManager
.
*
* @return a {@link it.geosolutions.geoserver.rest.manager.GeoServerRESTStoreManager} object.
*/
public GeoServerRESTStoreManager getStoreManager() {
return storeManager;
}
/**
* Getter for the field styleManager
.
*
* @return a {@link it.geosolutions.geoserver.rest.manager.GeoServerRESTStyleManager} object.
*/
public GeoServerRESTStyleManager getStyleManager() {
return styleManager;
}
/**
* Getter for the field structuredGridCoverageReader
.
*
* @return a {@link it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager} object.
*/
public GeoServerRESTStructuredGridCoverageReaderManager getStructuredGridCoverageReader() {
return structuredGridCoverageReader;
}
/**
* Getter for the field geoWebCacheRest
.
*
* @return a {@link it.geosolutions.geoserver.rest.GeoWebCacheREST} object.
*/
public GeoWebCacheREST getGeoWebCacheRest() {
return geoWebCacheRest;
}
}