public class HttpRestClientServiceImpl extends Object implements IRestClient
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONNECT_TIMEOUT |
static int |
DEFAULT_CONNECTION_POOL_SIZE |
Constructor and Description |
---|
HttpRestClientServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected org.apache.http.conn.ssl.SSLSocketFactory |
createSSLSocketFactory() |
void |
destroy()
destroy the connections
|
RestResponse |
doDELETE(String uri,
Properties headers)
This method will return resource according to the given URI.
|
RestResponse |
doGET(String uri,
Properties headers)
Executes RS-GET to perform FIND.
|
RestResponse |
doPOST(String uri,
Properties headers,
Object objectToCreate)
This method will CREATE resource according to the given URI.
|
RestResponse |
doPUT(String uri,
Properties headers,
Object objectToCreate)
This method will UPDATE resource according to the given URI.
|
boolean |
init()
initialize the rest client instance.
|
boolean |
init(RestConfigurationInfo restConfigurationInfo)
initialize the rest client instance with a given timeout in milliseconds.
|
public static final int DEFAULT_CONNECTION_POOL_SIZE
public static final int DEFAULT_CONNECT_TIMEOUT
public boolean init()
IRestClient
init
in interface IRestClient
public boolean init(RestConfigurationInfo restConfigurationInfo)
IRestClient
init
in interface IRestClient
public void destroy()
IRestClient
destroy
in interface IRestClient
protected org.apache.http.conn.ssl.SSLSocketFactory createSSLSocketFactory() throws NoSuchAlgorithmException, KeyManagementException
public RestResponse doGET(String uri, Properties headers)
doGET
in interface IRestClient
headerParameterKey
- StringheaderParameterValue
- Stringpublic RestResponse doPOST(String uri, Properties headers, Object objectToCreate)
IRestClient
doPOST
in interface IRestClient
uri
- Full URL path to the desire resource.headers
- - list of headers in format of name and value, to be add as
part of the HTTP request.objectToCreate
- - JSON representation of the resource.public RestResponse doPUT(String uri, Properties headers, Object objectToCreate)
IRestClient
doPUT
in interface IRestClient
uri
- Full URL path to the desire resource.headers
- - list of headers in format of name and value, to be add as
part of the HTTP request.objectToCreate
- - JSON representation of the resource.public RestResponse doDELETE(String uri, Properties headers)
IRestClient
doDELETE
in interface IRestClient
uri
- Full URL path to the desire resource.headers
- - list of headers in format of name and value, to be add as
part of the HTTP request.Copyright © 2017. All rights reserved.