org.codehaus.plexus.security.summit
Class SecureRunData

java.lang.Object
  extended byorg.codehaus.plexus.logging.AbstractLogEnabled
      extended byorg.codehaus.plexus.summit.AbstractSummitComponent
          extended byorg.codehaus.plexus.summit.rundata.AbstractRunData
              extended byorg.codehaus.plexus.summit.rundata.DefaultRunData
                  extended byorg.codehaus.plexus.security.summit.SecureRunData
All Implemented Interfaces:
org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.codehaus.plexus.logging.LogEnabled, org.codehaus.plexus.summit.rundata.RunData, org.codehaus.plexus.summit.SummitComponent

public class SecureRunData
extends org.codehaus.plexus.summit.rundata.DefaultRunData

An implementation of RunData which keeps a user's Session.

Since:
Feb 28, 2003
Author:
Dan Diephouse

Field Summary
static java.lang.String USER_SESSION_KEY
           
 
Fields inherited from interface org.codehaus.plexus.summit.rundata.RunData
ROLE
 
Constructor Summary
SecureRunData()
           
 
Method Summary
 java.lang.String getMessage()
           
 User getUser()
          Return the User for this session.
 User getUserFromSession()
          Attempts to get the User object from the session.
 org.codehaus.plexus.summit.view.ViewContext getViewContext()
           
 boolean hasUser()
          Checks to see if there is a user for this session.
 boolean removeUserFromSession()
          Allows one to invalidate the user in a session.
 void setMessage(java.lang.String message)
          Sets the message.
 void setUser(User user)
          Saves this user object to the session.
 
Methods inherited from class org.codehaus.plexus.summit.rundata.AbstractRunData
dispose, getContentType, getContextPath, getError, getLink, getMap, getParameters, getRequest, getResolution, getResponse, getResultMessages, getScriptName, getServerName, getServerPort, getServerScheme, getServletConfig, getServletContext, getSession, getTarget, hasError, hasResultMessages, hasTarget, initialize, setContentType, setError, setMap, setRequest, setResolution, setResponse, setResultMessages, setServletConfig, setTarget
 
Methods inherited from class org.codehaus.plexus.summit.AbstractSummitComponent
contextualize, getContainer, lookup, lookup
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.plexus.summit.SummitComponent
getContainer, lookup, lookup
 

Field Detail

USER_SESSION_KEY

public static final java.lang.String USER_SESSION_KEY
See Also:
Constant Field Values
Constructor Detail

SecureRunData

public SecureRunData()
Method Detail

getMessage

public java.lang.String getMessage()
Returns:
String

setMessage

public void setMessage(java.lang.String message)
Sets the message.

Parameters:
message - The message to set

getViewContext

public org.codehaus.plexus.summit.view.ViewContext getViewContext()

hasUser

public boolean hasUser()
Checks to see if there is a user for this session.

Returns:
boolean

getUser

public User getUser()
Return the User for this session.

Returns:
User

setUser

public void setUser(User user)

Saves this user object to the session.

Anyone overriding this method should be sure to leverage the SessionBindingEventProxy when adding the user and acl into the session. This allows hook functions to be called on the User and AccessControlList when it is removed from the session (which happens on session timeout).

Parameters:
user - The user to set

getUserFromSession

public User getUserFromSession()
Attempts to get the User object from the session. If the user does not exist in the session, null is returned.

Anyone overriding this method should be sure to leverage the SessionBindingEventProxy when pulling the User object from the session, allowing hook functions to be called on the listener when it is removed from the session (which happens on session timeout).

Returns:
The retreived user, or null if errors occur.
See Also:
org.apache.turbine.services.rundata.SessionBindingEventProxy, org.apache.fulcrum.security.entity.User, org.apache.fulcrum.security.session.SessionBindingListener

removeUserFromSession

public boolean removeUserFromSession()
Allows one to invalidate the user in a session.

Returns:
Whether the user was removed from the session.


Copyright © 2001-2007 Codehaus. All Rights Reserved.