org.apache.jetspeed.security.impl
Class AbstractSecurityValve

java.lang.Object
  extended by org.apache.jetspeed.pipeline.valve.AbstractValve
      extended by org.apache.jetspeed.security.impl.AbstractSecurityValve
All Implemented Interfaces:
SecurityValve, org.apache.jetspeed.pipeline.valve.Valve
Direct Known Subclasses:
NtlmSecurityValve, SecurityValveImpl

public abstract class AbstractSecurityValve
extends AbstractValve
implements SecurityValve

AbstractSecurityValve

Version:
$Id: AbstractSecurityValve.java 544402 2007-06-05 06:20:00Z taylor $
Author:
Scott T. Weaver

Field Summary
protected  org.apache.jetspeed.administration.PortalAuthenticationConfiguration authenticationConfiguration
           
 
Fields inherited from interface org.apache.jetspeed.pipeline.valve.SecurityValve
IP_ADDRESS
 
Constructor Summary
AbstractSecurityValve()
           
 
Method Summary
protected abstract  Subject getSubject(org.apache.jetspeed.request.RequestContext request)
           getSubject
protected  Subject getSubjectFromSession(org.apache.jetspeed.request.RequestContext request)
           getSubjectFromSession
protected abstract  Principal getUserPrincipal(org.apache.jetspeed.request.RequestContext request)
           getUserPrincipal
 void invoke(org.apache.jetspeed.request.RequestContext request, org.apache.jetspeed.pipeline.valve.ValveContext context)
           invoke
protected  boolean isSessionExpired(org.apache.jetspeed.request.RequestContext request)
          Check for hard limit session expiration time out
 
Methods inherited from class org.apache.jetspeed.pipeline.valve.AbstractValve
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.pipeline.valve.Valve
initialize
 

Field Detail

authenticationConfiguration

protected org.apache.jetspeed.administration.PortalAuthenticationConfiguration authenticationConfiguration
Constructor Detail

AbstractSecurityValve

public AbstractSecurityValve()
Method Detail

getSubject

protected abstract Subject getSubject(org.apache.jetspeed.request.RequestContext request)
                               throws Exception

getSubject

Should build and return a javax.security.Subject

Parameters:
request -
Returns:
Subject
Throws:
Exception

getUserPrincipal

protected abstract Principal getUserPrincipal(org.apache.jetspeed.request.RequestContext request)
                                       throws Exception

getUserPrincipal

Should build and return a java.security.Principal that represents the user name the Subject returned from getSubject()

Parameters:
request -
Returns:
Principal
Throws:
Exception

getSubjectFromSession

protected final Subject getSubjectFromSession(org.apache.jetspeed.request.RequestContext request)
                                       throws Exception

getSubjectFromSession

Parameters:
request -
Returns:
javax.security.Subject or null if there is no servlet session attribute defined for the key org.apache.jetspeed.PortalReservedParameters.SESSION_KEY_SUBJECT.
Throws:
Exception

invoke

public void invoke(org.apache.jetspeed.request.RequestContext request,
                   org.apache.jetspeed.pipeline.valve.ValveContext context)
            throws org.apache.jetspeed.pipeline.PipelineException

invoke

Uses getSubject() to call ValveContext.invokeNext() via JSSubjectdoAsPrivileged(). This method also takes care of setting the value of the RequestContext.subject property and the session attribute org.apache.jetspeed.PortalReservedParameters.SESSION_KEY_SUBJECT

Specified by:
invoke in interface org.apache.jetspeed.pipeline.valve.Valve
Specified by:
invoke in class AbstractValve
Parameters:
request -
context -
Throws:
org.apache.jetspeed.pipeline.PipelineException - if the is an error encountered during any security operations.
See Also:
Valve.invoke(org.apache.jetspeed.request.RequestContext, org.apache.jetspeed.pipeline.valve.ValveContext)

isSessionExpired

protected boolean isSessionExpired(org.apache.jetspeed.request.RequestContext request)
                            throws org.apache.jetspeed.pipeline.PipelineException
Check for hard limit session expiration time out

Parameters:
request -
Returns:
Throws:
org.apache.jetspeed.pipeline.PipelineException


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.