wt.session
Class StandardSessionManager

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.session.StandardSessionManager
All Implemented Interfaces:
Manager, NetFactor, Serializable, SessionManager, SessionManagerSvr

public class StandardSessionManager
extends StandardManager
implements SessionManager, SessionManagerSvr, Serializable

Standard implementation of the SessionManager interface.

Use the newStandardSessionManager static factory method(s), not the StandardSessionManager constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String administratorDn
           
private static boolean AUTH_TO_LOWER_CASE
           
private static boolean CASE_SENSITIVE
           
private static String CLASSNAME
           
private static boolean CLIENT_AUTHENTICATED_LOGIN
           
private static String ENFORCE_KEY
           
private static DirectoryContextProvider exchangeContext
           
private static boolean GET_PRINCIPAL_VERBOSE
           
private static String PRINCIPAL_KEY
           
private static String RESOURCE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.session.SessionManager
ACCEPT_LANGUAGE
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardSessionManager()
           
 
Method Summary
 void destroySessionContext(String prefix, String sessionId)
          Given prefix and sessionId of a SessionContext created via getContext(prefix,sessionId), find that session and destroy it.
 WTPrincipal getAdministrator()
          Returns the default administrator.
private  WTUser getAuthenticatedUser(String auth_name)
           
private  String getAuthenticationName()
           
 String getConceptualClassname()
          Deprecated.  
private  DirectoryContextProvider getExchangeContext()
           
 Vector getLanguagePreference()
          

Supported API: false
 Locale getLocale()
          

Supported API: false
 WTPrincipal getPrincipal()
          Retrieves current principal.
 WTPrincipalReference getPrincipalReference()
          Retrieves a reference to the current principal.
private  WTUser getUser(String name)
           
 boolean isAccessEnforced()
          Returns true if access control was not reset through a 'setAccessEnforced (false)' call; returns false otherwise.
static StandardSessionManager newStandardSessionManager()
          Default factory for the class.
private  boolean realUserIsAdministrator()
           
 WTUser refreshPrincipal()
          Refreshes principal stored in the SessionContext cache.
 boolean setAccessEnforced(boolean enforce)
          Suspends or resumes access control enforcement.
 WTPrincipal setAdministrator()
          Sets the default administrator as the current principal.
 void setAuthenticatedPrincipal(String web_name)
          Set the current principal given its web server authentication id.
 WTPrincipal setPrincipal(String name)
          Sets the current principal given the principal's name.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, performStartupProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

administratorDn

private static String administratorDn

exchangeContext

private static DirectoryContextProvider exchangeContext

PRINCIPAL_KEY

private static final String PRINCIPAL_KEY
See Also:
Constant Field Values

CLIENT_AUTHENTICATED_LOGIN

private static final boolean CLIENT_AUTHENTICATED_LOGIN

CASE_SENSITIVE

private static final boolean CASE_SENSITIVE

AUTH_TO_LOWER_CASE

private static final boolean AUTH_TO_LOWER_CASE

ENFORCE_KEY

private static final String ENFORCE_KEY
See Also:
Constant Field Values

GET_PRINCIPAL_VERBOSE

private static final boolean GET_PRINCIPAL_VERBOSE
Constructor Detail

StandardSessionManager

public StandardSessionManager()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

newStandardSessionManager

public static StandardSessionManager newStandardSessionManager()
                                                        throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardSessionManager
Throws:
WTException

getPrincipal

public WTPrincipal getPrincipal()
                         throws WTException
Retrieves current principal.

Supported API: true

Specified by:
getPrincipal in interface SessionManager
Returns:
WTPrincipal
Throws:
WTException

getPrincipalReference

public WTPrincipalReference getPrincipalReference()
                                           throws WTException
Retrieves a reference to the current principal.

Supported API: true

Specified by:
getPrincipalReference in interface SessionManager
Returns:
WTPrincipalReference
Throws:
WTException

setPrincipal

public WTPrincipal setPrincipal(String name)
                         throws WTException
Sets the current principal given the principal's name. Throws 'UserNotFoundexception' if principal can't be found.

This method is accessible at the client only when the wt.session.clientAuthenticatedLogin is set to false in wt.properties or the current principal is part of the administrators group.

Supported API: true

Specified by:
setPrincipal in interface SessionManager
Parameters:
name -
Returns:
WTPrincipal
Throws:
WTException

setAdministrator

public WTPrincipal setAdministrator()
                             throws WTException
Sets the default administrator as the current principal.

This method is accessible at the client only when the wt.session.clientAuthenticatedLogin is set to false in wt.properties or the current principal is part of the administrators group.

Supported API: true

Specified by:
setAdministrator in interface SessionManager
Returns:
WTPrincipal
Throws:
WTException

getAdministrator

public WTPrincipal getAdministrator()
                             throws WTException
Returns the default administrator.

Supported API: true

Specified by:
getAdministrator in interface SessionManager
Returns:
WTPrincipal
Throws:
WTException

setAuthenticatedPrincipal

public void setAuthenticatedPrincipal(String web_name)
                               throws WTException
Set the current principal given its web server authentication id. Throws 'UserNotFoundException' if principal can't be found.

Supported API: true

Specified by:
setAuthenticatedPrincipal in interface SessionManager
Parameters:
web_name -
Throws:
WTException

getLocale

public Locale getLocale()
                 throws WTException


Supported API: false

Specified by:
getLocale in interface SessionManager
Returns:
Locale
Throws:
WTException

getLanguagePreference

public Vector getLanguagePreference()
                             throws WTException


Supported API: false

Specified by:
getLanguagePreference in interface SessionManager
Returns:
Vector
Throws:
WTException

destroySessionContext

public void destroySessionContext(String prefix,
                                  String sessionId)
                           throws WTException
Given prefix and sessionId of a SessionContext created via getContext(prefix,sessionId), find that session and destroy it.

This is intended for use from the servlet engine to allow the Windchill SessionContext to be destroyed when the servlet session is destroyed to release objects more quickly in some cases.

Supported API: false

Specified by:
destroySessionContext in interface SessionManager
Parameters:
prefix - used guarentee uniqueness to the key
sessionId - session id of the JSP/Servlet engine calling the method server
Throws:
WTException

setAccessEnforced

public boolean setAccessEnforced(boolean enforce)
Suspends or resumes access control enforcement. If the argument is false then access control enforcement is suspended; otherwise it is resumed. This only happens if wt.access.enforce property is set to true (if it is set to false access control is never enforced). The method returns true if the access control was being enforced or false otherwise.

This method can be used to temporarily suspend access control enforcement using a try/finally block, in which the enforcement is suspended in the try block and restored in the finally block. The return value can be used to restore the value to whatever it was before the enforcement was suspended.

Supported API: true

Specified by:
setAccessEnforced in interface SessionManagerSvr
Parameters:
enforce -
Returns:
boolean

isAccessEnforced

public boolean isAccessEnforced()
Returns true if access control was not reset through a 'setAccessEnforced (false)' call; returns false otherwise. The isAccessEnforced retrieves the state of access enforcement as set or reset by the setAccessEnforced method. It has no visibility to the wt.access.enforce property (in wt.properties).

Supported API: true

Specified by:
isAccessEnforced in interface SessionManagerSvr
Returns:
boolean

refreshPrincipal

public WTUser refreshPrincipal()
                        throws WTException
Refreshes principal stored in the SessionContext cache. Returns refreshed principal if it exists, null otherwise.

Supported API: false

Specified by:
refreshPrincipal in interface SessionManagerSvr
Returns:
WTUser
Throws:
WTException

getUser

private WTUser getUser(String name)
                throws WTException
Throws:
WTException

getAuthenticatedUser

private WTUser getAuthenticatedUser(String auth_name)
                             throws WTException
Throws:
WTException

getExchangeContext

private DirectoryContextProvider getExchangeContext()
                                             throws WTException
Throws:
WTException

realUserIsAdministrator

private boolean realUserIsAdministrator()
                                 throws WTException
Throws:
WTException

getAuthenticationName

private String getAuthenticationName()