org.caleigo.security
Class UserInfo

java.lang.Object
  extended byorg.caleigo.security.UserInfo
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UserInfo.DefaultUserInfo

public abstract class UserInfo
extends java.lang.Object
implements java.io.Serializable

The UserInfo class is used to define a container for user specific data and properties. Another very important service provided by the class is is static access methods for fetching and setting the current user.

Version:
1.00
Author:
Dennis Zikovic
See Also:
Serialized Form

Nested Class Summary
static class UserInfo.DefaultUserInfo
           
 
Constructor Summary
UserInfo()
           
 
Method Summary
 void copyFrom(UserInfo userInfo)
           
static java.lang.String getCurrentUserID()
          Returns the UserID of the current user in the system for the scope defined by the current thread.
static UserInfo getCurrentUserInfo()
          Returns the UserInfo object that defines the current user in the system for the scope defined by the current thread.
protected static ILoginService getLoginServiceIdentity()
           
abstract  java.lang.Object getProperty(java.lang.String name)
          Access nethod that returns a named property value from the called user info object.
abstract  java.lang.Object getProperty(java.lang.String name, java.lang.Object defaultValue)
          Access nethod that returns a named property value from the called user info object.
abstract  java.util.Enumeration getPropertyNames()
           
abstract  int getSessionID()
          Returns the session ID defined by the user info object.
abstract  java.lang.String getUserID()
          Access method that returns the user ID defined by the user info object.
abstract  void logout()
           
abstract  void setCurrentUserID(java.lang.String userID)
          Mutation method that sets the user ID defined by the user info object.
static void setCurrentUserInfo(UserInfo userInfo)
          Sets the UserInfo object that defines the current user in the system.
static void setDefaultUserInfo(UserInfo userInfo)
          Sets the default UserInfo object that will be used as the UserInfo object for all threads that has not had another info explicitly set.
static void setLoginServiceIdentity(java.lang.Object serviceIdentity)
           
abstract  void setProperty(java.lang.String name, java.lang.Object value)
          Updates the named property with provided value.
abstract  void setSessionID(int sessionID)
          Sets the session ID defined by the user info object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserInfo

public UserInfo()
Method Detail

setLoginServiceIdentity

public static void setLoginServiceIdentity(java.lang.Object serviceIdentity)

getLoginServiceIdentity

protected static ILoginService getLoginServiceIdentity()

getCurrentUserID

public static java.lang.String getCurrentUserID()
                                         throws LoginCanceledException,
                                                java.lang.SecurityException
Returns the UserID of the current user in the system for the scope defined by the current thread.

Throws:
LoginCanceledException
java.lang.SecurityException

getCurrentUserInfo

public static UserInfo getCurrentUserInfo()
                                   throws LoginCanceledException,
                                          java.lang.SecurityException
Returns the UserInfo object that defines the current user in the system for the scope defined by the current thread.

Throws:
LoginCanceledException
java.lang.SecurityException

setCurrentUserInfo

public static void setCurrentUserInfo(UserInfo userInfo)
Sets the UserInfo object that defines the current user in the system. This is done locally for the current thread but will be inherited by future threads created by the origin thread.

setDefaultUserInfo

public static void setDefaultUserInfo(UserInfo userInfo)
Sets the default UserInfo object that will be used as the UserInfo object for all threads that has not had another info explicitly set.

The UserInfo object will also be inherited by future threads created in the calling thread or any of its unmodified child threads.


copyFrom

public void copyFrom(UserInfo userInfo)

getUserID

public abstract java.lang.String getUserID()
Access method that returns the user ID defined by the user info object.


getSessionID

public abstract int getSessionID()
Returns the session ID defined by the user info object.


setCurrentUserID

public abstract void setCurrentUserID(java.lang.String userID)
Mutation method that sets the user ID defined by the user info object.


setSessionID

public abstract void setSessionID(int sessionID)
Sets the session ID defined by the user info object.


getProperty

public abstract java.lang.Object getProperty(java.lang.String name)
Access nethod that returns a named property value from the called user info object. Returns null if the name could not be identified.


getProperty

public abstract java.lang.Object getProperty(java.lang.String name,
                                             java.lang.Object defaultValue)
Access nethod that returns a named property value from the called user info object. Returns the default value if the name could not be identified.


setProperty

public abstract void setProperty(java.lang.String name,
                                 java.lang.Object value)
Updates the named property with provided value. All property data in a UserInfo object should implement ISerializable.


getPropertyNames

public abstract java.util.Enumeration getPropertyNames()

logout

public abstract void logout()


Copyright © 2005 Caleigo. All Rights Reserved.