Enum VotingStrategy

  • All Implemented Interfaces:
    Serializable, Comparable<VotingStrategy>

    public enum VotingStrategy
    extends Enum<VotingStrategy>
    A voting strategy establishes what to do when different authorization results are produced during the evaluation of a permission over a protected resource. This is the case when the user is assigned with more than one user and/or group. In such case, different strategies can be applied in order to resolve what is the winning result.
    • Enum Constant Detail

      • AFFIRMATIVE

        public static final VotingStrategy AFFIRMATIVE
        It is the most lenient strategy. Only a single positive vote is required.
      • CONSENSUS

        public static final VotingStrategy CONSENSUS
        It is based on general agreement. It requires a majority of positive votes.
      • UNANIMOUS

        public static final VotingStrategy UNANIMOUS
        It is the less lenient strategy. It requires a 100% of positive votes.
      • PRIORITY

        public static final VotingStrategy PRIORITY
        It is based on role/group priorities. The highest priority result wins.
    • Method Detail

      • values

        public static VotingStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (VotingStrategy c : VotingStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static VotingStrategy valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null