Enum Class SASLMechanism

java.lang.Object
java.lang.Enum<SASLMechanism>
com.isode.dsapi.SASLMechanism
All Implemented Interfaces:
Serializable, Comparable<SASLMechanism>, Constable

public enum SASLMechanism extends Enum<SASLMechanism>
Enum for holding various types of SASL mechanisms.
Since:
16.1
  • Enum Constant Details

  • Method Details

    • values

      public static SASLMechanism[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SASLMechanism valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSaslName

      public String getSaslName()
      Returns mechanism's SASL name.
      Returns:
      mechanism's SASL name (not null)
    • isSaslIDBased

      public boolean isSaslIDBased()
      Returns true when mechanism is based on SASL ID, false in other cases.
      Returns:
      true when mechanism is based on SASL ID.
    • getForSaslName

      public static SASLMechanism getForSaslName(String saslName)
      Get the enumerated value corresponding to the mechanism name.
      Parameters:
      saslName - (null allowed - will return null)
      Returns:
      the enumeration corresponding to the first of the mechanisms in sp, or null if there is no match
    • getForSaslNames

      public static EnumSet<SASLMechanism> getForSaslNames(String saslNames, boolean ignoreUnknown) throws BadValueException
      Returns set of known SASLMechanisms listed in space separated list of mechanism names.
      Parameters:
      saslNames - space separated list of mechanism names (null allowed will return empty set).
      ignoreUnknown - set to true will cause ignoring unknown mechanism names, false will cause throwing exception.
      Returns:
      set of SASLMechanisms (not null but may be empty)
      Throws:
      BadValueException - on unknown SASL mechanism name when ignoreUnknown is set to false
    • getForSaslNames

      public static EnumSet<SASLMechanism> getForSaslNames(String saslNames)
      Returns set of known SASLMechanisms listed in space separated list of mechanism names (unknown names are ignored).
      Parameters:
      saslNames - space separated list of mechanism names (null allowed will return empty set).
      Returns:
      set of SASLMechanisms (not null but may be empty)
    • getSaslIdBasedMechanisms

      public static EnumSet<SASLMechanism> getSaslIdBasedMechanisms(Iterable<SASLMechanism> mechanisms)
      Filters given mechanism to return SASL ID based only.
      Parameters:
      mechanisms - to be filtered (not null)
      Returns:
      SASL ID based only mechanisms (not null)
    • toString

      public static String toString(Iterable<SASLMechanism> mechanisms)
      Returns string representation of SASLMechanisms
      Parameters:
      mechanisms - (not null)
      Returns:
      string representation of SASLMechanisms (not null)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<SASLMechanism>