Class UserSessionIDCallback

java.lang.Object
de.aristaflow.adept2.base.security.callbacks.UserSessionIDCallback
All Implemented Interfaces:
Serializable, Callback

public class UserSessionIDCallback extends Object implements Callback, Serializable
A callback to retrieve user session IDs when using the combined authentication instead of the normal 2-part authentication. The user session ID is optional, therefore callback handler may ignore this callback or even throw an UnsupportedCallbackException.
Note that this callback may be used together with an OrgPositionChoiceCallback and therefore does not reflect the selection of the organisational position(s). It is not necessary to set a user session ID for all agents of this callback.
See Also:
  • Field Details

    • agents

      protected final List<QualifiedAgent> agents
      The agents for which to retrieve user session IDs.
    • sessionIDs

      protected final HashMap<QualifiedAgent,String> sessionIDs
      The session IDs indexed by the corresponding agent.
  • Constructor Details

    • UserSessionIDCallback

      public UserSessionIDCallback(List<QualifiedAgent> agents)
      Creates a new callback for retrieving user session IDs for session tokens for the designated agents.
      Parameters:
      agents - The agents for which to retrieve user session IDs.
  • Method Details

    • getAgents

      public List<QualifiedAgent> getAgents()
      Gets the QualifiedAgents for which to retrieve user session IDs. There need not be a user session ID for all of these agents, especially since this list does not reflect a previous selection of the organisational position(s).
      Returns:
      The agents for which to retrieve user session IDs.
    • setUserSessionID

      public void setUserSessionID(QualifiedAgent agent, String userSessionID)
      Sets the designated user session ID for the designated agent. The agent has to be one for which to retrieve a user session ID at all!
      Parameters:
      agent - The agent for which to set a user session ID.
      userSessionID - The user session ID for session tokens for the designated agent.
      Throws:
      IllegalArgumentException - If the designated agent is not one for which this callback tries to retrieve user session IDs, an IllegalArgumentException will be thrown.
    • getUserSessionID

      public String getUserSessionID(QualifiedAgent agent)
      Gets the user session ID for the designated agent or null if this callback does not provide a user session ID for the agent.
      Parameters:
      agent - The agent for which to retrieve a user session ID.
      Returns:
      The user session ID for the designated agent or null if this callback does not provide a user session ID for the agent.