Class SessionScopeDelegate

java.lang.Object
com.aquima.interactions.portal.model.session.scope.SessionScopeDelegate
All Implemented Interfaces:
IDisposableScope, IPortalMessageScope, IPortalScope, ISessionLifecycle, ISessionScope, Serializable
Direct Known Subclasses:
ReadonlySessionScope, SessionScopeWrapper

public abstract class SessionScopeDelegate extends Object implements ISessionScope
Utility class to allow for easy wrapping of a session scope implementation.
Since:
5.0
Author:
Jon van Leuven
See Also:
  • Constructor Details

    • SessionScopeDelegate

      protected SessionScopeDelegate(ISessionScope parent)
      Constructs the session scope with the object that needs to be wrapped.
      Parameters:
      parent - The session scope that needs to be wrapped by this delegate.
  • Method Details

    • 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.
    • 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
    • getAttributeNames

      public String[] getAttributeNames()
      Description copied from interface: IPortalScope
      This method returns an array containing all the names of the attribute that have a value in this scope.
      Specified by:
      getAttributeNames in interface IPortalScope
      Returns:
      array containing all the names of the attribute that have a value in this scope.
    • clearAttribute

      public Serializable clearAttribute(String key)
      Description copied from interface: IPortalScope
      This method will remove the value from the scope for the specified key, and returns the value that has been removed. When there is no value present for the specified key, the method invocation has no effect, and a null value will be returned.
      Specified by:
      clearAttribute in interface IPortalScope
      Parameters:
      key - Name of the attribute of which the value should be removed (mandatory).
      Returns:
      The value that was removed from the scope, or null when there was no value defined for the specified key.
    • getAttribute

      public Serializable getAttribute(String key)
      Description copied from interface: IPortalScope
      This method will return the value that has been added to this scope for the specified attribute key. When there is no value present for the specified key, a null value will be returned.
      Specified by:
      getAttribute in interface IPortalScope
      Parameters:
      key - Name of the attribute for which the value is requested (mandatory).
      Returns:
      The value for the specified key, or null when there is no value present.
    • hasAttribute

      public boolean hasAttribute(String key)
      Description copied from interface: IPortalScope
      This method will check if an attribute with the specified key has been added to this scope. The key name of the attribute is not case sensitive.
      Specified by:
      hasAttribute in interface IPortalScope
      Parameters:
      key - Name of the attribute that should be checked (mandatory).
      Returns:
      boolean indicating if a value is present for the specified attribute key.
    • setAttribute

      public Serializable setAttribute(String key, Serializable attrValue)
      Description copied from interface: IPortalScope
      This method will set the value in the scope under the specified key, and will return the value that might have been replaced by this action. When there was no value present for the specified key, a null value will be returned.
      Specified by:
      setAttribute in interface IPortalScope
      Parameters:
      key - Name of the attribute for which the value should be set (mandatory).
      attrValue - The value that should be set for the specified key (mandatory).
      Returns:
      The value that was replaced (previously present) by the set action.
    • 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.
    • destroyDisposableObjects

      public void destroyDisposableObjects(IDisposeContext context)
      Description copied from interface: IDisposableScope
      This method is called when the scope is discarded.
      Specified by:
      destroyDisposableObjects in interface IDisposableScope
    • getMappedPortalMessages

      public String[] getMappedPortalMessages()
      Description copied from interface: IPortalMessageScope
      Returns the portalMessages for which a mapping is defined.
      Specified by:
      getMappedPortalMessages in interface IPortalMessageScope
      Returns:
      The names of the mapped portal messages, not null.
    • setPortalMessageAction

      public void setPortalMessageAction(String portalMessage, PortalMessageAction action)
      Description copied from interface: IPortalMessageScope
      Sets the action to the specified portal message.
      Specified by:
      setPortalMessageAction in interface IPortalMessageScope
      Parameters:
      portalMessage - The portal message to map, not null or empty.
      action - The action to perform on the message, 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.
    • clearPortalMessageAction

      public void clearPortalMessageAction(String portalMessage)
      Description copied from interface: IPortalMessageScope
      Clears the current action to the specified portal message.
      Specified by:
      clearPortalMessageAction in interface IPortalMessageScope
      Parameters:
      portalMessage - The portal message to clear, not null or empty.
    • getPortalMessageAction

      public PortalMessageAction getPortalMessageAction(String portalMessage)
      Description copied from interface: IPortalMessageScope
      Returns the current action for the specified portal message.
      Specified by:
      getPortalMessageAction in interface IPortalMessageScope
      Parameters:
      portalMessage - The portal message to retrieve the action for, not null or empty.
      Returns:
      The current action.
    • 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.
    • clearPendingPortalMessages

      public void clearPendingPortalMessages()
      Description copied from interface: ISessionScope
      Clears all currently pending portal messages.
      Specified by:
      clearPendingPortalMessages in interface ISessionScope
    • 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
    • getSessionScope

      public ISessionScope getSessionScope()