Record Class SslContextHolder

java.lang.Object
java.lang.Record
io.micronaut.http.netty.SslContextHolder
Record Components:
sslContext - TCP ssl context
quicSslContextObject - QUIC ssl context. Type Object to avoid native-image issues when the class is missing

@Internal public record SslContextHolder(@Nullable io.netty.handler.ssl.SslContext sslContext, @Nullable Object quicSslContextObject) extends Record
Holder for Netty SSL context instances for TCP (SslContext) and QUIC/HTTP3 (QuicSslContext). Manages Netty reference counting via retain() and release() to ensure contexts are safely shared and swapped.
Since:
4.10.0
Author:
Jonas Konrad
  • Constructor Details

    • SslContextHolder

      public SslContextHolder(@Nullable @Nullable io.netty.handler.ssl.SslContext sslContext, @Nullable @Nullable Object quicSslContextObject)
      Creates an instance of a SslContextHolder record class.
      Parameters:
      sslContext - the value for the sslContext record component
      quicSslContextObject - the value for the quicSslContextObject record component
  • Method Details

    • retain

      public void retain()
      Retain the underlying Netty contexts for safe reuse.
    • release

      public void release()
      Release the underlying Netty contexts when no longer needed.
    • quicSslContext

      public io.netty.handler.codec.quic.QuicSslContext quicSslContext()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sslContext

      @Nullable public @Nullable io.netty.handler.ssl.SslContext sslContext()
      Returns the value of the sslContext record component.
      Returns:
      the value of the sslContext record component
    • quicSslContextObject

      @Nullable public @Nullable Object quicSslContextObject()
      Returns the value of the quicSslContextObject record component.
      Returns:
      the value of the quicSslContextObject record component