Keel 2.1RC2

org.keel.services.authentication
Interface UserEnvironment

All Known Implementing Classes:
DefaultUserEnvironment, TempUserEnvironment, TempUserEnvironment, TestUserEnvironment, TestUserEnvironment

public interface UserEnvironment

This is the interface implemented by services that contain the environment for the logged-in user. A DefaultUserEnvironment object is normally stored in the Context passed to Model objects, and may be used by the Model to provide environment information to other factories and services that it requires. It's purpose is to store information about the current user session (if there is one), including the currently selected database, the ID of the current user, and so forth.

Version:
$Revision: 1.4 $ $Date: 2004/04/04 23:21:36 $
Author:
Mike Nash, Shash Chatterjee Created on Jun 8, 2003

Field Summary
static java.lang.String ANONYMOUS_DOMAIN
           
static java.lang.String ANONYMOUS_GROUPNAME
           
static java.lang.String ANONYMOUS_LOGINNAME
           
static int ANONYMOUS_UID
          Constants identifying the "unknown" user in the not-logged-in state
static java.lang.String ANONYMOUS_USERDESC
           
static java.lang.String CONTEXT_KEY
          The key used to store the user env.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attributeName)
           
 java.lang.String getDomain()
          Get the DomainPrincipal
 java.util.List getGroups()
          Get the GroupPrincipals
 javax.security.auth.login.LoginContext getLoginContext()
          The login context in this env.
 java.lang.String getLoginName()
          Get the LoginPrincipal
 javax.security.auth.Subject getSubject()
          The JAAS subject from the login context
 int getUid()
          Get the UidPrincipal
 java.lang.String getUserDescrip()
          Get the UserDescripPrincipal
 void reset()
          Used by logout functions to reset the SUbject back to "anonymous"
 void setAttribute(java.lang.String attributeName, java.lang.Object attributeContents)
           
 void setLoginContext(javax.security.auth.login.LoginContext lc)
          After succsful login, store the login context for later use by at least the logout function.
 

Field Detail

CONTEXT_KEY

public static final java.lang.String CONTEXT_KEY
The key used to store the user env. in the request context

See Also:
Constant Field Values

ANONYMOUS_UID

public static final int ANONYMOUS_UID
Constants identifying the "unknown" user in the not-logged-in state

See Also:
Constant Field Values

ANONYMOUS_LOGINNAME

public static final java.lang.String ANONYMOUS_LOGINNAME
See Also:
Constant Field Values

ANONYMOUS_GROUPNAME

public static final java.lang.String ANONYMOUS_GROUPNAME
See Also:
Constant Field Values

ANONYMOUS_USERDESC

public static final java.lang.String ANONYMOUS_USERDESC
See Also:
Constant Field Values

ANONYMOUS_DOMAIN

public static final java.lang.String ANONYMOUS_DOMAIN
See Also:
Constant Field Values
Method Detail

setLoginContext

public void setLoginContext(javax.security.auth.login.LoginContext lc)
                     throws AuthorizationException
After succsful login, store the login context for later use by at least the logout function.

Parameters:
lc - The user's JAAS login context
Throws:
AuthorizationException

getLoginContext

public javax.security.auth.login.LoginContext getLoginContext()
                                                       throws AuthorizationException
The login context in this env.

Returns:
The login context
Throws:
AuthorizationException

getSubject

public javax.security.auth.Subject getSubject()
                                       throws AuthorizationException
The JAAS subject from the login context

Returns:
JAAS Subject
Throws:
AuthorizationException

getLoginName

public java.lang.String getLoginName()
                              throws AuthorizationException
Get the LoginPrincipal

Returns:
the login name
Throws:
AuthorizationException

getDomain

public java.lang.String getDomain()
                           throws AuthorizationException
Get the DomainPrincipal

Returns:
The Keel domain name
Throws:
AuthorizationException

getUserDescrip

public java.lang.String getUserDescrip()
                                throws AuthorizationException
Get the UserDescripPrincipal

Returns:
A description of the user
Throws:
AuthorizationException

getUid

public int getUid()
           throws AuthorizationException
Get the UidPrincipal

Returns:
The UID
Throws:
AuthorizationException

getGroups

public java.util.List getGroups()
                         throws AuthorizationException
Get the GroupPrincipals

Returns:
The list of groups user belongs to
Throws:
AuthorizationException

reset

public void reset()
           throws AuthorizationException
Used by logout functions to reset the SUbject back to "anonymous"

Throws:
AuthorizationException

setAttribute

public void setAttribute(java.lang.String attributeName,
                         java.lang.Object attributeContents)

getAttribute

public java.lang.Object getAttribute(java.lang.String attributeName)

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.