Enum JmsConnectionExtensions
- All Implemented Interfaces:
Serializable,Comparable<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 Summary
Enum ConstantsEnum ConstantDescriptionAllows a user to inject custom properties into the AMQP Open performative that is sent after a successful remote connection has been made.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.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.Allows a user to inject a custom proxy handler supplier used when creating a transport for the connection.Allows a user to inject a custom SSL Context into the client which overrides the instance that the client would create and use.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. -
Method Summary
Modifier and TypeMethodDescriptionstatic JmsConnectionExtensionsfromString(String extensionName) toString()static JmsConnectionExtensionsReturns 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.
-
Enum Constant Details
-
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.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>
-
-
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.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>
-
-
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.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>
-
-
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.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>
-
-
PROXY_HANDLER_SUPPLIER
Allows a user to inject a custom proxy handler supplier used when creating a transport for the connection.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>
-
-
AMQP_OPEN_PROPERTIES
Allows a user to inject custom properties into the AMQP Open performative that is sent after a successful remote connection has been made. The properties are injected by addingStringkeys andObjectvalues into aMapinstance and returning it. The value entries in the providedMapmust be valid AMQP primitive types that can be encoded to form a valid AMQP Open performative or an error will be thrown and the connection attempt will fail. If a user supplied property collides with an internal client specific property the client version is always given precedence.This method will be invoked on the initial connect and on each successive reconnect if a connection failures occurs and the client is configured to provide automatic reconnect support.
The extension function takes the form of a BiFunction defined as the following:
-
BiFunction<Connection,URI,Map>
-
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
toString
- Overrides:
toStringin classEnum<JmsConnectionExtensions>
-
fromString
-