Package wt.federation
Class FederatedHttpConnection
java.lang.Object
wt.federation.FederatedHttpConnection
- All Implemented Interfaces:
Externalizable,Serializable
Creates HTTP connections to remote systems, sends requests, and returns
the responses received.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor returning an instance initialized with a null URL, method specified as "GET", no payload, and default request headings.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
Modifier and TypeMethodDescriptionvoidaddHeading(String keyword, String value) Adds a specified heading to an HTTP request.voidaddPayload(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.voidaddPayload(String contentType, String text) Augments the payload of a POST or PUT request with the specified string of the specified MIME type/subtype.voidAugments the payload of a POST or PUT request with the specified MIME object.voidclose()Closes the HTTP connection and releases resources associated with it.Executes an HTTP request using a previously specified URL and method, and returns the MIME object received as a result.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.executeRequest(URL url, String method) Executes an HTTP request using the specified URL and method, and returns the MIME object received as a result.voidResets the payload and headings of the HTTP request to default values.voidSets the url property to the specified string.
-
Constructor Details
-
FederatedHttpConnection
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
Constructor returning an instance initialized with the specified URL.
Supported API: true- Parameters:
url-- Throws:
WTPropertyVetoException
-
FederatedHttpConnection
Constructor returning an instance initialized with the specified URL and method.
Supported API: true- Parameters:
url-method-- Throws:
WTPropertyVetoException
-
-
Method Details
-
addPayload
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
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
Augments the payload of a POST or PUT request with the specified MIME object.
Supported API: true- Parameters:
part-- Throws:
WTPropertyVetoException
-
addHeading
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
Resets the payload and headings of the HTTP request to default values.
Supported API: true- Throws:
WTPropertyVetoException
-
close
Closes the HTTP connection and releases resources associated with it.
Supported API: true- Throws:
FederationServicesException
-
executeRequest
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:
FederationServicesException
-
executeRequest
public FederatedHttpResponse executeRequest(URL url, String method) throws 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:
FederationServicesException
-
executeRequest
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:
FederationServicesException
-
setUrl
Sets the url property to the specified string.
Supported API: true- Parameters:
url-- Throws:
WTPropertyVetoException
-