com.funambol.syncml.spds
Class HttpTransportAgent

java.lang.Object
  extended by com.funambol.syncml.spds.HttpTransportAgent
All Implemented Interfaces:
TransportAgent

public final class HttpTransportAgent
extends java.lang.Object
implements TransportAgent

Represents a HTTP client implementation


Constructor Summary
HttpTransportAgent(java.lang.String requestURL, boolean compress)
          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)
          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)
          Initialize a new HttpTransportAgent with a URL and a charset to use.
 
Method Summary
 void enableCompression(boolean enable)
           
 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)
           
 void setThreshold(int threshold)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpTransportAgent

public HttpTransportAgent(java.lang.String requestURL,
                          boolean compress)
Initialize a new HttpTransportAgent with a URL only The default userAgent and charset will be used.

Parameters:
requestURL - must be non-null.

HttpTransportAgent

public HttpTransportAgent(java.lang.String requestURL,
                          java.lang.String userAgent,
                          boolean compress)
Initialize a new HttpTransportAgent with a URL and a userAgent string. The default charset will be used.

Parameters:
requestURL - must be non-null
userAgent - a string to be used as userAgent.

HttpTransportAgent

public HttpTransportAgent(java.lang.String requestURL,
                          java.lang.String userAgent,
                          java.lang.String charset,
                          boolean compress)
Initialize a new HttpTransportAgent with a URL and a charset to use.

Parameters:
requestURL - must be non-null
userAgent - a string to be used as userAgent.
charset - a valid charset, the device charset is used by default.
Method Detail

sendMessage

public java.lang.String sendMessage(java.lang.String request)
                             throws SyncException
Send a message using the default charset.

Specified by:
sendMessage in interface TransportAgent
Parameters:
requestURL - must be non-null
charset - a valid charset, UTF-8 is used by default.
Returns:
server response
Throws:
SyncException

sendMessage

public java.lang.String sendMessage(java.lang.String request,
                                    java.lang.String charset)
                             throws SyncException
Specified by:
sendMessage in interface TransportAgent
Parameters:
request - Message to send
charset - charset to use
Returns:
server response
Throws:
SyncException

sendMessage

public byte[] sendMessage(byte[] request)
                   throws SyncException
Parameters:
request - HTTP request
Returns:
HTTP response
Throws:
SyncException

enableCompression

public void enableCompression(boolean enable)

setThreshold

public void setThreshold(int threshold)

setRequestURL

public void setRequestURL(java.lang.String requestURL)


Copyright © 2006 Funambol.