Class WmsUrlValidator
- java.lang.Object
-
- org.gcube.spatial.data.geoutility.wms.WmsUrlValidator
-
public class WmsUrlValidator extends Object
The Class WmsUrlValidator.- Author:
- Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jan 25, 2016
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description WmsUrlValidator(String wmsRequest)Instantiates a new wms url validator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBaseWmsServiceUrl()Gets the base wms service url.Map<String,String>getMapWmsNoStandardParams()Gets the map wms no standard params.HashMap<String,String>getMapWmsParameters()Gets the map wms parameters.List<String>getStylesAsList()Gets the styles as list.static StringgetValueOfParameter(WmsParameters wmsParam, String wmsRequestParamaters)Gets the value of parameter.StringgetValueOfParsedWMSParameter(WmsParameters parameter)Gets the value of parsed wms parameter.StringgetWmsNoStandardParameters()Gets the wms no standard parameters.StringgetWmsRequest()Gets the wms request.static voidmain(String[] args)The main method.StringparseWmsRequest(boolean returnEmptyParameter, boolean fillEmptyParameterAsDefaultValue)Parses the wms request.static StringsetValueOfParameter(WmsParameters wmsParam, String wmsRequestParameters, String newValue, boolean addIfNotExists)Sets the value of parameter.StringtoString()static StringvalidateValueOfParameter(WmsParameters wmsParam, String queryStringParameters, boolean fillEmptyParameterAsDefaultValue)Validate value of parameter.
-
-
-
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 parameterfillEmptyParameterAsDefaultValue- 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 paramqueryStringParameters- the value of parameterfillEmptyParameterAsDefaultValue- 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 paramwmsRequestParamaters- 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 paramwmsRequestParameters- the wms url parametersnewValue- the new valueaddIfNotExists- 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
-
-