Class Listener

  • All Implemented Interfaces:
    io.fabric8.kubernetes.api.builder.Editable<ListenerBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource, Serializable

    @Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator")
    public class Listener
    extends Object
    implements io.fabric8.kubernetes.api.builder.Editable<ListenerBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
    Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.
    See Also:
    Serialized Form
    • Method Detail

      • getAllowedRoutes

        public AllowedRoutes getAllowedRoutes()
        Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.
      • setAllowedRoutes

        public void setAllowedRoutes​(AllowedRoutes allowedRoutes)
        Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.
      • getHostname

        public String getHostname()
        Hostname specifies the virtual hostname to match for protocol types that define this concept. When unspecified, all hostnames are matched. This field is ignored for protocols that don't require hostname based matching.


        Implementations MUST apply Hostname matching appropriately for each of the following protocols:


        * TLS: The Listener Hostname MUST match the SNI. * HTTP: The Listener Hostname MUST match the Host header of the request. * HTTPS: The Listener Hostname SHOULD match both the SNI and Host header.

        Note that this does not require the SNI and Host header to be the same.

        The semantics of this are described in more detail below.


        To ensure security, Section 11.1 of RFC-6066 emphasizes that server implementations that rely on SNI hostname matching MUST also verify hostnames within the application protocol.


        Section 9.1.2 of RFC-7540 provides a mechanism for servers to reject the reuse of a connection by responding with the HTTP 421 Misdirected Request status code. This indicates that the origin server has rejected the request because it appears to have been misdirected.


        To detect misdirected requests, Gateways SHOULD match the authority of the requests with all the SNI hostname(s) configured across all the Gateway Listeners on the same port and protocol:


        * If another Listener has an exact match or more specific wildcard entry,

        the Gateway SHOULD return a 421.

        * If the current Listener (selected by SNI matching during ClientHello)

        does not match the Host:

        * If another Listener does match the Host the Gateway SHOULD return a

        421.

        * If no other Listener matches the Host, the Gateway MUST return a

        404.


        For HTTPRoute and TLSRoute resources, there is an interaction with the `spec.hostnames` array. When both listener and route specify hostnames, there MUST be an intersection between the values for a Route to be accepted. For more information, refer to the Route specific Hostnames documentation.


        Hostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`.


        Support: Core

      • setHostname

        public void setHostname​(String hostname)
        Hostname specifies the virtual hostname to match for protocol types that define this concept. When unspecified, all hostnames are matched. This field is ignored for protocols that don't require hostname based matching.


        Implementations MUST apply Hostname matching appropriately for each of the following protocols:


        * TLS: The Listener Hostname MUST match the SNI. * HTTP: The Listener Hostname MUST match the Host header of the request. * HTTPS: The Listener Hostname SHOULD match both the SNI and Host header.

        Note that this does not require the SNI and Host header to be the same.

        The semantics of this are described in more detail below.


        To ensure security, Section 11.1 of RFC-6066 emphasizes that server implementations that rely on SNI hostname matching MUST also verify hostnames within the application protocol.


        Section 9.1.2 of RFC-7540 provides a mechanism for servers to reject the reuse of a connection by responding with the HTTP 421 Misdirected Request status code. This indicates that the origin server has rejected the request because it appears to have been misdirected.


        To detect misdirected requests, Gateways SHOULD match the authority of the requests with all the SNI hostname(s) configured across all the Gateway Listeners on the same port and protocol:


        * If another Listener has an exact match or more specific wildcard entry,

        the Gateway SHOULD return a 421.

        * If the current Listener (selected by SNI matching during ClientHello)

        does not match the Host:

        * If another Listener does match the Host the Gateway SHOULD return a

        421.

        * If no other Listener matches the Host, the Gateway MUST return a

        404.


        For HTTPRoute and TLSRoute resources, there is an interaction with the `spec.hostnames` array. When both listener and route specify hostnames, there MUST be an intersection between the values for a Route to be accepted. For more information, refer to the Route specific Hostnames documentation.


        Hostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`.


        Support: Core

      • getName

        public String getName()
        Name is the name of the Listener. This name MUST be unique within a Gateway.


        Support: Core

      • setName

        public void setName​(String name)
        Name is the name of the Listener. This name MUST be unique within a Gateway.


        Support: Core

      • getPort

        public Integer getPort()
        Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules.


        Support: Core

      • setPort

        public void setPort​(Integer port)
        Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules.


        Support: Core

      • getProtocol

        public String getProtocol()
        Protocol specifies the network protocol this listener expects to receive.


        Support: Core

      • setProtocol

        public void setProtocol​(String protocol)
        Protocol specifies the network protocol this listener expects to receive.


        Support: Core

      • getTls

        public ListenerTLSConfig getTls()
        Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.
      • setTls

        public void setTls​(ListenerTLSConfig tls)
        Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.
      • getAdditionalProperties

        public Map<String,​Object> getAdditionalProperties()
      • setAdditionalProperty

        public void setAdditionalProperty​(String name,
                                          Object value)
      • setAdditionalProperties

        public void setAdditionalProperties​(Map<String,​Object> additionalProperties)