org.jcoderz.commons.connector.http
Class HttpConnectorSessionImpl

java.lang.Object
  extended by org.jcoderz.commons.connector.http.HttpConnectorSessionImpl
All Implemented Interfaces:
HttpConnectorSessionInterface, HttpConnectorEventListener
Direct Known Subclasses:
HttpConnectorSessionBean

public class HttpConnectorSessionImpl
extends Object
implements HttpConnectorSessionInterface, HttpConnectorEventListener

Session bean using the http connector.


Constructor Summary
HttpConnectorSessionImpl()
           
 
Method Summary
 void requestSend(ConnectorContext context)
          Callback method indicating that the request is being sent to the peer.
 void requestSendWithRetry(ConnectorContext context)
          Callback method indicating that the request is being sent to the peer, possibly retrying if sending fails at first.
 void responseReceived(int resultCode, byte[] response, ConnectorContext context)
          Callback method indicating that the response has been received from the peer in use.
 void responseReceivedAfterRetry(int numberOfRetries, byte[] responseData, ConnectorContext context)
          Callback indicating that a response was received after the given number of retries.
 ConnectorResponse sendAndReceive(byte[] request, Url target, HttpRequestResponseHeader header)
          Send a request and receive a response using the http connector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpConnectorSessionImpl

public HttpConnectorSessionImpl()
Method Detail

sendAndReceive

public ConnectorResponse sendAndReceive(byte[] request,
                                        Url target,
                                        HttpRequestResponseHeader header)
                                 throws RemoteException,
                                        ResourceException,
                                        ConnectorException
Send a request and receive a response using the http connector.

Specified by:
sendAndReceive in interface HttpConnectorSessionInterface
Parameters:
request - the request
target - the target host
header - the request response header object
Returns:
ConnectorResponse value object for the response
Throws:
RemoteException - in case of a bean error
ResourceException - in case of a connector error
ConnectorException - in case of a error on transport layer

requestSend

public void requestSend(ConnectorContext context)
Callback method indicating that the request is being sent to the peer. This can be called multiple times indicating retries sending the request.

Specified by:
requestSend in interface HttpConnectorEventListener
Parameters:
context - the context set for the connector handle

responseReceived

public void responseReceived(int resultCode,
                             byte[] response,
                             ConnectorContext context)
Callback method indicating that the response has been received from the peer in use.

Specified by:
responseReceived in interface HttpConnectorEventListener
Parameters:
resultCode - the HTTP status code
response - the HTTP response
context - the context set for the connector handle

requestSendWithRetry

public void requestSendWithRetry(ConnectorContext context)
Callback method indicating that the request is being sent to the peer, possibly retrying if sending fails at first.

Specified by:
requestSendWithRetry in interface HttpConnectorEventListener
Parameters:
context - the context set for the connector handle

responseReceivedAfterRetry

public void responseReceivedAfterRetry(int numberOfRetries,
                                       byte[] responseData,
                                       ConnectorContext context)
Callback indicating that a response was received after the given number of retries.

Specified by:
responseReceivedAfterRetry in interface HttpConnectorEventListener
Parameters:
numberOfRetries - the number of retries
responseData - the HTTP response data
context - the context set for the connector handle


Copyright 2007 The jCoderZ Project.