Class OrgPositionChoiceCallback
- java.lang.Object
-
- javax.security.auth.callback.ChoiceCallback
-
- de.aristaflow.adept2.base.security.callbacks.OrgPositionChoiceCallback
-
- All Implemented Interfaces:
Serializable,Callback
public class OrgPositionChoiceCallback extends ChoiceCallback
A callback to choose the organisational position/the qualified agent when authenticating to allow for a combined authentication instead of the normal 2-part authentication.
When implementing a handler for this callback note that it is a subclass ofChoiceCallback. Therefore make check for specific classes before checking for the superclass.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<QualifiedAgent>agentsTheQualifiedAgents that are choices of this callback.
-
Constructor Summary
Constructors Constructor Description OrgPositionChoiceCallback(List<QualifiedAgent> agents, boolean multipleOrgPosAllowed)Creates a newChoiceCallbackfor organisational positions (and thus alsoQualifiedAgents).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSelection(QualifiedAgent agent)Adds the designated agent to the selection of this choice callback in case this agent is allowed.List<QualifiedAgent>getAgents()Gets theQualifiedAgents that are choices of this callback.protected static String[]getOrgPositions(List<QualifiedAgent> agents)Returns the names of the organisational positions of the designated list ofQualifiedAgents in the corresponding order.List<QualifiedAgent>getSelectedAgents()Gets the agents that are selected in the choice.long[]getSelectedOrgPositionIDs()Gets the IDs of the organisational positions that are selected in the choice.-
Methods inherited from class javax.security.auth.callback.ChoiceCallback
allowMultipleSelections, getChoices, getDefaultChoice, getPrompt, getSelectedIndexes, setSelectedIndex, setSelectedIndexes
-
-
-
-
Field Detail
-
agents
protected final List<QualifiedAgent> agents
TheQualifiedAgents that are choices of this callback.
-
-
Constructor Detail
-
OrgPositionChoiceCallback
public OrgPositionChoiceCallback(List<QualifiedAgent> agents, boolean multipleOrgPosAllowed)
Creates a newChoiceCallbackfor organisational positions (and thus alsoQualifiedAgents).- Parameters:
agents- TheQualifiedAgents that are choices of this callback.multipleOrgPosAllowed- Whether multiple organisational positions are allowed.
-
-
Method Detail
-
getAgents
public List<QualifiedAgent> getAgents()
Gets theQualifiedAgents that are choices of this callback.- Returns:
- The
QualifiedAgents (as unmodifiable list) that are choices of this callback.
-
addSelection
public void addSelection(QualifiedAgent agent)
Adds the designated agent to the selection of this choice callback in case this agent is allowed. If this callback does not allow for multiple selections, the agent replaces the previous selection.
If the designated agent is not allowed, it will just be ignored.- Parameters:
agent- The agent which to add to the selection of this choice callback in case it is allowed.
-
getSelectedOrgPositionIDs
public long[] getSelectedOrgPositionIDs()
Gets the IDs of the organisational positions that are selected in the choice.- Returns:
- The IDs of the organisational positions that are selected in the choice.
-
getSelectedAgents
public List<QualifiedAgent> getSelectedAgents()
Gets the agents that are selected in the choice.- Returns:
- The agents that are selected in the choice.
-
getOrgPositions
protected static String[] getOrgPositions(List<QualifiedAgent> agents)
Returns the names of the organisational positions of the designated list ofQualifiedAgents in the corresponding order. This is required for the constructor of the superclass.- Parameters:
agents- The agents from which to retrieve the names of the organisational positions.- Returns:
- The names of the organisational positions from the designated list
of
QualifiedAgents.
-
-