All Implemented Interfaces:
IDisposableScope, IInternalSessionScope, IPortalMessageScope, IPortalScope, ISessionLifecycle, ISessionScope, Serializable

public class SessionScope extends PortalMessageScope implements IInternalSessionScope
This class implements the ISessionScope interface and is used to store session wide attributes.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • SessionScope

      public SessionScope(Channel channel)
      Constructs the session scope with the roles and channel.
      Parameters:
      channel - Optional parameter containing the channel of the current user.
  • Method Details

    • setCurrentFlowState

      public void setCurrentFlowState(IFlowState state)
      Specified by:
      setCurrentFlowState in interface IInternalSessionScope
    • getCurrentFlowState

      public IFlowState getCurrentFlowState()
      Description copied from interface: ISessionScope
      Returns the current flow state N.B. We recommend one does not use this method in services and containers.
      Specified by:
      getCurrentFlowState in interface ISessionScope
      Returns:
      A flowstate
    • getActiveChannel

      public Channel getActiveChannel()
      Description copied from interface: ISessionScope
      This functions returns the current active channel if there is a channel active, otherwise when no channel is active null is returned.
      Specified by:
      getActiveChannel in interface ISessionScope
      Returns:
      The current active channel.
    • getActiveUser

      public IUserData getActiveUser()
      Description copied from interface: ISessionScope
      This function returns the current active user for the current session.
      Specified by:
      getActiveUser in interface ISessionScope
      Returns:
      The current active user, never null.
    • setUser

      public void setUser(IUserData user)
      Description copied from interface: ISessionScope
      This method will set the user for the current session. The existing user information will be discarded.
      Specified by:
      setUser in interface ISessionScope
      Parameters:
      user - The user, may not be null.
    • getTestPath

      public String getTestPath()
      Description copied from interface: ISessionScope
      This function returns the testPath for the current session.
      Specified by:
      getTestPath in interface ISessionScope
      Returns:
      The testPath for the current session
    • setTestPath

      public void setTestPath(String testPath)
      Description copied from interface: ISessionScope
      This method will set the testPath for the current session. The existing testPath will be discarded.
      Specified by:
      setTestPath in interface ISessionScope
      Parameters:
      testPath - The testpath, may be null.
    • notifyPortalMessage

      public void notifyPortalMessage(IPortalMessage message)
      Description copied from interface: ISessionScope
      Notifies a portal message after the current event has been processed.
      Specified by:
      notifyPortalMessage in interface ISessionScope
      Parameters:
      message - The portalmessage, not null.
    • getPendingPortalMessages

      public IPortalMessage[] getPendingPortalMessages()
      Description copied from interface: ISessionScope
      Retrieves the currently pending portal messages to process.
      Specified by:
      getPendingPortalMessages in interface ISessionScope
      Returns:
      The portalmessages, not null.
    • removePendingPortalMessages

      public IPortalMessage[] removePendingPortalMessages()
      Description copied from interface: ISessionScope
      Retrieves and clears the currently pending portal messages to process.
      Specified by:
      removePendingPortalMessages in interface ISessionScope
      Returns:
      The portal messages, not null.
    • clearPendingPortalMessages

      public void clearPendingPortalMessages()
      Description copied from interface: ISessionScope
      Clears all currently pending portal messages.
      Specified by:
      clearPendingPortalMessages in interface ISessionScope
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getType

      public PortalScopeType getType()
      Description copied from interface: IPortalScope
      This method will return the scope type of the portal scope implementation.
      Specified by:
      getType in interface IPortalScope
      Returns:
      The current scope type.
    • activate

      public void activate(ISessionActivationContext sessionActivationContext)
      Description copied from interface: ISessionLifecycle
      This method may be used for activating the objects after deserialization.
      Specified by:
      activate in interface ISessionLifecycle
      Parameters:
      sessionActivationContext - the current session activation context.
    • passivate

      public void passivate()
      Description copied from interface: ISessionLifecycle
      This method may be used for preparing the objects for serialization.
      Specified by:
      passivate in interface ISessionLifecycle