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 of ChoiceCallback. Therefore make check for specific classes before checking for the superclass.
See Also:
  • Field Details

    • agents

      protected final List<QualifiedAgent> agents
      The QualifiedAgents that are choices of this callback.
  • Constructor Details

    • OrgPositionChoiceCallback

      public OrgPositionChoiceCallback(List<QualifiedAgent> agents, boolean multipleOrgPosAllowed)
      Creates a new ChoiceCallback for organisational positions (and thus also QualifiedAgents).
      Parameters:
      agents - The QualifiedAgents that are choices of this callback.
      multipleOrgPosAllowed - Whether multiple organisational positions are allowed.
  • Method Details

    • getAgents

      public List<QualifiedAgent> getAgents()
      Gets the QualifiedAgents 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 of QualifiedAgents 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.