com.iplanet.trustbase.initiator.transport
Class HTTPTransportAdapter

java.lang.Object
  |
  +--com.iplanet.trustbase.initiator.transport.HTTPTransportAdapter
All Implemented Interfaces:
TransportAdapter

public class HTTPTransportAdapter
extends java.lang.Object
implements TransportAdapter

HTTPTransportAdapter provides a standard implementation of TransportAdapter using the java.net.URL classes to provide the transport

See Also:
ExceptionCodes, TransportAdapterException, ConfigAdapterException

Constructor Summary
HTTPTransportAdapter(ConfigAdapter configAdapter)
          Construct a HTTPTransportAdapter
 
Method Summary
 byte[] sendReceive(byte[] data, java.lang.String location, java.lang.String messageType)
          Send and receive the message data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPTransportAdapter

public HTTPTransportAdapter(ConfigAdapter configAdapter)
Construct a HTTPTransportAdapter
Parameters:
configAdapter - the config adapter to use The config information used is summarised below
PropertyDescription
<messageType>.http.mimeType The mime type to use for the given message type
Method Detail

sendReceive

public byte[] sendReceive(byte[] data,
                          java.lang.String location,
                          java.lang.String messageType)
                   throws TransportAdapterException,
                          ConfigAdapterException
Send and receive the message data
Specified by:
sendReceive in interface TransportAdapter
Parameters:
data - the data to be sent
location - the responder URL
messageType - the type of the message data (e.g. "ocsp");
Returns:
the data that was returned from the responder
Throws:
TransportAdapterException - on any transport error
ConfigAdapterException - if config information cannot be retrieved Exception codes generated in this class are as follows:
Code Arguments Description
ExceptionCodes.CSC_HTTP_NO_MIME_TYPE String:location,String:messageType No mime type was registered for this message type
ExceptionCodes.CSC_MALFORMED_URL String:location Location string not a valid URL
ExceptionCodes.CSC_HTTP_WRITE_FAILED String:location The data could not be sent
ExceptionCodes.CSC_HTTP_READ_FAILED String:location The data could not be read
ExceptionCodes.CSC_HTTP_OPEN_CONNECTION_FAILED String:location A connection to the remote host could not be opened
ExceptionCodes.CSC_HTTP_CONNECT_FAILED String:location A connection to the remote host could not be opened
ExceptionCodes.CSC_HTTP_NO_ROUTE_TO_HOST String:location No route to the remote host could be determined
ExceptionCodes.CSC_HTTP_PROTOCOL_ERROR String:location There was a protocol error
ExceptionCodes.CSC_HTTP_SOCKET_ERROR String:location There was a general network error
ExceptionCodes.CSC_HTTP_UNKNOWN_HOST String:location The remote host could not be found