|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nativex.common.HTTPServiceManager
public class HTTPServiceManager
A manager the execute REST service requests.
Field Summary | |
---|---|
private HttpClient |
client
|
static String |
LOCATION_HEADER
|
static int |
RTSP_PORT
|
static String |
RTSP_PROTOCOL
|
static String |
USER_AGENT_HEADER
|
Constructor Summary | |
---|---|
HTTPServiceManager()
Basic constructor. |
|
HTTPServiceManager(HttpClient httpClient)
Constructor taking HttpClient as parameter. |
Method Summary | |
---|---|
private static void |
addHeaders(HttpUriRequest httpRequest,
Map<String,String> headers)
|
Response |
execute(Request request)
Executes a REST service request. |
private String |
getRedirectLocation(String uri,
HttpClient client)
|
protected Response |
httpGet(Request request)
Handles HTTP GET requests. |
protected Response |
httpGetImage(Request request)
|
protected Response |
httpPost(Request request)
Handles HTTP POST requests. |
void |
release()
Releases the manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private HttpClient client
public static final String USER_AGENT_HEADER
public static final String LOCATION_HEADER
public static final String RTSP_PROTOCOL
public static final int RTSP_PORT
Constructor Detail |
---|
public HTTPServiceManager()
public HTTPServiceManager(HttpClient httpClient)
HttpClient
as parameter.
httpClient
- HttpClient
. The HttpClient to use.Method Detail |
---|
public Response execute(Request request) throws ClientProtocolException, IOException
IHTTPServiceManager
execute
in interface IHTTPServiceManager
request
- Request
. The request to execute
Response
. The response.
ClientProtocolException
IOException
private static void addHeaders(HttpUriRequest httpRequest, Map<String,String> headers)
protected Response httpGet(Request request) throws ClientProtocolException, IOException
request
- Request
The request to the server.
Response
. The response from the server.
ClientProtocolException
- Signals an error in the HTTP protocol.
IOException
- Signals for I/O Error.protected Response httpGetImage(Request request) throws ClientProtocolException, IOException
ClientProtocolException
IOException
private String getRedirectLocation(String uri, HttpClient client) throws IOException
IOException
protected Response httpPost(Request request) throws ClientProtocolException, IOException
request
- Request
The request to the server.
Response
. The response from the server.
ClientProtocolException
- Signals an error in the HTTP protocol.
IOException
- Signals for I/O Error.public void release()
IHTTPServiceManager
release
in interface IHTTPServiceManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |