public enum JmsConnectionExtensions extends Enum<JmsConnectionExtensions>
Connection Extensions all the user to apply functions that can override or update client configuration based on state in their own applications such as providing a custom SSLContext or updating an authentication token from an external provider on each attempt to connect to a remote.
The extensions take the form of a BiFunction<Connection, URI, Object> passed into the
ConnectionFactory using the JmsConnectionFactory.setExtension(String, BiFunction).
| Enum Constant and Description |
|---|
HTTP_HEADERS_OVERRIDE
Allows a user to inject a custom HTTP header into the client which overrides or
augments the values that the client would use to authenticate with the remote over
a WebSocket based connection.
|
PASSWORD_OVERRIDE
Allows a user to inject a custom password into the client which overrides
the instance that the client would use to authenticate with the remote.
|
PROXY_HANDLER_SUPPLIER
Allows a user to inject a custom proxy handler supplier used when creating a transport
for the connection.
|
SSL_CONTEXT
Allows a user to inject a custom SSL Context into the client which overrides
the instance that the client would create and use.
|
USERNAME_OVERRIDE
Allows a user to inject a custom user name into the client which overrides
the instance that the client would use to authenticate with the remote.
|
| Modifier and Type | Method and Description |
|---|---|
static JmsConnectionExtensions |
fromString(String extensionName) |
String |
toString() |
static JmsConnectionExtensions |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JmsConnectionExtensions[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JmsConnectionExtensions SSL_CONTEXT
Using this method overrides the effect of URI/System property configuration relating to the location/credentials/type of SSL key/trust stores and whether to trust all certificates or use a particular keyAlias.
The extension function takes the form of a BiFunction defined as the following:
BiFunction<Connection, URI, SSLContext>
public static final JmsConnectionExtensions USERNAME_OVERRIDE
Using this method overrides the effect of URI/ConnectionFactory configuration relating to the user name provided to the remote for authentication. This method will be invoked on each connection authentication attempt in the presence of a failover configuration.
The extension function takes the form of a BiFunction defined as the following:
BiFunction<Connection, URI, String>
public static final JmsConnectionExtensions PASSWORD_OVERRIDE
Using this method overrides the effect of URI/ConnectionFactory configuration relating to the password provided to the remote for authentication. This method will be invoked on each connection authentication attempt in the presence of a failover configuration.
The extension function takes the form of a BiFunction defined as the following:
BiFunction<Connection, URI, String>
public static final JmsConnectionExtensions HTTP_HEADERS_OVERRIDE
Using this method overrides the effect of URI/ConnectionFactory configuration relating to the HTTP headers provided to the remote for authentication. This method will be invoked on each connection authentication attempt in the presence of a failover configuration.
The extension function takes the form of a BiFunction defined as the following:
BiFunction<Connection, URI, Map>
public static final JmsConnectionExtensions PROXY_HANDLER_SUPPLIER
For example, for Netty based transports if a supplier was returned it would provide one of Nettys proxy handlers such as HttpProxyHandler, Socks4ProxyHandler, or Socks5ProxyHandler created with appropriate login configuration etc.
If the function returns a Supplier, it must supply a proxy handler when requested.
The extension function takes the form of a BiFunction defined as the following:
BiFunction<Connection, URI, Supplier>
public static JmsConnectionExtensions[] values()
for (JmsConnectionExtensions c : JmsConnectionExtensions.values()) System.out.println(c);
public static JmsConnectionExtensions valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String toString()
toString in class Enum<JmsConnectionExtensions>public static JmsConnectionExtensions fromString(String extensionName)
Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.