org.abstracthorizon.danube.http.util
Class EnsureHTTPS

java.lang.Object
  extended by org.abstracthorizon.danube.http.util.EnsureHTTPS
All Implemented Interfaces:
ConnectionHandler

public class EnsureHTTPS
extends Object
implements ConnectionHandler

This wrapper forces JAAS authentication to happen at client side: if "Authorization" header is missing it would return 401 code requesting one.

Author:
Daniel Sendula

Field Summary
protected  ConnectionHandler handler
          Wrapped handler
static String LOCATION_RESPONSE_HEADER
           
protected  org.slf4j.Logger logger
          Logger
protected  int port
          HTTPS port - default 443
 
Constructor Summary
EnsureHTTPS()
          Constructor
EnsureHTTPS(ConnectionHandler handler)
          Constructor
 
Method Summary
 ConnectionHandler getHandler()
          Returns wrapped handler
 int getPort()
          Returns https port
 void handleConnection(Connection connection)
          This method creates sets context path to be same as context path up to here plus this component's path.
 void setHandler(ConnectionHandler handler)
          Sets wrapped handler
 void setPort(int port)
          Sets https port
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger


LOCATION_RESPONSE_HEADER

public static final String LOCATION_RESPONSE_HEADER
See Also:
Constant Field Values

handler

protected ConnectionHandler handler
Wrapped handler


port

protected int port
HTTPS port - default 443

Constructor Detail

EnsureHTTPS

public EnsureHTTPS()
Constructor


EnsureHTTPS

public EnsureHTTPS(ConnectionHandler handler)
Constructor

Method Detail

handleConnection

public void handleConnection(Connection connection)
This method creates sets context path to be same as context path up to here plus this component's path. Component's path is reset to "/"

Specified by:
handleConnection in interface ConnectionHandler
Parameters:
connection - socket connection

getHandler

public ConnectionHandler getHandler()
Returns wrapped handler

Returns:
wrapped handler

setHandler

public void setHandler(ConnectionHandler handler)
Sets wrapped handler

Parameters:
handler - wrapped handler

getPort

public int getPort()
Returns https port

Returns:
https port

setPort

public void setPort(int port)
Sets https port

Parameters:
port - https port


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.