com.acsinet_solutions.cetia4.service.impl
Class UserSessionImpl

java.lang.Object
  extended by com.acsinet_solutions.cetia4.service.impl.UserSessionImpl
All Implemented Interfaces:
UserSession

public class UserSessionImpl
extends java.lang.Object
implements UserSession

Basic implementation of a reusable session instance

Derechos Reservados

Author:
Santiago Arriaga

Field Summary
static UserSession SYSTEM_SESSION
           
 
Fields inherited from interface com.acsinet_solutions.cetia4.service.UserSession
SYSTEM_ID, SYSTEM_LOGIN
 
Constructor Summary
UserSessionImpl(int userId, java.lang.String login, java.lang.String fname, java.lang.String lname1, java.util.Set<java.lang.String> roles)
          parametric constructor
 
Method Summary
 java.lang.String getFname()
          Get the session's user name
 java.lang.String getLname1()
          Get the session's user last name
 java.lang.String getLogin()
          Get the session's user login
 java.util.Set<java.lang.String> getRoles()
          Get the list of roles for the given session.
 int getUserId()
          Get the session's user id
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SYSTEM_SESSION

public static final UserSession SYSTEM_SESSION
Constructor Detail

UserSessionImpl

public UserSessionImpl(int userId,
                       java.lang.String login,
                       java.lang.String fname,
                       java.lang.String lname1,
                       java.util.Set<java.lang.String> roles)
parametric constructor

Parameters:
persistenceSessionManager - A not-null PersistenceSessionManager instance
userId - a valid user id
login - A not-null not-empty String instance
Method Detail

getUserId

public final int getUserId()
Description copied from interface: UserSession
Get the session's user id

Specified by:
getUserId in interface UserSession
Returns:
A valid user id; SYSTEM_ID ( 0 ) for system sessions

getLogin

public final java.lang.String getLogin()
Description copied from interface: UserSession
Get the session's user login

Specified by:
getLogin in interface UserSession
Returns:
A valid user login; SYSTEM_LOGIN for system sessions

getFname

public final java.lang.String getFname()
Description copied from interface: UserSession
Get the session's user name

Specified by:
getFname in interface UserSession
Returns:
A valid user login; SYSTEM_LOGIN for system sessions

getLname1

public final java.lang.String getLname1()
Description copied from interface: UserSession
Get the session's user last name

Specified by:
getLname1 in interface UserSession
Returns:
A valid user login; SYSTEM_LOGIN for system sessions

getRoles

public final java.util.Set<java.lang.String> getRoles()
Description copied from interface: UserSession
Get the list of roles for the given session.

Specified by:
getRoles in interface UserSession
Returns:
A not-null maybe-empty Set of not-null not-empty String instances

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object