Package org.pentaho.platform.web.http
Class PreAuthenticatedSessionHolder
- java.lang.Object
-
- org.pentaho.platform.web.http.PreAuthenticatedSessionHolder
-
public class PreAuthenticatedSessionHolder extends Object
This class serves to capture a users IPentahoSession and Spring Authentication by assigning them a key. The returned key can be used by another party to regain the users session/authentication, in essence logging them in from another client. User: nbaker Date: 6/28/12
-
-
Constructor Summary
Constructors Constructor Description PreAuthenticatedSessionHolder()
Constructs a new session holder with the default TTL and eviction schedule.PreAuthenticatedSessionHolder(int ttl, int evictionInterval)
Constructs a new session holder with the given TTL and eviction schedule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
captureSession()
Stores the active IPentahoSession and Spring Security Authentication objects (both ThreadLocal based).void
close()
This should be called with this class is no longer in use.protected void
finalize()
boolean
restoreSession(String hash)
Assigns the IPentahoSession and Authentication stored with the given key to the current request.
-
-
-
Constructor Detail
-
PreAuthenticatedSessionHolder
public PreAuthenticatedSessionHolder(int ttl, int evictionInterval)
Constructs a new session holder with the given TTL and eviction schedule.- Parameters:
ttl
- The time a captured session will be retainedevictionInterval
- The interval in which sessions will be scanned and evicted if over the TTL
-
PreAuthenticatedSessionHolder
public PreAuthenticatedSessionHolder()
Constructs a new session holder with the default TTL and eviction schedule.
-
-
Method Detail
-
captureSession
public String captureSession()
Stores the active IPentahoSession and Spring Security Authentication objects (both ThreadLocal based).- Returns:
- key associated with the captured session.
-
restoreSession
public boolean restoreSession(String hash)
Assigns the IPentahoSession and Authentication stored with the given key to the current request.- Parameters:
hash
- Stored key- Returns:
- success if the given key matches a session stored in the holder.
-
finalize
protected void finalize() throws Throwable
-
close
public void close()
This should be called with this class is no longer in use. Cleans-up the eviction scheduled task.
-
-