public abstract class AbstractRequestWriter<RequestType extends OWSRequest> extends Object implements OWSRequestWriter<RequestType>
Base abstract class for all service specific POST/GET request builders
Modifier and Type | Field and Description |
---|---|
static String |
ioError |
protected static String |
noKVP |
protected static String |
noXML |
protected DateTimeFormat |
timeFormat |
Constructor and Description |
---|
AbstractRequestWriter() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCommonArgs(Map<String,String> urlParams,
OWSRequest request)
Adds common arguments to the map of URL parameters
|
protected void |
addCommonArgs(StringBuilder buf,
OWSRequest request)
Adds common arguments to the URL query string
|
protected void |
addCommonXML(DOMHelper dom,
Element requestElt,
OWSRequest request)
Adds common attributes to XML request element
|
Map<String,String> |
buildURLParameters(RequestType request) |
String |
buildURLQuery(RequestType request)
Builds a String containing the GET request URL
|
abstract Element |
buildXMLQuery(DOMHelper dom,
RequestType request)
Builds a DOM element containing the request XML
Note that the element is not yet appended to any parent.
|
protected String |
getExtensionKvpValue(Object extValue) |
protected String |
getGmlBboxCoordsList(Bbox bbox)
Create comma separated list for gml:coordinates XML
|
protected String |
urlEncode(String urlParam)
Helper method to properly encode certain URL query parameters
|
protected void |
writeBboxArgument(StringBuilder buffer,
Bbox bbox)
Utility method to add bbox argument to a GET request.
Format is minY,minX,maxY,maxX |
protected void |
writeBboxArgument(StringBuilder buffer,
Bbox bbox,
boolean writeCrs)
Utility method to add bbox with CRS argument to a GET request.
Format is minY,minX,maxY,maxX[,crsUri] |
protected void |
writeKvpExtensions(Map<String,String> urlParams,
OWSRequest request)
Adds extension parameters to KVP request
|
protected void |
writeKVPExtensions(StringBuilder urlBuff,
OWSRequest request)
Helper method to append vendor extensions at the end of URL query
|
protected void |
writeTimeArgument(StringBuilder buffer,
TimeExtent time)
Utility method to add time argument to a GET request
Format is YYYY-MM-DDTHH:MM:SS.sss/YYYY-MM-DDTHH:MM:SS.sss/PYMDTHMS
|
void |
writeXMLQuery(OutputStream os,
RequestType request) |
public static final String ioError
protected static final String noKVP
protected static final String noXML
protected DateTimeFormat timeFormat
public Map<String,String> buildURLParameters(RequestType request) throws OWSException
OWSException
public abstract Element buildXMLQuery(DOMHelper dom, RequestType request) throws OWSException
OWSRequestWriter
buildXMLQuery
in interface OWSRequestWriter<RequestType extends OWSRequest>
dom
- DOMHelper instance that will own the generated elementrequest
- OWs request objectOWSException
public String buildURLQuery(RequestType request) throws OWSException
OWSRequestWriter
buildURLQuery
in interface OWSRequestWriter<RequestType extends OWSRequest>
request
- OWS request objectOWSException
public void writeXMLQuery(OutputStream os, RequestType request) throws OWSException
OWSException
protected String urlEncode(String urlParam)
urlParam
- protected void writeTimeArgument(StringBuilder buffer, TimeExtent time)
buffer
- time
- protected void writeBboxArgument(StringBuilder buffer, Bbox bbox)
buffer
- string buffer to append tobbox
- Bbox object to be serializedprotected void writeBboxArgument(StringBuilder buffer, Bbox bbox, boolean writeCrs)
buffer
- string buffer to append tobbox
- Bbox object to be serializedwriteCrs
- true if crs URI should be appended at the end of the stringprotected String getGmlBboxCoordsList(Bbox bbox)
query
- protected void addCommonXML(DOMHelper dom, Element requestElt, OWSRequest request)
dom
- requestElt
- request
- protected void addCommonArgs(Map<String,String> urlParams, OWSRequest request)
urlParams
- request
- protected void addCommonArgs(StringBuilder buf, OWSRequest request)
urlParams
- request
- protected void writeKVPExtensions(StringBuilder urlBuff, OWSRequest request)
urlBuff
- request
- protected void writeKvpExtensions(Map<String,String> urlParams, OWSRequest request)
urlParams
- request
- Copyright © 2016 Sensia Software LLC. All rights reserved.