Class WmsUrlValidator


  • public class WmsUrlValidator
    extends Object
    The Class WmsUrlValidator.
    Author:
    Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jan 25, 2016
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
    • Constructor Detail

      • WmsUrlValidator

        public WmsUrlValidator​(String wmsRequest)
        Instantiates a new wms url validator.
        Parameters:
        wmsRequest - the wms request
    • Method Detail

      • parseWmsRequest

        public String parseWmsRequest​(boolean returnEmptyParameter,
                                      boolean fillEmptyParameterAsDefaultValue)
                               throws Exception
        Parses the wms request.
        Parameters:
        returnEmptyParameter - the return empty parameter
        fillEmptyParameterAsDefaultValue - the fill empty parameter as default
        Returns:
        the wms request uri builded
        Throws:
        Exception - the exception
      • getMapWmsParameters

        public HashMap<String,​String> getMapWmsParameters()
        Gets the map wms parameters.
        Returns:
        the map wms parameters
      • getWmsRequest

        public String getWmsRequest()
        Gets the wms request.
        Returns:
        the wmsRequest
      • getBaseWmsServiceUrl

        public String getBaseWmsServiceUrl()
        Gets the base wms service url.
        Returns:
        the baseWmsServiceUrl
      • getWmsNoStandardParameters

        public String getWmsNoStandardParameters()
        Gets the wms no standard parameters.
        Returns:
        the wms no standard parameters like a query string (param1=value1¶m2=value2&...)
      • getValueOfParsedWMSParameter

        public String getValueOfParsedWMSParameter​(WmsParameters parameter)
        Gets the value of parsed wms parameter.
        Parameters:
        parameter - the parameter
        Returns:
        the value of parsed wms parameter parsed from wms request.
      • validateValueOfParameter

        public static String validateValueOfParameter​(WmsParameters wmsParam,
                                                      String queryStringParameters,
                                                      boolean fillEmptyParameterAsDefaultValue)
        Validate value of parameter.
        Parameters:
        wmsParam - the wms param
        queryStringParameters - the value of parameter
        fillEmptyParameterAsDefaultValue - the fill empty parameter as default value
        Returns:
        the string
      • getValueOfParameter

        public static String getValueOfParameter​(WmsParameters wmsParam,
                                                 String wmsRequestParamaters)
        Gets the value of parameter.
        Parameters:
        wmsParam - the wms param
        wmsRequestParamaters - the url wms parameters
        Returns:
        the value of parameter or null if parameter not exists
      • setValueOfParameter

        public static String setValueOfParameter​(WmsParameters wmsParam,
                                                 String wmsRequestParameters,
                                                 String newValue,
                                                 boolean addIfNotExists)
        Sets the value of parameter.
        Parameters:
        wmsParam - the wms param
        wmsRequestParameters - the wms url parameters
        newValue - the new value
        addIfNotExists - add the parameter if not exists
        Returns:
        the string
      • getStylesAsList

        public List<String> getStylesAsList()
        Gets the styles as list.
        Returns:
        the styles as list
      • getMapWmsNoStandardParams

        public Map<String,​String> getMapWmsNoStandardParams()
        Gets the map wms no standard params.
        Returns:
        an empty map if WMS no standard parameters don't exist
      • main

        public static void main​(String[] args)
        The main method.
        Parameters:
        args - the arguments