com.sforce.ws.transport
Class GaeHttpTransport

java.lang.Object
  extended by com.sforce.ws.transport.GaeHttpTransport
All Implemented Interfaces:
Transport

public class GaeHttpTransport
extends Object
implements Transport

This class is an implementation of Transport using the Google AppEngine urlFetch

Since:
1.0 Jan 29 2009
Version:
1.0
Author:
Ron Hess

Constructor Summary
GaeHttpTransport()
           
 
Method Summary
 OutputStream connect(String endpoint, HashMap<String,String> headers)
           
 OutputStream connect(String uri, HashMap<String,String> httpHeaders, boolean enableCompression)
           
 OutputStream connect(String uri, String soapAction)
          Connect to the specified endpoint.
static com.google.appengine.api.urlfetch.HTTPRequest createRequest(ConnectorConfig config, URL url, Map<String,String> httpHeaders)
           
static com.google.appengine.api.urlfetch.HTTPRequest createRequest(ConnectorConfig config, URL url, Map<String,String> httpHeaders, boolean enableCompression)
           
 InputStream getContent()
          returns the response from the endpoint.
 boolean isSuccessful()
          checks whether the response from the remote server is successful or not.
 void setConfig(ConnectorConfig config)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaeHttpTransport

public GaeHttpTransport()
Method Detail

setConfig

public void setConfig(ConnectorConfig config)
Specified by:
setConfig in interface Transport

connect

public OutputStream connect(String uri,
                            String soapAction)
                     throws IOException
Description copied from interface: Transport
Connect to the specified endpoint.

Specified by:
connect in interface Transport
Parameters:
uri - endpoint address
soapAction - soap action
Returns:
output stream that can be used to send response
Throws:
IOException - failed to connect to the endpoint

connect

public OutputStream connect(String endpoint,
                            HashMap<String,String> headers)
                     throws IOException
Specified by:
connect in interface Transport
Throws:
IOException

connect

public OutputStream connect(String uri,
                            HashMap<String,String> httpHeaders,
                            boolean enableCompression)
                     throws IOException
Specified by:
connect in interface Transport
Throws:
IOException

createRequest

public static com.google.appengine.api.urlfetch.HTTPRequest createRequest(ConnectorConfig config,
                                                                          URL url,
                                                                          Map<String,String> httpHeaders)
                                                                   throws IOException
Throws:
IOException

createRequest

public static com.google.appengine.api.urlfetch.HTTPRequest createRequest(ConnectorConfig config,
                                                                          URL url,
                                                                          Map<String,String> httpHeaders,
                                                                          boolean enableCompression)
                                                                   throws IOException
Throws:
IOException

getContent

public InputStream getContent()
                       throws IOException
Description copied from interface: Transport
returns the response from the endpoint. This method must be called after a connect call.

Specified by:
getContent in interface Transport
Returns:
response or error stream.
Throws:
IOException - failed to get content

isSuccessful

public boolean isSuccessful()
Description copied from interface: Transport
checks whether the response from the remote server is successful or not.

Specified by:
isSuccessful in interface Transport
Returns:
true if the call was successful


Copyright © 2014. All Rights Reserved.