Package io.netty.handler.ssl
Enum SslHandler.SslEngineType
- java.lang.Object
-
- java.lang.Enum<SslHandler.SslEngineType>
-
- io.netty.handler.ssl.SslHandler.SslEngineType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<SslHandler.SslEngineType>
- Enclosing class:
- SslHandler
private static enum SslHandler.SslEngineType extends java.lang.Enum<SslHandler.SslEngineType>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ByteToMessageDecoder.Cumulator
cumulator
When using JDKSSLEngine
, we useByteToMessageDecoder.MERGE_CUMULATOR
because it works only with oneByteBuffer
.(package private) boolean
wantsDirectBuffer
true
if and only ifSSLEngine
expects a direct buffer and so if a heap buffer is given will make an extra memory copy.
-
Constructor Summary
Constructors Modifier Constructor Description private
SslEngineType(boolean wantsDirectBuffer, ByteToMessageDecoder.Cumulator cumulator)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract ByteBuf
allocateWrapBuffer(SslHandler handler, ByteBufAllocator allocator, int pendingBytes, int numComponents)
(package private) abstract int
calculatePendingData(SslHandler handler, int guess)
(package private) static SslHandler.SslEngineType
forEngine(javax.net.ssl.SSLEngine engine)
(package private) abstract boolean
jdkCompatibilityMode(javax.net.ssl.SSLEngine engine)
(package private) abstract javax.net.ssl.SSLEngineResult
unwrap(SslHandler handler, ByteBuf in, int len, ByteBuf out)
static SslHandler.SslEngineType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static SslHandler.SslEngineType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TCNATIVE
public static final SslHandler.SslEngineType TCNATIVE
-
JDK
public static final SslHandler.SslEngineType JDK
-
-
Field Detail
-
wantsDirectBuffer
final boolean wantsDirectBuffer
true
if and only ifSSLEngine
expects a direct buffer and so if a heap buffer is given will make an extra memory copy.
-
cumulator
final ByteToMessageDecoder.Cumulator cumulator
When using JDKSSLEngine
, we useByteToMessageDecoder.MERGE_CUMULATOR
because it works only with oneByteBuffer
. When usingOpenSslEngine
, we can useByteToMessageDecoder.COMPOSITE_CUMULATOR
because it hasReferenceCountedOpenSslEngine.unwrap(ByteBuffer[], ByteBuffer[])
which works with multipleByteBuffer
s and which does not need to do extra memory copies.
-
-
Constructor Detail
-
SslEngineType
private SslEngineType(boolean wantsDirectBuffer, ByteToMessageDecoder.Cumulator cumulator)
-
-
Method Detail
-
values
public static SslHandler.SslEngineType[] 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 (SslHandler.SslEngineType c : SslHandler.SslEngineType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SslHandler.SslEngineType 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
-
forEngine
static SslHandler.SslEngineType forEngine(javax.net.ssl.SSLEngine engine)
-
unwrap
abstract javax.net.ssl.SSLEngineResult unwrap(SslHandler handler, ByteBuf in, int len, ByteBuf out) throws javax.net.ssl.SSLException
- Throws:
javax.net.ssl.SSLException
-
calculatePendingData
abstract int calculatePendingData(SslHandler handler, int guess)
-
jdkCompatibilityMode
abstract boolean jdkCompatibilityMode(javax.net.ssl.SSLEngine engine)
-
allocateWrapBuffer
abstract ByteBuf allocateWrapBuffer(SslHandler handler, ByteBufAllocator allocator, int pendingBytes, int numComponents)
-
-