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 Summary
ConstructorsConstructorDescriptionUpstreamClusterModel(TargetCluster targetCluster, Optional<io.netty.handler.ssl.SslContext> upstreamSslContext, TlsCredentialSupplierManager tlsManager) Creates an instance of aUpstreamClusterModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic UpstreamClusterModelbuild(TargetCluster targetCluster, PluginFactoryRegistry pfr) Builds a fully-resolvedUpstreamClusterModelfor the given target cluster, constructing the SSL context and TLS credential supplier manager from the cluster's TLS configuration.voidclose()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thetargetClusterrecord component.Optional<io.kroxylicious.proxy.config.tls.Tls> tls()Returns the value of thetlsManagerrecord component.final StringtoString()Returns a string representation of this record class.Optional<io.netty.handler.ssl.SslContext> Returns the value of theupstreamSslContextrecord component.boolean
-
Constructor Details
-
UpstreamClusterModel
public UpstreamClusterModel(TargetCluster targetCluster, Optional<io.netty.handler.ssl.SslContext> upstreamSslContext, TlsCredentialSupplierManager tlsManager) Creates an instance of aUpstreamClusterModelrecord class.- Parameters:
targetCluster- the value for thetargetClusterrecord componentupstreamSslContext- the value for theupstreamSslContextrecord componenttlsManager- the value for thetlsManagerrecord component
-
-
Method Details
-
tls
-
bootstrapServersList
-
bootstrapServer
-
usesDynamicTlsCredentials
public boolean usesDynamicTlsCredentials() -
requiresTls
public boolean requiresTls() -
build
public static UpstreamClusterModel build(TargetCluster targetCluster, @Nullable PluginFactoryRegistry pfr) Builds a fully-resolvedUpstreamClusterModelfor 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:
closein interfaceAutoCloseable
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
targetCluster
Returns the value of thetargetClusterrecord component.- Returns:
- the value of the
targetClusterrecord component
-
upstreamSslContext
Returns the value of theupstreamSslContextrecord component.- Returns:
- the value of the
upstreamSslContextrecord component
-
tlsManager
Returns the value of thetlsManagerrecord component.- Returns:
- the value of the
tlsManagerrecord component
-