org.jboss.identity.federation.bindings.tomcat.idp
Class IDPRedirectValve

java.lang.Object
  extended by org.apache.catalina.valves.ValveBase
      extended by org.jboss.identity.federation.bindings.tomcat.idp.IDPRedirectValve
All Implemented Interfaces:
javax.management.MBeanRegistration, org.apache.catalina.Contained, org.apache.catalina.Lifecycle, org.apache.catalina.Valve
Direct Known Subclasses:
IDPRedirectWithSignatureValve

public class IDPRedirectValve
extends org.apache.catalina.valves.ValveBase
implements org.apache.catalina.Lifecycle

Valve at the IDP that supports the HTTP/Redirect Binding

Since:
Dec 9, 2008
Author:
Anil.Saldhana@redhat.com

Field Summary
protected  IDPType idpConfiguration
           
protected  org.apache.catalina.util.LifecycleSupport lifecycle
          The lifecycle event support for this component.
 
Fields inherited from class org.apache.catalina.valves.ValveBase
container, containerLog, controller, domain, info, mserver, next, oname, sm
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
IDPRedirectValve()
           
 
Method Summary
 void addLifecycleListener(org.apache.catalina.LifecycleListener listener)
          Add a lifecycle event listener to this component.
 org.apache.catalina.LifecycleListener[] findLifecycleListeners()
          Get the lifecycle listeners associated with this lifecycle.
protected  java.lang.String getDestination(java.lang.String urlEncodedResponse, java.lang.String urlEncodedRelayState)
          Generate a Destination URL for the HTTPRedirect binding with the saml response and relay state
protected  ResponseType getResponse(org.apache.catalina.connector.Request request, java.security.Principal userPrincipal)
          Create a response type
 void invoke(org.apache.catalina.connector.Request request, org.apache.catalina.connector.Response response)
           
protected  void isTrusted(java.lang.String issuer)
          Verify that the issuer is trusted
 void removeLifecycleListener(org.apache.catalina.LifecycleListener listener)
          Remove a lifecycle event listener from this component.
protected  void send(ResponseType responseType, java.lang.String relayState, org.apache.catalina.connector.Response response)
           
 void start()
          Prepare for the beginning of active use of the public methods of this component.
 void stop()
          Gracefully terminate the active use of the public methods of this component.
protected  boolean validate(org.apache.catalina.connector.Request request)
          Validate the incoming Request
 
Methods inherited from class org.apache.catalina.valves.ValveBase
backgroundProcess, createObjectName, event, getContainer, getContainerName, getController, getDomain, getInfo, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

idpConfiguration

protected IDPType idpConfiguration

lifecycle

protected org.apache.catalina.util.LifecycleSupport lifecycle
The lifecycle event support for this component.

Constructor Detail

IDPRedirectValve

public IDPRedirectValve()
Method Detail

invoke

public void invoke(org.apache.catalina.connector.Request request,
                   org.apache.catalina.connector.Response response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Specified by:
invoke in interface org.apache.catalina.Valve
Specified by:
invoke in class org.apache.catalina.valves.ValveBase
Throws:
java.io.IOException
javax.servlet.ServletException

isTrusted

protected void isTrusted(java.lang.String issuer)
                  throws IssuerNotTrustedException
Verify that the issuer is trusted

Parameters:
issuer -
Throws:
IssuerNotTrustedException

send

protected void send(ResponseType responseType,
                    java.lang.String relayState,
                    org.apache.catalina.connector.Response response)
             throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

getDestination

protected java.lang.String getDestination(java.lang.String urlEncodedResponse,
                                          java.lang.String urlEncodedRelayState)
Generate a Destination URL for the HTTPRedirect binding with the saml response and relay state

Parameters:
urlEncodedResponse -
urlEncodedRelayState -
Returns:

validate

protected boolean validate(org.apache.catalina.connector.Request request)
                    throws java.lang.Exception
Validate the incoming Request

Parameters:
request -
Returns:
Throws:
java.lang.Exception

getResponse

protected ResponseType getResponse(org.apache.catalina.connector.Request request,
                                   java.security.Principal userPrincipal)
                            throws java.lang.Exception
Create a response type

Parameters:
request -
userPrincipal -
Returns:
Throws:
java.lang.Exception

addLifecycleListener

public void addLifecycleListener(org.apache.catalina.LifecycleListener listener)
Add a lifecycle event listener to this component.

Specified by:
addLifecycleListener in interface org.apache.catalina.Lifecycle
Parameters:
listener - The listener to add

findLifecycleListeners

public org.apache.catalina.LifecycleListener[] findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.

Specified by:
findLifecycleListeners in interface org.apache.catalina.Lifecycle

removeLifecycleListener

public void removeLifecycleListener(org.apache.catalina.LifecycleListener listener)
Remove a lifecycle event listener from this component.

Specified by:
removeLifecycleListener in interface org.apache.catalina.Lifecycle
Parameters:
listener - The listener to add

start

public void start()
           throws org.apache.catalina.LifecycleException
Prepare for the beginning of active use of the public methods of this component. This method should be called after configure(), and before any of the public methods of the component are utilized.

Specified by:
start in interface org.apache.catalina.Lifecycle
Throws:
org.apache.catalina.LifecycleException - if this component detects a fatal error that prevents this component from being used

stop

public void stop()
          throws org.apache.catalina.LifecycleException
Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component.

Specified by:
stop in interface org.apache.catalina.Lifecycle
Throws:
org.apache.catalina.LifecycleException - if this component detects a fatal error that needs to be reported


Copyright © 2009 JBoss Inc.. All Rights Reserved.