public static class ClientOptions.ClientOptionsBuilder extends Object
ClientOptions
objects.Modifier and Type | Method and Description |
---|---|
ClientOptions |
build() |
ClientOptions.ClientOptionsBuilder |
setCredentials(String user,
String password)
Sets the credentials, that will be associated with the
NonBlockingClient object
returned by NonBlockingClient.create(String, ClientOptions, NonBlockingClientListener, Object) . |
ClientOptions.ClientOptionsBuilder |
setId(String id)
Sets a client identifier, that will be associated with the
NonBlockingClient object
returned by NonBlockingClient.create(String, ClientOptions, NonBlockingClientListener, Object) . |
ClientOptions.ClientOptionsBuilder |
setSslTrustCertificate(File certificateFile)
Specifies a X.509 certificate chain file for SSL/TLS certificates
that the client will trust.
|
ClientOptions.ClientOptionsBuilder |
setSslVerifyName(boolean verifyName)
Determines whether the client validates that the CN name of the server's certificate
matches its DNS name.
|
public ClientOptions.ClientOptionsBuilder setId(String id) throws IllegalArgumentException
NonBlockingClient
object
returned by NonBlockingClient.create(String, ClientOptions, NonBlockingClientListener, Object)
.id
- a unique identifier for this client. If this is not set then the default is the string "AUTO_"
followed by a randomly chosen 7 digit hex value (with hex characters lowercase). A maximum of one
instance of the client (as identified by the value of this parameter) can be connected the an
MQ Light server at a given point in time. If another instance of the same client connects, then
the previously connected instance will be disconnected. This is reported, to the first client,
as a ReplacedException, and the client transitioning into stopped state.
When set, the id must be a minimum of 1 character and a maximum of 256 characters in length.
The id can only contain alphanumeric characters, and any of the following characters:
percent sign (%), slash (/), period (.), underscore (_).ClientOptionsBuilder
that this method was invoked on.IllegalArgumentException
- if an invalid id
value is specified.public ClientOptions.ClientOptionsBuilder setCredentials(String user, String password)
NonBlockingClient
object
returned by NonBlockingClient.create(String, ClientOptions, NonBlockingClientListener, Object)
.
If these values are not set (or both values are set to null
then the client will attempt
to use the SASL ANNONYMOUS mechanism when it connects to the MQ Light server.user
- the user name that the client will identify itself using.password
- the password that the client will use to authenticate itself.ClientOptionsBuilder
that this method was invoked on.public ClientOptions.ClientOptionsBuilder setSslTrustCertificate(File certificateFile)
certificateFile
- a trust store that contains SSL/TLS certificates that the
client is to trust. If this is not set (or is set to null)
then the client will use the set of trusted certificates
supplied with the JVM.ClientOptionsBuilder
that
this method was invoked on.public ClientOptions.ClientOptionsBuilder setSslVerifyName(boolean verifyName)
verifyName
- should the client validate the server's CN name? If this method is
not called, the default is to behave as if this method was called
with a value of true
.ClientOptionsBuilder
that this method was invoked on.public ClientOptions build()
ClientOptions
object, built using the various
settings of this ClientOptionsBuilder
class at the point this method
is invoked.Copyright © 2015 International Business Machines Corporation. All rights reserved.