wt.session
Class StandardSessionManager

java.lang.Object
  extended by wt.services.StandardManager
      extended by wt.session.StandardSessionManager
All Implemented Interfaces:
Serializable, NetFactor, wt.services.Manager, 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

Method Summary
 WTPrincipal getAdministrator()
          Returns the default administrator.
 WTPrincipal getPrincipal()
          Retrieves current principal.
 WTPrincipalReference getPrincipalReference()
          Retrieves a reference to the current principal.
 boolean isAccessEnforced()
          Returns true if access control was not reset through a 'setAccessEnforced (false)' call; returns false otherwise.
 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
getManagerService, getManagerStatus, getName, getStartupType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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

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