Class GeoserveLayersService


  • public class GeoserveLayersService
    extends java.lang.Object
    Access layers from the Geoserve Layers service.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_GEOSERVE_LAYERS_URL
      Default URL for GeoServe Layers service.
    • Constructor Summary

      Constructors 
      Constructor Description
      GeoserveLayersService()
      Create a service using the default URL.
      GeoserveLayersService​(java.lang.String endpointUrl)
      Create a service using a custom URL.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEndpointURL()
      Get the endpoint URL.
      javax.json.JsonObject getLayer​(java.lang.String type)
      Fetch and parse a JSON response from the Geoserve layers service.
      void setEndpointURL​(java.lang.String url)
      Set the endpoint URL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_GEOSERVE_LAYERS_URL

        public static final java.lang.String DEFAULT_GEOSERVE_LAYERS_URL
        Default URL for GeoServe Layers service.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GeoserveLayersService

        public GeoserveLayersService()
        Create a service using the default URL.
      • GeoserveLayersService

        public GeoserveLayersService​(java.lang.String endpointUrl)
        Create a service using a custom URL.
        Parameters:
        endpointUrl - layers service URL. Should contain the string {type}, which is replaced during the #getLayer(String).
    • Method Detail

      • getEndpointURL

        public java.lang.String getEndpointURL()
        Get the endpoint URL.
        Returns:
        endpoint URL
      • setEndpointURL

        public void setEndpointURL​(java.lang.String url)
        Set the endpoint URL.
        Parameters:
        url - endpoint URL to set
      • getLayer

        public javax.json.JsonObject getLayer​(java.lang.String type)
                                       throws java.io.IOException,
                                              java.net.MalformedURLException
        Fetch and parse a JSON response from the Geoserve layers service.
        Parameters:
        type - type of response to fetch
        Returns:
        JSONObject response
        Throws:
        java.io.IOException - on IO error
        java.net.MalformedURLException - Error on URL failure