Record Class UpstreamClusterModel

java.lang.Object
java.lang.Record
io.kroxylicious.proxy.internal.routing.UpstreamClusterModel
All Implemented Interfaces:
AutoCloseable

public record UpstreamClusterModel(TargetCluster targetCluster, Optional<io.netty.handler.ssl.SslContext> upstreamSslContext, TlsCredentialSupplierManager tlsManager) extends Record implements AutoCloseable
Runtime representation of an upstream Kafka cluster, bundling its connection target with the TLS resources needed to reach it. Owned by the RoutingModel implementation that holds it; closed via close() when the owning routing model is closed.
  • Constructor Details

    • UpstreamClusterModel

      public UpstreamClusterModel(TargetCluster targetCluster, Optional<io.netty.handler.ssl.SslContext> upstreamSslContext, TlsCredentialSupplierManager tlsManager)
      Creates an instance of a UpstreamClusterModel record class.
      Parameters:
      targetCluster - the value for the targetCluster record component
      upstreamSslContext - the value for the upstreamSslContext record component
      tlsManager - the value for the tlsManager record component
  • Method Details

    • tls

      public Optional<io.kroxylicious.proxy.config.tls.Tls> tls()
    • bootstrapServersList

      public List<HostPort> bootstrapServersList()
    • bootstrapServer

      public HostPort bootstrapServer()
    • usesDynamicTlsCredentials

      public boolean usesDynamicTlsCredentials()
    • requiresTls

      public boolean requiresTls()
    • build

      public static UpstreamClusterModel build(TargetCluster targetCluster, @Nullable PluginFactoryRegistry pfr)
      Builds a fully-resolved UpstreamClusterModel for the given target cluster, constructing the SSL context and TLS credential supplier manager from the cluster's TLS configuration.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • 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.
    • targetCluster

      public TargetCluster targetCluster()
      Returns the value of the targetCluster record component.
      Returns:
      the value of the targetCluster record component
    • upstreamSslContext

      public Optional<io.netty.handler.ssl.SslContext> upstreamSslContext()
      Returns the value of the upstreamSslContext record component.
      Returns:
      the value of the upstreamSslContext record component
    • tlsManager

      public TlsCredentialSupplierManager tlsManager()
      Returns the value of the tlsManager record component.
      Returns:
      the value of the tlsManager record component