Interface NettyDaveFactory
- All Superinterfaces:
DaveFactory
Creates instances of NettyDecryptor and NettyEncryptor that support
direct operations on Netty ByteBuf for improved performance and reduced allocations.
Requirements: This requires io.netty:netty-buffer to be available on the classpath.
Loading any classes from this package without Netty will result in ClassNotFoundException.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfromDecryptor(Decryptor decryptor) Converts aDecryptorinto a Netty-enabledNettyDecryptor.fromEncryptor(Encryptor encryptor) Converts aEncryptorinto a Netty-enabledNettyEncryptor.Methods inherited from interface DaveFactory
createDecryptor, createEncryptor, createSession, maxSupportedProtocolVersion
-
Method Details
-
fromDecryptor
Converts aDecryptorinto a Netty-enabledNettyDecryptor.If the provided decryptor already supports Netty (implements
NettyDecryptor), it is returned unchanged. Otherwise, its internal state is transferred to a new Netty-enabled decryptor, and the original is closed.Note: After calling this method, the original decryptor is closed and should not be used.
- Parameters:
decryptor- A decryptor instance created by this factory.- Returns:
- A Netty-enabled decryptor.
- Throws:
IllegalArgumentException- if the decryptor was created by an incompatible factory.
-
fromEncryptor
Converts aEncryptorinto a Netty-enabledNettyEncryptor.If the provided encryptor already supports Netty (implements
NettyEncryptor), it is returned unchanged. Otherwise, its internal state is transferred to a new Netty-enabled encryptor, and the original is closed.Note: After calling this method, the original encryptor is closed and should not be used.
- Parameters:
encryptor- An encryptor instance created by this factory.- Returns:
- A Netty-enabled encryptor.
- Throws:
IllegalArgumentException- if the encryptor was created by an incompatible factory.
-