wt.federation
Class FederatedHttpConnection

java.lang.Object
  extended by wt.federation.FederatedHttpConnection
All Implemented Interfaces:
Externalizable, Serializable

public class FederatedHttpConnection
extends Object
implements Externalizable

Creates HTTP connections to remote systems, sends requests, and returns the responses received.

Supported API: true

Extendable: false

See Also:
Serialized Form

Constructor Summary
FederatedHttpConnection()
          Constructor returning an instance initialized with a null URL, method specified as "GET", no payload, and default request headings.
FederatedHttpConnection(String url)
          Constructor returning an instance initialized with the specified URL.
FederatedHttpConnection(URL url, String method)
          Constructor returning an instance initialized with the specified URL and method.
 
Method Summary
 void addHeading(String keyword, String value)
          Adds a specified heading to an HTTP request.
 void addPayload(FederatedHttpBodyPart part)
          Augments the payload of a POST or PUT request with the specified MIME object.
 void addPayload(String contentType, byte[] octets)
          Augments the payload of a POST or PUT request with the specified array of octets of the specified MIME type/subtype.
 void addPayload(String contentType, String text)
          Augments the payload of a POST or PUT request with the specified string of the specified MIME type/subtype.
 void close()
          Closes the HTTP connection and releases resources associated with it.
 FederatedHttpResponse executeRequest()
          Executes an HTTP request using a previously specified URL and method, and returns the MIME object received as a result.
 FederatedHttpResponse executeRequest(URL url)
          Executes an HTTP request using the specified URL and a previously specified method, and returns the MIME object received as a result.
 FederatedHttpResponse executeRequest(URL url, String method)
          Executes an HTTP request using the specified URL and method, and returns the MIME object received as a result.
 void resetRequest()
          Resets the payload and headings of the HTTP request to default values.
 void setUrl(String url)
          Sets the url property to the specified string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FederatedHttpConnection

public FederatedHttpConnection()
                        throws WTPropertyVetoException
Constructor returning an instance initialized with a null URL, method specified as "GET", no payload, and default request headings.

Supported API: true

Throws:
WTPropertyVetoException

FederatedHttpConnection

public FederatedHttpConnection(String url)
                        throws WTPropertyVetoException
Constructor returning an instance initialized with the specified URL.

Supported API: true

Parameters:
url -
Throws:
WTPropertyVetoException

FederatedHttpConnection

public FederatedHttpConnection(URL url,
                               String method)
                        throws WTPropertyVetoException
Constructor returning an instance initialized with the specified URL and method.

Supported API: true

Parameters:
url -
method -
Throws:
WTPropertyVetoException
Method Detail

addPayload

public void addPayload(String contentType,
                       String text)
                throws WTPropertyVetoException
Augments the payload of a POST or PUT request with the specified string of the specified MIME type/subtype.

Supported API: true

Parameters:
contentType -
text -
Throws:
WTPropertyVetoException

addPayload

public void addPayload(String contentType,
                       byte[] octets)
                throws WTPropertyVetoException
Augments the payload of a POST or PUT request with the specified array of octets of the specified MIME type/subtype.

Supported API: true

Parameters:
contentType -
octets -
Throws:
WTPropertyVetoException

addPayload

public void addPayload(FederatedHttpBodyPart part)
                throws WTPropertyVetoException
Augments the payload of a POST or PUT request with the specified MIME object.

Supported API: true

Parameters:
part -
Throws:
WTPropertyVetoException

addHeading

public void addHeading(String keyword,
                       String value)
Adds a specified heading to an HTTP request. If this method is called more than once specifying the same heading keyword, the values are concatenated into an HTTP heading value list.

Supported API: true

Parameters:
keyword -
value -

resetRequest

public void resetRequest()
                  throws WTPropertyVetoException
Resets the payload and headings of the HTTP request to default values.

Supported API: true

Throws:
WTPropertyVetoException

close

public void close()
           throws wt.federation.FederationServicesException
Closes the HTTP connection and releases resources associated with it.

Supported API: true

Throws:
wt.federation.FederationServicesException

executeRequest

public FederatedHttpResponse executeRequest()
                                     throws wt.federation.FederationServicesException
Executes an HTTP request using a previously specified URL and method, and returns the MIME object received as a result.

Supported API: true

Returns:
FederatedHttpResponse
Throws:
wt.federation.FederationServicesException

executeRequest

public FederatedHttpResponse executeRequest(URL url,
                                            String method)
                                     throws wt.federation.FederationServicesException
Executes an HTTP request using the specified URL and method, and returns the MIME object received as a result.

Supported API: true

Parameters:
url -
method -
Returns:
FederatedHttpResponse
Throws:
wt.federation.FederationServicesException

executeRequest

public FederatedHttpResponse executeRequest(URL url)
                                     throws wt.federation.FederationServicesException
Executes an HTTP request using the specified URL and a previously specified method, and returns the MIME object received as a result.

Supported API: true

Parameters:
url -
Returns:
FederatedHttpResponse
Throws:
wt.federation.FederationServicesException

setUrl

public void setUrl(String url)
            throws WTPropertyVetoException
Sets the url property to the specified string.

Supported API: true

Parameters:
url -
Throws:
WTPropertyVetoException