Package com.sforce.ws.transport
Class JdkHttpTransport
- java.lang.Object
-
- com.sforce.ws.transport.JdkHttpTransport
-
-
Constructor Summary
Constructors Constructor Description JdkHttpTransport()JdkHttpTransport(ConnectorConfig config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OutputStreamconnect(String uri, String soapAction)Connect to the specified endpoint.OutputStreamconnect(String uri, HashMap<String,String> httpHeaders)OutputStreamconnect(String uri, HashMap<String,String> httpHeaders, boolean enableCompression)static HttpURLConnectioncreateConnection(ConnectorConfig config, URL url, HashMap<String,String> httpHeaders)static HttpURLConnectioncreateConnection(ConnectorConfig config, URL url, HashMap<String,String> httpHeaders, boolean enableCompression)InputStreamgetContent()returns the response from the endpoint.booleanisSuccessful()checks whether the response from the remote server is successful or not.voidsetConfig(ConnectorConfig config)
-
-
-
Constructor Detail
-
JdkHttpTransport
public JdkHttpTransport()
-
JdkHttpTransport
public JdkHttpTransport(ConnectorConfig config)
-
-
Method Detail
-
setConfig
public void setConfig(ConnectorConfig config)
-
connect
public OutputStream connect(String uri, HashMap<String,String> httpHeaders) throws IOException
- Specified by:
connectin interfaceTransport- Throws:
IOException
-
connect
public OutputStream connect(String uri, HashMap<String,String> httpHeaders, boolean enableCompression) throws IOException
- Specified by:
connectin interfaceTransport- Throws:
IOException
-
connect
public OutputStream connect(String uri, String soapAction) throws IOException
Description copied from interface:TransportConnect to the specified endpoint.- Specified by:
connectin interfaceTransport- Parameters:
uri- endpoint addresssoapAction- soap action- Returns:
- output stream that can be used to send response
- Throws:
IOException- failed to connect to the endpoint
-
createConnection
public static HttpURLConnection createConnection(ConnectorConfig config, URL url, HashMap<String,String> httpHeaders) throws IOException
- Throws:
IOException
-
createConnection
public static HttpURLConnection createConnection(ConnectorConfig config, URL url, HashMap<String,String> httpHeaders, boolean enableCompression) throws IOException
- Throws:
IOException
-
getContent
public InputStream getContent() throws IOException
Description copied from interface:Transportreturns the response from the endpoint. This method must be called after a connect call.- Specified by:
getContentin interfaceTransport- Returns:
- response or error stream.
- Throws:
IOException- failed to get content
-
isSuccessful
public boolean isSuccessful()
Description copied from interface:Transportchecks whether the response from the remote server is successful or not.- Specified by:
isSuccessfulin interfaceTransport- Returns:
- true if the call was successful
-
-