Class AuthenticationConfigurationBuilder
- java.lang.Object
-
- org.infinispan.client.hotrod.configuration.AbstractConfigurationChildBuilder
-
- org.infinispan.client.hotrod.configuration.AbstractSecurityConfigurationChildBuilder
-
- org.infinispan.client.hotrod.configuration.AuthenticationConfigurationBuilder
-
- All Implemented Interfaces:
ConfigurationChildBuilder
,Builder<AuthenticationConfiguration>
public class AuthenticationConfigurationBuilder extends AbstractSecurityConfigurationChildBuilder implements Builder<AuthenticationConfiguration>
AuthenticationConfigurationBuilder.- Since:
- 7.0
- Author:
- Tristan Tarrant
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_MECHANISM
static String
DEFAULT_REALM
static String
DEFAULT_SERVER_NAME
-
Constructor Summary
Constructors Constructor Description AuthenticationConfigurationBuilder(SecurityConfigurationBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationConfigurationBuilder
callbackHandler(CallbackHandler callbackHandler)
Specifies aCallbackHandler
to be used during the authentication handshake.AuthenticationConfigurationBuilder
clientSubject(Subject clientSubject)
Sets the client subject, necessary for those SASL mechanisms which require it to access client credentials (i.e.AuthenticationConfiguration
create()
Create the configuration beanAuthenticationConfigurationBuilder
disable()
Disables authenticationAuthenticationConfigurationBuilder
enable()
Enables authenticationAuthenticationConfigurationBuilder
enabled(boolean enabled)
Configures whether authentication should be enabled or notAuthenticationConfigurationBuilder
password(char[] password)
Specifies the password to be used for authentication.AuthenticationConfigurationBuilder
password(String password)
Specifies the password to be used for authentication.Builder<?>
read(AuthenticationConfiguration template)
Reads the configuration from an already created configuration bean into this builder.AuthenticationConfigurationBuilder
realm(String realm)
Specifies the realm to be used for authentication.AuthenticationConfigurationBuilder
saslMechanism(String saslMechanism)
Selects the SASL mechanism to use for the connection to the server.AuthenticationConfigurationBuilder
saslProperties(Map<String,String> saslProperties)
Sets the SASL properties.AuthenticationConfigurationBuilder
saslQop(SaslQop... qop)
Sets the SASL QOP property.AuthenticationConfigurationBuilder
saslStrength(SaslStrength... strength)
Sets the SASL strength property.AuthenticationConfigurationBuilder
serverName(String serverName)
Sets the name of the server as expected by the SASL protocol Setting this property also implicitly enables authentication (seeenable()
This defaults toDEFAULT_SERVER_NAME
.AuthenticationConfigurationBuilder
token(String token)
AuthenticationConfigurationBuilder
username(String username)
Specifies the username to be used for authentication.void
validate()
Validate the data in this builder before building the configuration beanConfigurationBuilder
withProperties(Properties properties)
Configures this builder using the specified properties.-
Methods inherited from class org.infinispan.client.hotrod.configuration.AbstractSecurityConfigurationChildBuilder
authentication, ssl
-
Methods inherited from class org.infinispan.client.hotrod.configuration.AbstractConfigurationChildBuilder
addCluster, addContextInitializer, addContextInitializer, addContextInitializers, addJavaSerialWhiteList, addServer, addServers, asyncExecutorFactory, balancingStrategy, balancingStrategy, balancingStrategy, balancingStrategy, batchSize, build, classLoader, clientIntelligence, connectionPool, connectionTimeout, consistentHashImpl, consistentHashImpl, forceReturnValues, keySizeEstimate, marshaller, marshaller, marshaller, maxRetries, protocolVersion, remoteCache, security, socketTimeout, statistics, tcpKeepAlive, tcpNoDelay, transaction, uri, uri, valueSizeEstimate, version
-
-
-
-
Field Detail
-
DEFAULT_REALM
public static final String DEFAULT_REALM
- See Also:
- Constant Field Values
-
DEFAULT_SERVER_NAME
public static final String DEFAULT_SERVER_NAME
- See Also:
- Constant Field Values
-
DEFAULT_MECHANISM
public static final String DEFAULT_MECHANISM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AuthenticationConfigurationBuilder
public AuthenticationConfigurationBuilder(SecurityConfigurationBuilder builder)
-
-
Method Detail
-
callbackHandler
public AuthenticationConfigurationBuilder callbackHandler(CallbackHandler callbackHandler)
Specifies aCallbackHandler
to be used during the authentication handshake. TheCallback
s that need to be handled are specific to the chosen SASL mechanism.
-
enabled
public AuthenticationConfigurationBuilder enabled(boolean enabled)
Configures whether authentication should be enabled or not
-
enable
public AuthenticationConfigurationBuilder enable()
Enables authentication
-
disable
public AuthenticationConfigurationBuilder disable()
Disables authentication
-
saslMechanism
public AuthenticationConfigurationBuilder saslMechanism(String saslMechanism)
Selects the SASL mechanism to use for the connection to the server. Setting this property also implicitly enables authentication (seeenable()
-
saslProperties
public AuthenticationConfigurationBuilder saslProperties(Map<String,String> saslProperties)
Sets the SASL properties. Setting this property also implicitly enables authentication (seeenable()
-
saslQop
public AuthenticationConfigurationBuilder saslQop(SaslQop... qop)
Sets the SASL QOP property. If multiple values are specified they will determine preference order. Setting this property also implicitly enables authentication (seeenable()
-
saslStrength
public AuthenticationConfigurationBuilder saslStrength(SaslStrength... strength)
Sets the SASL strength property. If multiple values are specified they will determine preference order. Setting this property also implicitly enables authentication (seeenable()
-
serverName
public AuthenticationConfigurationBuilder serverName(String serverName)
Sets the name of the server as expected by the SASL protocol Setting this property also implicitly enables authentication (seeenable()
This defaults toDEFAULT_SERVER_NAME
.
-
clientSubject
public AuthenticationConfigurationBuilder clientSubject(Subject clientSubject)
Sets the client subject, necessary for those SASL mechanisms which require it to access client credentials (i.e. GSSAPI). Setting this property also implicitly enables authentication (seeenable()
-
username
public AuthenticationConfigurationBuilder username(String username)
Specifies the username to be used for authentication. This will use a simple CallbackHandler. This is mutually exclusive with explicitly providing the CallbackHandler. Setting this property also implicitly enables authentication (seeenable()
-
password
public AuthenticationConfigurationBuilder password(String password)
Specifies the password to be used for authentication. A username is also required. Setting this property also implicitly enables authentication (seeenable()
-
password
public AuthenticationConfigurationBuilder password(char[] password)
Specifies the password to be used for authentication. A username is also required. Setting this property also implicitly enables authentication (seeenable()
-
realm
public AuthenticationConfigurationBuilder realm(String realm)
Specifies the realm to be used for authentication. Username and password also need to be supplied. If none is specified, this defaults toDEFAULT_REALM
. Setting this property also implicitly enables authentication (seeenable()
-
token
public AuthenticationConfigurationBuilder token(String token)
-
create
public AuthenticationConfiguration create()
Description copied from interface:Builder
Create the configuration bean- Specified by:
create
in interfaceBuilder<AuthenticationConfiguration>
- Returns:
-
read
public Builder<?> read(AuthenticationConfiguration template)
Description copied from interface:Builder
Reads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
read
in interfaceBuilder<AuthenticationConfiguration>
- Parameters:
template
- the configuration from which to "clone" this config if needed.
-
validate
public void validate()
Description copied from interface:Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceBuilder<AuthenticationConfiguration>
-
withProperties
public ConfigurationBuilder withProperties(Properties properties)
Description copied from interface:ConfigurationChildBuilder
Configures this builder using the specified properties. SeeConfigurationBuilder
for a list.- Specified by:
withProperties
in interfaceConfigurationChildBuilder
- Overrides:
withProperties
in classAbstractConfigurationChildBuilder
-
-