it.geosolutions.geoserver.rest.GeoServerRESTManager.orig 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.
The newest version!
/*
* 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.http.GeoServerRestAuthenticator;
import it.geosolutions.geoserver.rest.http.UsernamePasswordAuthenticator;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTAbstractManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTResourceManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTSecurityManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStoreManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStyleManager;
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;
private final GeoServerRESTResourceManager resourceManager;
<<<<<<< HEAD
private final GeoServerRESTSecurityManager securityManager;
=======
>>>>>>> ea50ec0... support keycloak
/**
* 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 {
this(restURL, new UsernamePasswordAuthenticator(username, password));
}
/**
* Default constructor.
*
* Indicates connection parameters to remote GeoServer instance.
*
* @param restURL GeoServer REST API endpoint
* @param auth GeoServer REST API authenticator
* @throws java.lang.IllegalArgumentException {@link GeoServerRESTAbstractManager#GeoServerRESTAbstractManager(URL, String, String)}
*/
public GeoServerRESTManager(URL restURL, GeoServerRestAuthenticator auth)
throws IllegalArgumentException {
super(restURL, auth);
// Internal publisher and reader, provide simple access methods.
<<<<<<< HEAD
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);
resourceManager = new GeoServerRESTResourceManager(restURL, gsuser, gspass);
securityManager = new GeoServerRESTSecurityManager(restURL, gsuser, gspass);
=======
publisher = new GeoServerRESTPublisher(restURL.toString(), auth);
reader = new GeoServerRESTReader(restURL, auth);
structuredGridCoverageReader = new GeoServerRESTStructuredGridCoverageReaderManager(restURL, auth);
storeManager = new GeoServerRESTStoreManager(restURL, auth);
styleManager = new GeoServerRESTStyleManager(restURL, auth);
geoWebCacheRest = new GeoWebCacheREST(restURL, auth);
resourceManager = new GeoServerRESTResourceManager(restURL, auth);
>>>>>>> ea50ec0... support keycloak
}
/**
* 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;
}
/**
* Getter for the field resourceManager
.
*
* @return a {@link it.geosolutions.geoserver.rest.manager.GeoServerRESTResourceManager} object.
*/
public GeoServerRESTResourceManager getResourceManager() {
return resourceManager;
}
/**
* Getter for the field securityManager
.
*
* @return a {@link it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager} object.
*/
public GeoServerRESTSecurityManager getSecurityManager() {
return securityManager;
}
}