Package org.apache.qpid.jms.transports
Class TransportSupport
- java.lang.Object
-
- org.apache.qpid.jms.transports.TransportSupport
-
public class TransportSupport extends java.lang.ObjectStatic class that provides various utility methods used by Transport implementations.
-
-
Constructor Summary
Constructors Constructor Description TransportSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.net.ssl.SSLContextcreateJdkSslContext(TransportOptions options)Create a new SSLContext using the options specific in the given TransportOptions instance.static javax.net.ssl.SSLEnginecreateJdkSslEngine(java.net.URI remote, javax.net.ssl.SSLContext context, TransportOptions options)Create a new JDK SSLEngine instance in client mode from the given SSLContext and TransportOptions instances.static io.netty.handler.ssl.SslContextcreateOpenSslContext(TransportOptions options)Create a new Netty SslContext using the options specific in the given TransportOptions instance.static javax.net.ssl.SSLEnginecreateOpenSslEngine(io.netty.buffer.ByteBufAllocator allocator, java.net.URI remote, io.netty.handler.ssl.SslContext context, TransportOptions options)Create a new OpenSSL SSLEngine instance in client mode from the given SSLContext and TransportOptions instances.static io.netty.handler.ssl.SslHandlercreateSslHandler(io.netty.buffer.ByteBufAllocator allocator, java.net.URI remote, TransportOptions options)Creates a Netty SslHandler instance for use in Transports that require an SSL encoder / decoder.static booleanisOpenSSLPossible(TransportOptions options)Determines if Netty OpenSSL support is available and applicable based on the configuration in the given TransportOptions instance.
-
-
-
Method Detail
-
isOpenSSLPossible
public static boolean isOpenSSLPossible(TransportOptions options)
Determines if Netty OpenSSL support is available and applicable based on the configuration in the given TransportOptions instance.- Parameters:
options- The configuration of the Transport being created.- Returns:
- true if OpenSSL support is available and usable given the requested configuration.
-
createSslHandler
public static io.netty.handler.ssl.SslHandler createSslHandler(io.netty.buffer.ByteBufAllocator allocator, java.net.URI remote, TransportOptions options) throws java.lang.ExceptionCreates a Netty SslHandler instance for use in Transports that require an SSL encoder / decoder. If the given options contain an SSLContext override, this will be used directly when creating the handler. If they do not, an SSLContext will first be created using the other option values.- Parameters:
allocator- The Netty Buffer Allocator to use when Netty resources need to be created.remote- The URI of the remote peer that the SslHandler will be used against.options- The SSL options object to build the SslHandler instance from.- Returns:
- a new SslHandler that is configured from the given options.
- Throws:
java.lang.Exception- if an error occurs while creating the SslHandler instance.
-
createJdkSslContext
public static javax.net.ssl.SSLContext createJdkSslContext(TransportOptions options) throws java.lang.Exception
Create a new SSLContext using the options specific in the given TransportOptions instance.- Parameters:
options- the configured options used to create the SSLContext.- Returns:
- a new SSLContext instance.
- Throws:
java.lang.Exception- if an error occurs while creating the context.
-
createJdkSslEngine
public static javax.net.ssl.SSLEngine createJdkSslEngine(java.net.URI remote, javax.net.ssl.SSLContext context, TransportOptions options) throws java.lang.ExceptionCreate a new JDK SSLEngine instance in client mode from the given SSLContext and TransportOptions instances.- Parameters:
remote- the URI of the remote peer that will be used to initialize the engine, may be null if none should.context- the SSLContext to use when creating the engine.options- the TransportOptions to use to configure the new SSLEngine.- Returns:
- a new SSLEngine instance in client mode.
- Throws:
java.lang.Exception- if an error occurs while creating the new SSLEngine.
-
createOpenSslContext
public static io.netty.handler.ssl.SslContext createOpenSslContext(TransportOptions options) throws java.lang.Exception
Create a new Netty SslContext using the options specific in the given TransportOptions instance.- Parameters:
options- the configured options used to create the SslContext.- Returns:
- a new SslContext instance.
- Throws:
java.lang.Exception- if an error occurs while creating the context.
-
createOpenSslEngine
public static javax.net.ssl.SSLEngine createOpenSslEngine(io.netty.buffer.ByteBufAllocator allocator, java.net.URI remote, io.netty.handler.ssl.SslContext context, TransportOptions options) throws java.lang.ExceptionCreate a new OpenSSL SSLEngine instance in client mode from the given SSLContext and TransportOptions instances.- Parameters:
allocator- the Netty ByteBufAllocator to use to create the OpenSSL engineremote- the URI of the remote peer that will be used to initialize the engine, may be null if none should.context- the Netty SslContext to use when creating the engine.options- the TransportOptions to use to configure the new SSLEngine.- Returns:
- a new Netty managed SSLEngine instance in client mode.
- Throws:
java.lang.Exception- if an error occurs while creating the new SSLEngine.
-
-