Class NettyUtils
java.lang.Object
org.openehealth.ipf.commons.audit.NettyUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.netty.handler.ssl.SslContextinitSslContext(TlsParameters tlsParameters, boolean serverSide) static booleanstatic voidwriteAndAwait(io.netty.channel.Channel channel, byte[] bytes, long timeoutMillis, String host, int port) Writes the bytes to the channel and waits until they have been written.
-
Constructor Details
-
NettyUtils
public NettyUtils()
-
-
Method Details
-
initSslContext
public static io.netty.handler.ssl.SslContext initSslContext(TlsParameters tlsParameters, boolean serverSide) -
writeAndAwait
public static void writeAndAwait(io.netty.channel.Channel channel, byte[] bytes, long timeoutMillis, String host, int port) Writes the bytes to the channel and waits until they have been written. Other than a plainwriteAndFlush(...).await(...), which only tells whether the write has completed, a write that failed is reported as well, so that an audit message cannot get lost unnoticed.- Parameters:
channel- channel to write tobytes- bytes to writetimeoutMillis- maximum time to wait for the write to completehost- host of the Audit Record Repository, for error messagesport- port of the Audit Record Repository, for error messages- Throws:
AuditException- if writing has timed out, failed, or was interrupted- Since:
- 6.0
-
isMicrometerAvailable
public static boolean isMicrometerAvailable()- Returns:
- whether Micrometer is on the classpath, so that Reactor Netty metrics can be enabled
- Since:
- 6.0
-