Interface EndpointGateway
- All Known Implementing Classes:
VirtualClusterModel.VirtualClusterGatewayModel
public interface EndpointGateway
A gateway to an endpoint.
-
Method Summary
Modifier and TypeMethodDescriptionMap of node ids to broker addresses.getAdvertisedBrokerAddress(int nodeId) Advertised address of broker with the given node id, (advertised hostname and advertised port).Bind address to be used for network binds.getBrokerAddress(int nodeId) Broker address for given nodeId.getBrokerIdFromBrokerAddress(HostPort brokerAddress) Generates the node id implied by the given broker address (advertised hostname and bind port).Bootstrap address.Optional<io.netty.handler.ssl.SslContext> booleanisUseTls()true if this listener uses TLS.name()Get the gateways namebooleanIndicates if the provider requires that connections utilise the Server Name Indication (SNI) extension to TLS.
-
Method Details
-
isUseTls
boolean isUseTls()true if this listener uses TLS.- Returns:
- true if listener uses TLS.
-
requiresServerNameIndication
boolean requiresServerNameIndication()Indicates if the provider requires that connections utilise the Server Name Indication (SNI) extension to TLS. If this is true, then the provider cannot support plain connections.- Returns:
- true if this provider requires Server Name Indication (SNI).
-
virtualCluster
VirtualClusterModel virtualCluster() -
getClusterBootstrapAddress
HostPort getClusterBootstrapAddress()Bootstrap address.- Returns:
- bootstrap address.
-
getBrokerAddress
Broker address for given nodeId.- Parameters:
nodeId- node id- Returns:
- broker address
- Throws:
IllegalArgumentException- address for given broker node cannot be generated.
-
getDownstreamSslContext
Optional<io.netty.handler.ssl.SslContext> getDownstreamSslContext() -
getAdvertisedBrokerAddress
Advertised address of broker with the given node id, (advertised hostname and advertised port). This is what is returned to clients and may differ from the node's bind port as presented bygetBrokerAddress(int). This enables Kroxylicious to sit behind yet another proxy that uses a different port from the kroxylicious bind port.- Parameters:
nodeId- node id- Returns:
- the broker's advertised address
- Throws:
IllegalArgumentException- if this provider cannot produce a broker address for the given nodeId.
-
getBindAddress
Bind address to be used for network binds.- Returns:
- bind address
-
getExclusivePorts
-
discoveryAddressMap
Map of node ids to broker addresses.- Returns:
- map of addresses
-
getBrokerIdFromBrokerAddress
Generates the node id implied by the given broker address (advertised hostname and bind port). This method make sense only for implementation that embed node id information into the broker address. This information is used at startup time to allow a client that already in possession of a broker address to reconnect to the cluster via Kroxylicious using only that address.
This is an optional method. An implementation can return null.- Parameters:
brokerAddress- broker address- Returns:
- broker id
-
name
String name()Get the gateways name- Returns:
- name
-