it.geosolutions.geoserver.rest.manager
Class GeoServerRESTDatastoreManager

java.lang.Object
  extended by it.geosolutions.geoserver.rest.manager.GeoServerRESTAbstractManager
      extended by it.geosolutions.geoserver.rest.manager.GeoServerRESTDatastoreManager

public class GeoServerRESTDatastoreManager
extends GeoServerRESTAbstractManager

Manage datastores. To pass connection parameters, use the encoders derived from GSAbstractDatastoreEncoder.

Author:
Oscar Fonts, Carlo Cancellieri - carlo.cancellieri@geo-solutions.it

Field Summary
 
Fields inherited from class it.geosolutions.geoserver.rest.manager.GeoServerRESTAbstractManager
gspass, gsuser, restURL
 
Constructor Summary
GeoServerRESTDatastoreManager(URL restURL, String username, String password)
          Default constructor.
 
Method Summary
 boolean create(String workspace, GSAbstractDatastoreEncoder datastore)
          Create a datastore.
 boolean update(String workspace, GSAbstractDatastoreEncoder datastore)
          Update a datastore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoServerRESTDatastoreManager

public GeoServerRESTDatastoreManager(URL restURL,
                                     String username,
                                     String password)
                              throws IllegalArgumentException,
                                     MalformedURLException
Default constructor.

Parameters:
restURL - GeoServer REST API endpoint
username - GeoServer REST API authorized username
password - GeoServer REST API password for the former username
Throws:
MalformedURLException
IllegalArgumentException
Method Detail

create

public boolean create(String workspace,
                      GSAbstractDatastoreEncoder datastore)
Create a datastore.

Parameters:
workspace - Name of the workspace to contain the datastore. This will also be the prefix of any layer names contained in the datastore.
datastore - the set of parameters to be set to the datastore (including connection parameters).
Returns:
true if the datastore has been successfully created, false otherwise

update

public boolean update(String workspace,
                      GSAbstractDatastoreEncoder datastore)
Update a datastore.

Parameters:
workspace - Name of the workspace that contains the datastore.
datastore - the set of parameters to be set to the datastore (including connection parameters).
Returns:
true if the datastore has been successfully updated, false otherwise


Copyright © 2007-2013 GeoSolutions. All Rights Reserved.