Class OrgPositionChoiceCallback
java.lang.Object
javax.security.auth.callback.ChoiceCallback
de.aristaflow.adept2.base.security.callbacks.OrgPositionChoiceCallback
- All Implemented Interfaces:
Serializable,Callback
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 of
When implementing a handler for this callback note that it is a subclass of
ChoiceCallback. Therefore make check for specific classes before
checking for the superclass.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<QualifiedAgent>TheQualifiedAgents that are choices of this callback. -
Constructor Summary
ConstructorsConstructorDescriptionOrgPositionChoiceCallback(List<QualifiedAgent> agents, boolean multipleOrgPosAllowed) Creates a newChoiceCallbackfor organisational positions (and thus alsoQualifiedAgents). -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelection(QualifiedAgent agent) Adds the designated agent to the selection of this choice callback in case this agent is allowed.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.Gets the agents that are selected in the choice.long[]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 Details
-
agents
TheQualifiedAgents that are choices of this callback.
-
-
Constructor Details
-
OrgPositionChoiceCallback
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 Details
-
getAgents
Gets theQualifiedAgents that are choices of this callback.- Returns:
- The
QualifiedAgents (as unmodifiable list) that are choices of this callback.
-
addSelection
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
Gets the agents that are selected in the choice.- Returns:
- The agents that are selected in the choice.
-
getOrgPositions
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.
-