Package org.apache.qpid.jms.sasl
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.qpid.jms.sasl.Mechanism
Mechanism.PRIORITY
-
-
Field Summary
Fields Modifier and Type Field Description protected static byte[]EMPTY
-
Constructor Summary
Constructors Constructor Description AbstractMechanism()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Mechanism other)StringgetPassword()Returns the configured password value for this Mechanism.StringgetUsername()Returns the configured user name value for this Mechanism.voidinit(Map<String,String> options)Perform any configuration initiation required by the mechanism.booleanisEnabledByDefault()Allows the mechanism to indicate if it is enabled by default, or only when explicitly enabled through configuring the permitted sasl mechanisms.voidsetPassword(String value)Sets the password value for this Mechanism.voidsetUsername(String value)Sets the user name value for this Mechanism.StringtoString()voidverifyCompletion()Verifies that the SASL exchange has completed successfully.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.qpid.jms.sasl.Mechanism
getAdditionalFailureInformation, getChallengeResponse, getInitialResponse, getName, getPriority, isApplicable
-
-
-
-
Method Detail
-
init
public void init(Map<String,String> options)
Description copied from interface:MechanismPerform any configuration initiation required by the mechanism.
-
verifyCompletion
public void verifyCompletion() throws SaslExceptionDescription copied from interface:MechanismVerifies 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:
verifyCompletionin interfaceMechanism- Throws:
SaslException- if the outcome of the SASL exchange is not valid for this Mechanism
-
compareTo
public int compareTo(Mechanism other)
- Specified by:
compareToin interfaceComparable<Mechanism>
-
setUsername
public void setUsername(String value)
Description copied from interface:MechanismSets 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:
setUsernamein interfaceMechanism- Parameters:
value- The user name given.
-
getUsername
public String getUsername()
Description copied from interface:MechanismReturns the configured user name value for this Mechanism.- Specified by:
getUsernamein interfaceMechanism- Returns:
- the currently set user name value for this Mechanism.
-
setPassword
public void setPassword(String value)
Description copied from interface:MechanismSets 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:
setPasswordin interfaceMechanism- Parameters:
value- The user name given.
-
getPassword
public String getPassword()
Description copied from interface:MechanismReturns the configured password value for this Mechanism.- Specified by:
getPasswordin interfaceMechanism- Returns:
- the currently set password value for this Mechanism.
-
isEnabledByDefault
public boolean isEnabledByDefault()
Description copied from interface:MechanismAllows the mechanism to indicate if it is enabled by default, or only when explicitly enabled through configuring the permitted sasl mechanisms.- Specified by:
isEnabledByDefaultin interfaceMechanism- Returns:
- true if this Mechanism is enabled by default.
-
-