|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.util.HttpTransportAgent
public final class HttpTransportAgent
Represents a HTTP client implementation
Constructor Summary | |
---|---|
HttpTransportAgent(java.lang.String requestURL,
boolean compress,
boolean forceCookies)
Initialize a new HttpTransportAgent with a URL only The default userAgent and charset will be used. |
|
HttpTransportAgent(java.lang.String requestURL,
java.lang.String userAgent,
boolean compress,
boolean forceCookies)
Initialize a new HttpTransportAgent with a URL and a userAgent string. |
|
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)
|
java.lang.String |
getResponseDate()
Returns the last response date, if available, or null. |
byte[] |
sendMessage(byte[] request)
|
java.lang.String |
sendMessage(java.lang.String request)
Send a message using the default charset. |
java.lang.String |
sendMessage(java.lang.String request,
java.lang.String charset)
|
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)
|
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)
url
- must be non-null.public HttpTransportAgent(java.lang.String requestURL, java.lang.String userAgent, boolean compress, boolean forceCookies)
url
- must be non-nulluserAgent
- a string to be used as userAgent.public HttpTransportAgent(java.lang.String requestURL, java.lang.String userAgent, java.lang.String charset, boolean compress, boolean forceCookies)
url
- 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 void setRetryOnWrite(int retryOnWrite)
setRetryOnWrite
in interface TransportAgent
retryOnWrite
- the number of attempts to write http requestspublic java.lang.String sendMessage(java.lang.String request) throws CodedException
sendMessage
in interface TransportAgent
url
- must be non-nullcharset
- a valid charset, UTF-8 is used by default.
CodedException
public java.lang.String sendMessage(java.lang.String request, java.lang.String charset) throws CodedException
sendMessage
in interface TransportAgent
request
- Message to sendcharset
- charset to use
CodedException
public byte[] sendMessage(byte[] request) throws CodedException
request
- HTTP request
CodedException
public void enableCompression(boolean enable)
public void setThreshold(int threshold)
public void setRequestURL(java.lang.String requestURL)
TransportAgent
setRequestURL
in interface TransportAgent
public java.lang.String getResponseDate()
getResponseDate
in interface TransportAgent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |