public class ServiceWrapperBase<T extends CdmBase>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Logger |
logger |
protected java.util.Map<java.lang.String,SchemaAdapterBase<T>> |
schemaAdapterMap |
Constructor and Description |
---|
ServiceWrapperBase() |
Modifier and Type | Method and Description |
---|---|
static void |
addNameValuePairTo(java.util.List<org.apache.http.NameValuePair> listOfPairs,
java.lang.String name,
java.lang.Object value)
Adds a
BasicNameValuePair to the given List . |
static void |
addNameValuePairTo(java.util.List<org.apache.http.NameValuePair> listOfPairs,
java.lang.String name,
java.lang.String value)
Adds a
BasicNameValuePair to the given List . |
void |
addSchemaAdapter(SchemaAdapterBase schemaAdapter) |
protected java.net.URI |
createUri(java.lang.String subPath,
java.util.List<org.apache.http.NameValuePair> qparams)
Creates a
URI based on the baseUrl and the given subPath and qParams |
protected java.io.InputStream |
executeHttpGet(java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> requestHeaders)
Send an HTTP GET request to the given URI.
|
protected java.io.InputStream |
executeHttpPost(java.net.URI uri,
java.util.Map<java.lang.String,java.lang.String> requestHeaders,
org.apache.http.HttpEntity httpEntity)
Send an HTTP POST request to the given URI.
|
java.lang.String |
getBaseUrl() |
java.util.Map<java.lang.String,SchemaAdapterBase<T>> |
getSchemaAdapterMap() |
void |
setBaseUrl(java.lang.String baseUrl) |
void |
setSchemaAdapterMap(java.util.Map<java.lang.String,SchemaAdapterBase<T>> schemaAdapterMap) |
public static final Logger logger
protected java.util.Map<java.lang.String,SchemaAdapterBase<T extends CdmBase>> schemaAdapterMap
public void setBaseUrl(java.lang.String baseUrl)
baseUrl
- the baseUrl to setpublic java.lang.String getBaseUrl()
public void setSchemaAdapterMap(java.util.Map<java.lang.String,SchemaAdapterBase<T>> schemaAdapterMap)
schemaAdapterMap
- the schemaAdapterMap to setpublic void addSchemaAdapter(SchemaAdapterBase schemaAdapter)
public java.util.Map<java.lang.String,SchemaAdapterBase<T>> getSchemaAdapterMap()
protected java.io.InputStream executeHttpGet(java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> requestHeaders) throws org.apache.http.client.ClientProtocolException, java.io.IOException
uri
- the URI of this HTTP requestrequestHeaders
- the parameters (name-value pairs) of the connection added to the header of the requestInputStream
org.apache.http.client.ClientProtocolException
java.io.IOException
protected java.io.InputStream executeHttpPost(java.net.URI uri, java.util.Map<java.lang.String,java.lang.String> requestHeaders, org.apache.http.HttpEntity httpEntity) throws org.apache.http.client.ClientProtocolException, java.io.IOException
uri
- the URI of this HTTP requestrequestHeaders
- the parameters (name-value pairs) of the connection added to the header of the requestentity
- the HttpEntity
attached to a HTTP POST requestInputStream
org.apache.http.client.ClientProtocolException
java.io.IOException
public static void addNameValuePairTo(java.util.List<org.apache.http.NameValuePair> listOfPairs, java.lang.String name, java.lang.String value)
BasicNameValuePair
to the given List
.listOfPairs
- the list to add the name-value pair toname
- the namevalue
- the valuepublic static void addNameValuePairTo(java.util.List<org.apache.http.NameValuePair> listOfPairs, java.lang.String name, java.lang.Object value)
BasicNameValuePair
to the given List
.listOfPairs
- the list to add the name-value pair toname
- the namevalue
- the String representation of the object (toString())protected java.net.URI createUri(java.lang.String subPath, java.util.List<org.apache.http.NameValuePair> qparams) throws java.net.URISyntaxException
URI
based on the baseUrl
and the given subPath and qParamssubPath
- the sub path of the URI to be createdqparams
- the parameters added as GET parameters to the URIjava.net.URISyntaxException
Copyright © 2007-2020 EDIT. All Rights Reserved.