Esri Geoportal Server
1.0

com.esri.gpt.catalog.search
Class RestUrlBuilder

java.lang.Object
  extended by com.esri.gpt.catalog.search.RestUrlBuilder

public class RestUrlBuilder
extends Object

Builds the query parameters for a rest query URL.


Constructor Summary
RestUrlBuilder()
          Default constructor.
 
Method Summary
protected  void appendParam(StringBuffer parameters, String name, String value)
          Appends a parameter to the query parameters buffer.
protected  void appendParam(StringBuffer parameters, String name, String delimiter, List<String> values)
          Appends parameter value list to the query parameters buffer.
 String buildParameters(SearchCriteria criteria, String format, String rid)
          Builds the rest URL query parameters string.
protected  String encodeUrlParam(String value)
          Encodes a URL parameter value.
static RestUrlBuilder newBuilder(RequestContext context, HttpServletRequest servletRequest, MessageBroker messageBroker)
          Instantiates a new rest url builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestUrlBuilder

public RestUrlBuilder()
Default constructor.

Method Detail

appendParam

protected void appendParam(StringBuffer parameters,
                           String name,
                           String value)
Appends a parameter to the query parameters buffer.
The parameter will not be appended if the value is null or empty.
The parameter value will be URLEncoded prior to appending.

Parameters:
parameters - the query parameters buffer
name - the parameter name
value - the parameter value

appendParam

protected void appendParam(StringBuffer parameters,
                           String name,
                           String delimiter,
                           List<String> values)
Appends parameter value list to the query parameters buffer.
The parameter will not be appended if the value list is null or empty.
The parameter values will be concatenated with the delimiter prior to appending.
The parameter values will be URLEncoded prior to appending.

Parameters:
parameters - the query parameters buffer
name - the parameter name
delimiter - the values delimiter
values - the parameter values

buildParameters

public String buildParameters(SearchCriteria criteria,
                              String format,
                              String rid)
Builds the rest URL query parameters string.

Parameters:
criteria - the search criteria from which the query parameters will be built.
format - the response format
rid - the repository id
Returns:
the query parameters string

encodeUrlParam

protected String encodeUrlParam(String value)
Encodes a URL parameter value.

Parameters:
value - the URL parameter value to encode
Returns:
the encoded parameter value

newBuilder

public static RestUrlBuilder newBuilder(RequestContext context,
                                        HttpServletRequest servletRequest,
                                        MessageBroker messageBroker)
Instantiates a new rest url builder.

By default, a new instance of com.esri.gpt.catalog.search.RestUrlBuilder is returned.

This can be overridden by the configuration parameter: /gptConfig/catalog/parameter@key="restUrlBuilder"

Parameters:
context - the active request context
servletRequest - the active HTTP servlet request
messageBroker - the message broker
Returns:
the rest url builder

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.