org.marketcetera.util.ws.stateful
Class SessionHolder<T>

java.lang.Object
  extended by org.marketcetera.util.ws.stateful.SessionHolder<T>

public class SessionHolder<T>
extends Object

A session holder. It is created after successful authentication, and initially retains just the authenticated user name and client context at that time. In later calls during the same session, the service implementations may associate session data with the holder; it is the responsibility of the service implementations to ensure thread safety in manipulating that data.

Since:
1.0.0
Version:
$Id: SessionHolder.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Constructor Summary
SessionHolder(String user, StatelessClientContext creationContext)
          Creates a new holder with the given authenticated user name and creation context.
 
Method Summary
 StatelessClientContext getCreationContext()
          Returns the receiver's creation context.
 T getSession()
          Returns the receiver's session data.
 String getUser()
          Returns the receiver's user.
 void setSession(T session)
          Sets the receiver's session data to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionHolder

public SessionHolder(String user,
                     StatelessClientContext creationContext)
Creates a new holder with the given authenticated user name and creation context.

Parameters:
user - The user name.
creationContext - The context.
Method Detail

getUser

public String getUser()
Returns the receiver's user.

Returns:
The user.

getCreationContext

public StatelessClientContext getCreationContext()
Returns the receiver's creation context.

Returns:
The context.

setSession

public void setSession(T session)
Sets the receiver's session data to the given value.

Parameters:
session - The data, which may be null.

getSession

public T getSession()
Returns the receiver's session data.

Returns:
The data, which may be null.


Copyright © 2012. All Rights Reserved.