Record Class DirectRouting
java.lang.Object
java.lang.Record
io.kroxylicious.proxy.internal.routing.DirectRouting
- All Implemented Interfaces:
RoutingModel,AutoCloseable
public record DirectRouting(String routeName, UpstreamClusterModel upstreamCluster)
extends Record
implements RoutingModel
Routing model for a virtual cluster that forwards directly to a single, statically-configured
upstream Kafka cluster.
Owns the UpstreamClusterModel for that cluster and closes it when close() is called.
-
Constructor Summary
ConstructorsConstructorDescriptionDirectRouting(String routeName, TargetCluster targetCluster) Test-only constructor: creates a routing model with no TLS resources resolved.DirectRouting(String routeName, UpstreamClusterModel upstreamCluster) Creates an instance of aDirectRoutingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of therouteNamerecord component.static Stringfinal StringtoString()Returns a string representation of this record class.Returns the value of theupstreamClusterrecord component.upstreamClusterFor(String routeName) Returns theUpstreamClusterModelfor the given route name
-
Constructor Details
-
DirectRouting
Test-only constructor: creates a routing model with no TLS resources resolved. Production code should always supply a fully-builtUpstreamClusterModel. -
DirectRouting
Creates an instance of aDirectRoutingrecord class.- Parameters:
routeName- the value for therouteNamerecord componentupstreamCluster- the value for theupstreamClusterrecord component
-
-
Method Details
-
upstreamClusterFor
Description copied from interface:RoutingModelReturns theUpstreamClusterModelfor the given route name- Specified by:
upstreamClusterForin interfaceRoutingModel
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRoutingModel
-
routeName
-
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). -
routeName
Returns the value of therouteNamerecord component.- Returns:
- the value of the
routeNamerecord component
-
upstreamCluster
Returns the value of theupstreamClusterrecord component.- Returns:
- the value of the
upstreamClusterrecord component
-