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)
Connect to the specified endpoint.
OutputStream connect(String uri, HashMap<String, String> httpHeaders, boolean enableCompression)
Connect to the specified endpoint.
OutputStream connect(String uri, String soapAction)
Connect to the specified endpoint.
HttpURLConnection createConnection(String url, HashMap<String, String> httpHeaders)
Create a connection
URL createURL(String url)
Create a URL
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)
Protected Methods
HttpURLConnection openConnection(String url, Proxy proxy)
[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)

Connect to the specified endpoint.

Parameters
uri Endpoint address
httpHeaders Header map
Returns
  • output stream that can be used to send response
Throws
IOException

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

Connect to the specified endpoint.

Parameters
uri Endpoint address
httpHeaders Header map
enableCompression
Returns
  • output stream that can be used to send response
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 HttpURLConnection createConnection (String url, HashMap<String, String> httpHeaders)

Create a connection

Parameters
url
httpHeaders
Throws
IOException

public URL createURL (String url)

Create a URL

Parameters
url
Throws
MalformedURLException

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

Protected Methods

protected HttpURLConnection openConnection (String url, Proxy proxy)

Parameters
url
proxy
Throws
IOException