com.sun.xml.ws.transport.tcp.server.tomcat.grizzly10
Class HttpRedirector

java.lang.Object
  extended by com.sun.xml.ws.transport.tcp.server.tomcat.grizzly10.HttpRedirector

public class HttpRedirector
extends java.lang.Object

Utility class used to redirect an HTTP(s) request to another protocol and endpoint. The following scenarios are supported: (1) http://host:port1 to https://host:port1 (2) https://host:port1 to http://host:port1 (3) http://host:port2 to https://host:port1 (4) https://host:port2 to https://host:port1 (5) http://host:port2 to http://host:port1 (6) https://host:port2 to http://host:port1 This class internally start an NIO Selector listening on an 'external' port to a 'redirect' port. All requests to the external port, independently of the protocol are redirected to the 'redirect' port.


Constructor Summary
HttpRedirector(int redirectPort)
           
 
Method Summary
 void redirect(com.sun.enterprise.web.portunif.util.ProtocolInfo protocolInfo)
          Redirect a un-secure request (http) to http or https.
 void redirectSSL(com.sun.enterprise.web.portunif.util.ProtocolInfo protocolInfo)
          Redirect a secure request (https) to http or https.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRedirector

public HttpRedirector(int redirectPort)
Method Detail

redirectSSL

public final void redirectSSL(com.sun.enterprise.web.portunif.util.ProtocolInfo protocolInfo)
                       throws java.io.IOException
Redirect a secure request (https) to http or https.

Parameters:
protocolInfo - the ProtocolInfo that contains the information about the current protocol state.
Throws:
java.io.IOException

redirect

public final void redirect(com.sun.enterprise.web.portunif.util.ProtocolInfo protocolInfo)
                    throws java.io.IOException
Redirect a un-secure request (http) to http or https.

Parameters:
protocolInfo - the ProtocolInfo that contains the information about the current protocol state.
Throws:
java.io.IOException