public class AuthenticationFactory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addAuthentication(java.lang.String name,
java.lang.Class<? extends AuthenticationMechanism> auth)
Adds a new AuthenticationMechanism to the Factory.
|
AuthenticationMechanism |
getAuthentication(java.lang.String name)
Gets a new instance of the AuthenticationMechanism which implements the
specified SASL mechanism.
|
static AuthenticationFactory |
getInstance()
Gets the singleton instance of the AuthenticationFactory.
|
java.lang.String |
getSecurestMethod(java.lang.String authCapability)
Gets the securest supported SASL mechanism of the specified.
|
java.util.List<java.lang.String> |
getSupportedMechanisms()
Gets a List of the supported Mechanisms.
|
java.util.List<java.lang.String> |
getSupportedMechanisms(java.lang.String authCapa)
Gets a List of the supported Mechanisms from server and client.
|
boolean |
isSupported(java.lang.String mechanism)
Checks if the specified mechanism is supported by the Factory.
|
public static AuthenticationFactory getInstance()
public void addAuthentication(java.lang.String name, java.lang.Class<? extends AuthenticationMechanism> auth)
name
- the SASL registered name of the mechanismauth
- the implementation of the SASL mechanismpublic AuthenticationMechanism getAuthentication(java.lang.String name) throws NoSuchAuthenticationException
name
- the SASL registered name of the mechanismNoSuchAuthenticationException
- if no implementation of the specified mechanism can be foundpublic boolean isSupported(java.lang.String mechanism)
mechanism
- the SASL name of the mechanismpublic java.util.List<java.lang.String> getSupportedMechanisms()
public java.util.List<java.lang.String> getSupportedMechanisms(java.lang.String authCapa)
authCapa
- the CAPA response from a server.public java.lang.String getSecurestMethod(java.lang.String authCapability) throws NoSuchAuthenticationException
getSecurestMethod("DIGEST-MD5 LOGIN PLAIN")
returns "DIGEST-MD5".
authCapability
- a whitespace separated list of SASL mechanismsNoSuchAuthenticationException
Copyright © 2021. All Rights Reserved.