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 StringDEFAULT_MECHANISMstatic StringDEFAULT_REALMstatic StringDEFAULT_SERVER_NAME
-
Constructor Summary
Constructors Constructor Description AuthenticationConfigurationBuilder(SecurityConfigurationBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationConfigurationBuildercallbackHandler(CallbackHandler callbackHandler)Specifies aCallbackHandlerto be used during the authentication handshake.AuthenticationConfigurationBuilderclientSubject(Subject clientSubject)Sets the client subject, necessary for those SASL mechanisms which require it to access client credentials (i.e.AuthenticationConfigurationcreate()Create the configuration beanAuthenticationConfigurationBuilderdisable()Disables authenticationAuthenticationConfigurationBuilderenable()Enables authenticationAuthenticationConfigurationBuilderenabled(boolean enabled)Configures whether authentication should be enabled or notAuthenticationConfigurationBuilderpassword(char[] password)Specifies the password to be used for authentication.AuthenticationConfigurationBuilderpassword(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.AuthenticationConfigurationBuilderrealm(String realm)Specifies the realm to be used for authentication.AuthenticationConfigurationBuildersaslMechanism(String saslMechanism)Selects the SASL mechanism to use for the connection to the server.AuthenticationConfigurationBuildersaslProperties(Map<String,String> saslProperties)Sets the SASL properties.AuthenticationConfigurationBuildersaslQop(SaslQop... qop)Sets the SASL QOP property.AuthenticationConfigurationBuildersaslStrength(SaslStrength... strength)Sets the SASL strength property.AuthenticationConfigurationBuilderserverName(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.AuthenticationConfigurationBuildertoken(String token)AuthenticationConfigurationBuilderusername(String username)Specifies the username to be used for authentication.voidvalidate()Validate the data in this builder before building the configuration beanConfigurationBuilderwithProperties(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, 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 aCallbackHandlerto be used during the authentication handshake. TheCallbacks 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:BuilderCreate the configuration bean- Specified by:
createin interfaceBuilder<AuthenticationConfiguration>- Returns:
-
read
public Builder<?> read(AuthenticationConfiguration template)
Description copied from interface:BuilderReads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
readin interfaceBuilder<AuthenticationConfiguration>- Parameters:
template- the configuration from which to "clone" this config if needed.
-
validate
public void validate()
Description copied from interface:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<AuthenticationConfiguration>
-
withProperties
public ConfigurationBuilder withProperties(Properties properties)
Description copied from interface:ConfigurationChildBuilderConfigures this builder using the specified properties. SeeConfigurationBuilderfor a list.- Specified by:
withPropertiesin interfaceConfigurationChildBuilder- Overrides:
withPropertiesin classAbstractConfigurationChildBuilder
-
-