org.apache.turbine.modules.actions.sessionvalidator
Class DefaultSessionValidator

java.lang.Object
  extended by org.apache.turbine.modules.Assembler
      extended by org.apache.turbine.modules.Action
          extended by org.apache.turbine.modules.actions.sessionvalidator.SessionValidator
              extended by org.apache.turbine.modules.actions.sessionvalidator.DefaultSessionValidator

public class DefaultSessionValidator
extends SessionValidator

The SessionValidator attempts to retrieve the User object from the Servlet API session that is associated with the request. If the data cannot be retrieved, it is handled here. If the user has not been marked as being logged into the system, the user is rejected and the screen is set to the screen.homepage value in TurbineResources.properties.

Other systems generally have a database table which stores this information, but we take advantage of the Servlet API here to save a hit to the database for each and every connection that a user makes.

This action is special in that it should only be executed by the Turbine servlet.

Version:
$Id: DefaultSessionValidator.java 1066518 2011-02-02 16:30:53Z ludwig $
Author:
Dave Bryson, Henning P. Schmiedehausen, Peter Courcoux

Field Summary
 
Fields inherited from class org.apache.turbine.modules.Action
CACHE_SIZE_DEFAULT, CACHE_SIZE_KEY, NAME, PREFIX
 
Constructor Summary
DefaultSessionValidator()
           
 
Method Summary
 void doPerform(PipelineData pipelineData)
          Execute the action.
 void doPerform(RunData data)
          Deprecated. Use PipelineData version instead.
 
Methods inherited from class org.apache.turbine.modules.Action
getPrefix, perform, perform
 
Methods inherited from class org.apache.turbine.modules.Assembler
getRunData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSessionValidator

public DefaultSessionValidator()
Method Detail

doPerform

@Deprecated
public void doPerform(RunData data)
               throws TurbineException
Deprecated. Use PipelineData version instead.

Execute the action. The default is to populate the RunData object and, if the user is unknown, to force a login screen (as set in the tr.props).

Specified by:
doPerform in class Action
Parameters:
data - Turbine RunData context information.
Throws:
TurbineException - The anonymous user could not be obtained from the security service
See Also:
InvalidState

doPerform

public void doPerform(PipelineData pipelineData)
               throws TurbineException
Execute the action. The default is to populate the RunData object and, if the user is unknown, to force a login screen (as set in the tr.props).

Overrides:
doPerform in class Action
Parameters:
pipelineData - Turbine PipelineData context information.
Throws:
TurbineException - The anonymous user could not be obtained from the security service
See Also:
InvalidState


Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.