|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.syncml.spds.HttpTransportAgent
public final class HttpTransportAgent
Represents a HTTP client implementation
Constructor Summary | |
---|---|
HttpTransportAgent(java.lang.String requestURL,
boolean compress,
boolean forceCookies)
Create a new HttpTransportAgent. |
|
HttpTransportAgent(java.lang.String requestURL,
java.lang.String userAgent,
boolean compress,
boolean forceCookies)
Create a new HttpTransportAgent using the default charset. |
|
HttpTransportAgent(java.lang.String requestURL,
java.lang.String userAgent,
java.lang.String charset,
boolean compress,
boolean forceCookies)
Initialize a new HttpTransportAgent with a URL and a charset to use. |
Method Summary | |
---|---|
void |
enableCompression(boolean enable)
Enable the http "gzip" compression parameter usage |
java.lang.String |
getResponseDate()
Get the last response date |
byte[] |
sendMessage(byte[] request)
Send the http request and read the response |
java.lang.String |
sendMessage(java.lang.String request)
Send a message using the default (UTF-8) charset. |
java.lang.String |
sendMessage(java.lang.String request,
java.lang.String charset)
Send the http request specifying the required encoding charset for the http headers. and read the response |
void |
setRequestURL(java.lang.String requestURL)
Set the request's url |
void |
setRetryOnWrite(int retryOnWrite)
Set the number of http writing attempts |
void |
setThreshold(int threshold)
Set the http "Size-Threshold" header parameter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpTransportAgent(java.lang.String requestURL, boolean compress, boolean forceCookies)
requestURL
- is the url where to send the request; must not be nullcompress
- if true the http compression is enabled, disabled
otherwiseforceCookies
- public HttpTransportAgent(java.lang.String requestURL, java.lang.String userAgent, boolean compress, boolean forceCookies)
requestURL
- is the url where to send the request; must not be nulluserAgent
- the user agent parameter to be filled into the http
headerscompress
- if true the http compression is enabled, disabled
otherwiseforceCookies
- if true sets http headers to force the use of cookies
instead of Url Rewriting to manage the current http session.public HttpTransportAgent(java.lang.String requestURL, java.lang.String userAgent, java.lang.String charset, boolean compress, boolean forceCookies)
requestURL
- must be non-nulluserAgent
- a string to be used as userAgent.charset
- a valid charset, the device charset is used by default.Method Detail |
---|
public java.lang.String sendMessage(java.lang.String request) throws SyncException
sendMessage
in interface TransportAgent
requestURL
- must be non-null
SyncException
- when the connection cannot be established with the
server because the implementation tries to access a not existent url
or when there are network coverage problemspublic java.lang.String sendMessage(java.lang.String request, java.lang.String charset) throws SyncException
sendMessage
in interface TransportAgent
request
- the http request bodycharset
- the charset to be included into the http headers
SyncException
- when the connection cannot be established with the
server because the implementation tries to access a not existent url
or when there are network coverage problemspublic byte[] sendMessage(byte[] request) throws SyncException
request
- the http request body
SyncException
- when the connection cannot be established with the
server because the implementation tries to access a not existent url
or when there are network coverage problemspublic void enableCompression(boolean enable)
enable
- enables "gzip" http header parameter to be written if truepublic void setThreshold(int threshold)
threshold
- is the "Size-Threshold" value to be added to http
headerspublic void setRequestURL(java.lang.String requestURL)
requestURL
- the request's destination urlpublic java.lang.String getResponseDate()
public void setRetryOnWrite(int retryOnWrite)
setRetryOnWrite
in interface TransportAgent
retryOnWrite
- the number of attempts to write http requests
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |