Class NettyUtils

java.lang.Object
org.openehealth.ipf.commons.audit.NettyUtils

public class NettyUtils extends Object
  • 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 plain writeAndFlush(...).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 to
      bytes - bytes to write
      timeoutMillis - maximum time to wait for the write to complete
      host - host of the Audit Record Repository, for error messages
      port - 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