HTTPClient
Class RedirectionModule

java.lang.Object
  |
  +--HTTPClient.RedirectionModule
All Implemented Interfaces:
HTTPClientModule, HTTPClientModuleConstants

class RedirectionModule
extends java.lang.Object
implements HTTPClientModule

This module handles the redirection status codes 301, 302, 303, 305, 306 and 307.


Fields inherited from interface HTTPClient.HTTPClientModuleConstants
REQ_CONTINUE, REQ_NEWCON_RST, REQ_NEWCON_SND, REQ_RESPONSE, REQ_RESTART, REQ_RETURN, REQ_SHORTCIRC, RSP_CONTINUE, RSP_NEWCON_REQ, RSP_NEWCON_SND, RSP_REQUEST, RSP_RESTART, RSP_SEND, RSP_SHORTCIRC
 
Constructor Summary
(package private) RedirectionModule()
          Start with level 0.
 
Method Summary
TypeMethod
 int requestHandler(Request req, Response[] resp)
          Invoked by the HTTPClient.
 void responsePhase1Handler(Response resp, RoRequest req)
          Invoked by the HTTPClient.
 int responsePhase2Handler(Response resp, Request req)
          Invoked by the HTTPClient.
 void responsePhase3Handler(Response resp, RoRequest req)
          Invoked by the HTTPClient.
 void trailerHandler(Response resp, RoRequest req)
          Invoked by the HTTPClient.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedirectionModule

RedirectionModule()
Start with level 0.
Method Detail

requestHandler

public int requestHandler(Request req,
                          Response[] resp)
Invoked by the HTTPClient.
Specified by:
requestHandler in interface HTTPClientModule
Following copied from interface: HTTPClient.HTTPClientModule
Parameters:
request - the request - may be modified as needed
response - the response if the status is REQ_RESPONSE or REQ_RETURN
Returns:
status code REQ_XXX specifying further action
Throws:
java.io.IOException - if an IOException occurs on the socket
ModuleException - if an exception occurs during the handling of the request

responsePhase1Handler

public void responsePhase1Handler(Response resp,
                                  RoRequest req)
                           throws java.io.IOException
Invoked by the HTTPClient.
Specified by:
responsePhase1Handler in interface HTTPClientModule
Following copied from interface: HTTPClient.HTTPClientModule
Parameters:
response - the response - may be modified
request - the original request
Throws:
java.io.IOException - if an IOException occurs on the socket
ModuleException - if an exception occurs during the handling of the response

responsePhase2Handler

public int responsePhase2Handler(Response resp,
                                 Request req)
                          throws java.io.IOException
Invoked by the HTTPClient.
Specified by:
responsePhase2Handler in interface HTTPClientModule
Following copied from interface: HTTPClient.HTTPClientModule
Parameters:
response - the response - may be modified
request - the request; if the status is RSP_REQUEST then this must contain the new request; however do not modify this if you don't return a RSP_REQUEST status.
Returns:
status code RSP_XXX specifying further action
Throws:
java.io.IOException - if an IOException occurs on the socket
ModuleException - if an exception occurs during the handling of the response

responsePhase3Handler

public void responsePhase3Handler(Response resp,
                                  RoRequest req)
Invoked by the HTTPClient.
Specified by:
responsePhase3Handler in interface HTTPClientModule
Following copied from interface: HTTPClient.HTTPClientModule
Parameters:
response - the response - may be modified
request - the original request
Throws:
java.io.IOException - if an IOException occurs on the socket
ModuleException - if an exception occurs during the handling of the response

trailerHandler

public void trailerHandler(Response resp,
                           RoRequest req)
Invoked by the HTTPClient.
Specified by:
trailerHandler in interface HTTPClientModule
Following copied from interface: HTTPClient.HTTPClientModule
Parameters:
response - the response
request - the request
Throws:
java.io.IOException - if an IOException occurs on the socket
ModuleException - if an exception occurs during the handling of the trailers