All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.pdok.workspacebuilder.GeoserverRestProxy Maven / Gradle / Ivy

The newest version!
package nl.pdok.workspacebuilder;

import it.geosolutions.geoserver.rest.GeoServerRESTManager;
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher;
import it.geosolutions.geoserver.rest.GeoServerRESTReader;

import java.net.MalformedURLException;
import java.net.URL;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class GeoserverRestProxy {
	
  final static Logger logger = LoggerFactory.getLogger(GeoserverRestProxy.class);

  private GeoServerRESTReader reader;
  private GeoServerRESTPublisher publisher;
  private GeoServerRESTManager manager;
    
  public GeoserverRestProxy(String geoserverUrl, String geoserverUser, String geoserverPassword) {
	  try {
	  reader = new GeoServerRESTReader(geoserverUrl, geoserverUser, geoserverPassword);
	  publisher = new GeoServerRESTPublisher(geoserverUrl, geoserverUser, geoserverPassword);
	  manager = new GeoServerRESTManager(new URL(geoserverUrl), geoserverUser, geoserverPassword);
	  } catch (MalformedURLException malformedURLException) {
		  logger.error("Error creating GeoserverREST communication objects: " + malformedURLException.getMessage());
	  }
  }
  
  public GeoServerRESTReader getReader() {
	return reader;
  }
 
  public GeoServerRESTPublisher getPublisher() {
	return publisher;
  }

  public GeoServerRESTManager getManager() {
	return manager;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy