|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.federation.FederatedHttpConnection
Creates HTTP connections to remote systems, sends requests, and returns
the responses received.
Supported API: true
Extendable: false
Field Summary | |
private static String |
CLASSNAME
|
static long |
EXTERNALIZATION_VERSION_UID
|
private Hashtable |
headings
|
private String |
hostname
|
private DataInputStream |
inputStream
|
private String |
method
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private DataOutputStream |
outputStream
|
private FederatedHttpBodyPart |
payload
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
private Socket |
socket
|
private URL |
url
|
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(String url,
String method)
Constructor returning an instance initialized with the specified URL and method. |
|
FederatedHttpConnection(URL 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. |
String |
getMethod()
Gets the value of the attribute: method. |
FederatedHttpBodyPart |
getPayload()
Gets the value of the attribute: payload. |
URL |
getUrl()
Gets the value of the attribute: url. |
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(FederatedHttpConnection thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
private void |
resetPrivateAttributes()
|
void |
resetRequest()
Resets the payload and headings of the HTTP request to default values. |
void |
setMethod(String a_Method)
Sets the value of the attribute: method. |
void |
setPayload(FederatedHttpBodyPart a_Payload)
Sets the value of the attribute: payload. |
void |
setUrl(String url)
Sets the url property to the specified string. |
void |
setUrl(URL a_Url)
Sets the value of the attribute: url. |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private URL url
private String method
private FederatedHttpBodyPart payload
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private Hashtable headings
private String hostname
private DataInputStream inputStream
private DataOutputStream outputStream
private Socket socket
Constructor Detail |
public FederatedHttpConnection() throws WTPropertyVetoException
WTPropertyVetoException
public FederatedHttpConnection(URL url) throws WTPropertyVetoException
url
-
WTPropertyVetoException
public FederatedHttpConnection(String url) throws WTPropertyVetoException
url
-
WTPropertyVetoException
public FederatedHttpConnection(URL url, String method) throws WTPropertyVetoException
url
- method
-
WTPropertyVetoException
public FederatedHttpConnection(String url, String method) throws WTPropertyVetoException
url
- method
-
WTPropertyVetoException
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(FederatedHttpConnection thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public URL getUrl()
public void setUrl(URL a_Url) throws WTPropertyVetoException
a_Url
-
WTPropertyVetoException
public String getMethod()
public void setMethod(String a_Method)
a_Method
- public FederatedHttpBodyPart getPayload()
public void setPayload(FederatedHttpBodyPart a_Payload) throws WTPropertyVetoException
a_Payload
-
WTPropertyVetoException
public void addPayload(String contentType, String text) throws WTPropertyVetoException
contentType
- text
-
WTPropertyVetoException
public void addPayload(String contentType, byte[] octets) throws WTPropertyVetoException
contentType
- octets
-
WTPropertyVetoException
public void addPayload(FederatedHttpBodyPart part) throws WTPropertyVetoException
part
-
WTPropertyVetoException
public void addHeading(String keyword, String value)
keyword
- value
- public void resetRequest() throws WTPropertyVetoException
WTPropertyVetoException
public void close() throws FederationServicesException
FederationServicesException
public FederatedHttpResponse executeRequest() throws FederationServicesException
FederationServicesException
public FederatedHttpResponse executeRequest(URL url, String method) throws FederationServicesException
url
- method
-
FederationServicesException
public FederatedHttpResponse executeRequest(URL url) throws FederationServicesException
url
-
FederationServicesException
public void setUrl(String url) throws WTPropertyVetoException
url
-
WTPropertyVetoException
private void resetPrivateAttributes()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |