com.bankframe.ei.channel.client
Class HttpClient
java.lang.Object
com.bankframe.ei.channel.client.HttpClient
- All Implemented Interfaces:
- ChannelClient
- Direct Known Subclasses:
- CookieClient, HttpsClient, StoreAndForwardHttpClient
public class HttpClient
- extends Object
- implements ChannelClient
This class is used by fat clients (Java apps, applets etc to communicate
with BankFrameMCA over HTTP connections. The communication takes place
between this client and a servlet (of type
com.bankframe.ei.channel.server.HttpServer
).
The servlet is a HttpServer object that will process the request. This
client and the corresponding server both share a codec that is used to
allow data to be sent over the HTTP connection. Data that is sent over
the wire is converted to a string representation by using this specified
codec class.
The properties (server url, content-type) are specified in the
BankFrameResource.properties file.
Field Summary |
String |
separator
Get the character used to seperate key value pairs. |
separator
public String separator
- Get the character used to seperate key value pairs. By convention
this will be semi-colon.
HttpClient
public HttpClient()
throws MalformedURLException,
ProcessingErrorException
- HttpClient constructor. Retieves its parameters from the
bankframeresource.properties
file.
- Throws:
MalformedURLException
- if the server URL is invalid
ProcessingErrorException
- if the codec cannot be created
HttpClient
public HttpClient(String urlString,
String contentTypeParam)
throws MalformedURLException,
ProcessingErrorException
- Constructor
- Parameters:
urlString
- String the url of the Http ServercontentTypeParam
- String the MIME encoding to be used by this client
- Throws:
MalformedURLException
- If the server URL is invalid
ProcessingErrorException
- if the codec object cannot be created
getCodec
public Codec getCodec()
- Returns:
- A reference to the codec object being used
getContentType
public String getContentType()
- Returns:
- The MIME content-type for this client
getURL
public URL getURL()
- Returns:
- The Http Server URL
send
public Vector send(DataPacket dp)
- This is a convenience method to send a single DataPacket without having
to wrap it in a Vector.
- Parameters:
dp
- The request datapacket.
- Returns:
- A vector of datapackets containing the server response, or a vector of
datapackets containing the details of any exception that occured during
communication with the server
send
public Vector send(Vector dataPackets)
- All ChannelManagers must support this method. It sends one or more
request datapackets to the HTTP server.
- Specified by:
send
in interface ChannelClient
- Parameters:
dataPackets
- Vector of request datapacket(s).
- Returns:
- A vector of datapackets containing the server response, or a vector of
datapackets containing the details of any exception that occured during
communication with the server
setContentType
public void setContentType(String contentType)
throws ProcessingErrorException
- This method sets the MIME content-type for this client. This will also use the mapping
properties to create a codec object that corresponds to the MIME type.
- Throws:
ProcessingErrorException
- If the MIME type is not mapped to a codec
setURL
public void setURL(URL u)
- This method sets the URL of the http server
Copyright © 2005, 2007, Oracle. All rights reserved.