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 anUnsupportedCallbackException
.
Note that this callback may be used together with anOrgPositionChoiceCallback
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<QualifiedAgent>
agents
The agents for which to retrieve user session IDs.protected HashMap<QualifiedAgent,String>
sessionIDs
The session IDs indexed by the corresponding agent.
-
Constructor Summary
Constructors Constructor Description UserSessionIDCallback(List<QualifiedAgent> agents)
Creates a new callback for retrieving user session IDs for session tokens for the designated agents.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<QualifiedAgent>
getAgents()
Gets theQualifiedAgent
s for which to retrieve user session IDs.String
getUserSessionID(QualifiedAgent agent)
Gets the user session ID for the designated agent ornull
if this callback does not provide a user session ID for the agent.void
setUserSessionID(QualifiedAgent agent, String userSessionID)
Sets the designated user session ID for the designated agent.
-
-
-
Field Detail
-
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 Detail
-
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 Detail
-
getAgents
public List<QualifiedAgent> getAgents()
Gets theQualifiedAgent
s 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, anIllegalArgumentException
will be thrown.
-
getUserSessionID
public String getUserSessionID(QualifiedAgent agent)
Gets the user session ID for the designated agent ornull
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.
-
-