Class AbstractMechanism

java.lang.Object
org.apache.qpid.jms.sasl.AbstractMechanism
All Implemented Interfaces:
Comparable<Mechanism>, Mechanism
Direct Known Subclasses:
AnonymousMechanism, CramMD5Mechanism, ExternalMechanism, GssapiMechanism, PlainMechanism, ScramSHA1Mechanism, ScramSHA256Mechanism, ScramSHA512Mechanism, XOauth2Mechanism

public abstract class AbstractMechanism extends Object implements Mechanism
Base class for SASL Authentication Mechanism that implements the basic methods of a Mechanism class.
  • Field Details

    • EMPTY

      protected static final byte[] EMPTY
  • Constructor Details

    • AbstractMechanism

      public AbstractMechanism()
  • Method Details

    • init

      public void init(Map<String,String> options)
      Description copied from interface: Mechanism
      Perform any configuration initiation required by the mechanism.
      Specified by:
      init in interface Mechanism
      Parameters:
      options - An immutable map of sasl options. Will always be non-null.
    • verifyCompletion

      public void verifyCompletion() throws SaslException
      Description copied from interface: Mechanism
      Verifies that the SASL exchange has completed successfully. This is an opportunity for the mechanism to ensure that all mandatory steps have been completed successfully and to cleanup and resources that are held by this Mechanism.
      Specified by:
      verifyCompletion in interface Mechanism
      Throws:
      SaslException - if the outcome of the SASL exchange is not valid for this Mechanism
    • compareTo

      public int compareTo(Mechanism other)
      Specified by:
      compareTo in interface Comparable<Mechanism>
    • setUsername

      public void setUsername(String value)
      Description copied from interface: Mechanism
      Sets the user name value for this Mechanism. The Mechanism can ignore this value if it does not utilize user name in it's authentication processing.
      Specified by:
      setUsername in interface Mechanism
      Parameters:
      value - The user name given.
    • getUsername

      public String getUsername()
      Description copied from interface: Mechanism
      Returns the configured user name value for this Mechanism.
      Specified by:
      getUsername in interface Mechanism
      Returns:
      the currently set user name value for this Mechanism.
    • setPassword

      public void setPassword(String value)
      Description copied from interface: Mechanism
      Sets the password value for this Mechanism. The Mechanism can ignore this value if it does not utilize a password in it's authentication processing.
      Specified by:
      setPassword in interface Mechanism
      Parameters:
      value - The user name given.
    • getPassword

      public String getPassword()
      Description copied from interface: Mechanism
      Returns the configured password value for this Mechanism.
      Specified by:
      getPassword in interface Mechanism
      Returns:
      the currently set password value for this Mechanism.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isEnabledByDefault

      public boolean isEnabledByDefault()
      Description copied from interface: Mechanism
      Allows the mechanism to indicate if it is enabled by default, or only when explicitly enabled through configuring the permitted sasl mechanisms.
      Specified by:
      isEnabledByDefault in interface Mechanism
      Returns:
      true if this Mechanism is enabled by default.