Enum JmsConnectionExtensions
- java.lang.Object
-
- java.lang.Enum<JmsConnectionExtensions>
-
- org.apache.qpid.jms.JmsConnectionExtensions
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<JmsConnectionExtensions>
public enum JmsConnectionExtensions extends java.lang.Enum<JmsConnectionExtensions>
Connection Extensions DefinitionsConnection 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 Constants Enum Constant Description AMQP_OPEN_PROPERTIESAllows a user to inject custom properties into the AMQP Open performative that is sent after a successful remote connection has been made.HTTP_HEADERS_OVERRIDEAllows 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_OVERRIDEAllows 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_SUPPLIERAllows a user to inject a custom proxy handler supplier used when creating a transport for the connection.SSL_CONTEXTAllows a user to inject a custom SSL Context into the client which overrides the instance that the client would create and use.USERNAME_OVERRIDEAllows 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JmsConnectionExtensionsfromString(java.lang.String extensionName)java.lang.StringtoString()static JmsConnectionExtensionsvalueOf(java.lang.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.
-
-
-
Enum Constant Detail
-
SSL_CONTEXT
public static final JmsConnectionExtensions 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
public static final JmsConnectionExtensions 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
public static final JmsConnectionExtensions 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
public static final JmsConnectionExtensions 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
public static final JmsConnectionExtensions 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
public static final JmsConnectionExtensions 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 Detail
-
values
public static JmsConnectionExtensions[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (JmsConnectionExtensions c : JmsConnectionExtensions.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JmsConnectionExtensions valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<JmsConnectionExtensions>
-
fromString
public static JmsConnectionExtensions fromString(java.lang.String extensionName)
-
-