public class

JdkHttpTransport

extends Object
implements Transport
java.lang.Object
   ↳ com.sforce.ws.transport.JdkHttpTransport

Class Overview

This class is an implementation of Transport using the build in JDK URLConnection.

Summary

Nested Classes
class JdkHttpTransport.LimitingInputStream  
class JdkHttpTransport.LimitingOutputStream  
class JdkHttpTransport.MessageHandlerOutputStream  
class JdkHttpTransport.TeeInputStream  
class JdkHttpTransport.TeeOutputStream  
Fields
private ConnectorConfig config
private HttpURLConnection connection
private boolean successful
private URL url
Public Constructors
JdkHttpTransport()
JdkHttpTransport(ConnectorConfig config)
Public Methods
OutputStream connect(String uri, HashMap<String, String> httpHeaders)
OutputStream connect(String uri, HashMap<String, String> httpHeaders, boolean enableCompression)
OutputStream connect(String uri, String soapAction)
Connect to the specified endpoint.
static HttpURLConnection createConnection(ConnectorConfig config, URL url, HashMap<String, String> httpHeaders)
static HttpURLConnection createConnection(ConnectorConfig config, URL url, HashMap<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)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.sforce.ws.transport.Transport

Fields

private ConnectorConfig config

private HttpURLConnection connection

private boolean successful

private URL url

Public Constructors

public JdkHttpTransport ()

public JdkHttpTransport (ConnectorConfig config)

Parameters
config

Public Methods

public OutputStream connect (String uri, HashMap<String, String> httpHeaders)

Parameters
uri
httpHeaders
Throws
IOException

public OutputStream connect (String uri, HashMap<String, String> httpHeaders, boolean enableCompression)

Parameters
uri
httpHeaders
enableCompression
Throws
IOException

public OutputStream connect (String uri, String soapAction)

Connect to the specified endpoint.

Parameters
uri Endpoint address
soapAction Soap action
Returns
  • output stream that can be used to send response
Throws
IOException

public static HttpURLConnection createConnection (ConnectorConfig config, URL url, HashMap<String, String> httpHeaders)

Parameters
config
url
httpHeaders
Throws
IOException

public static HttpURLConnection createConnection (ConnectorConfig config, URL url, HashMap<String, String> httpHeaders, boolean enableCompression)

Parameters
config
url
httpHeaders
enableCompression
Throws
IOException

public InputStream getContent ()

returns the response from the endpoint. This method must be called after a connect call.

Returns
  • response or error stream.
Throws
IOException

public boolean isSuccessful ()

checks whether the response from the remote server is successful or not.

Returns
  • true if the call was successful

public void setConfig (ConnectorConfig config)

Parameters
config