Class ServicePort

  • All Implemented Interfaces:
    com.marcnuri.yakc.model.Model

    public class ServicePort
    extends java.lang.Object
    implements com.marcnuri.yakc.model.Model
    ServicePort contains information on service's port.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ServicePort.Builder  
    • Constructor Summary

      Constructors 
      Constructor Description
      ServicePort()  
      ServicePort​(java.lang.String appProtocol, java.lang.String name, java.lang.Number nodePort, @NonNull java.lang.Number port, java.lang.String protocol, java.lang.String targetPort)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ServicePort.Builder builder()  
      protected boolean canEqual​(java.lang.Object other)  
      boolean equals​(java.lang.Object o)  
      java.lang.String getAppProtocol()
      The application protocol for this port.
      java.lang.String getName()
      The name of this port within the service.
      java.lang.Number getNodePort()
      The port on each node on which this service is exposed when type is NodePort or LoadBalancer.
      @NonNull java.lang.Number getPort()
      The port that will be exposed by this service.
      java.lang.String getProtocol()
      The IP protocol for this port.
      java.lang.String getTargetPort()  
      int hashCode()  
      void setAppProtocol​(java.lang.String appProtocol)
      The application protocol for this port.
      void setName​(java.lang.String name)
      The name of this port within the service.
      void setNodePort​(java.lang.Number nodePort)
      The port on each node on which this service is exposed when type is NodePort or LoadBalancer.
      void setPort​(@NonNull java.lang.Number port)
      The port that will be exposed by this service.
      void setProtocol​(java.lang.String protocol)
      The IP protocol for this port.
      void setTargetPort​(java.lang.String targetPort)  
      ServicePort.Builder toBuilder()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ServicePort

        public ServicePort​(java.lang.String appProtocol,
                           java.lang.String name,
                           java.lang.Number nodePort,
                           @NonNull
                           @NonNull java.lang.Number port,
                           java.lang.String protocol,
                           java.lang.String targetPort)
      • ServicePort

        public ServicePort()
    • Method Detail

      • getAppProtocol

        public java.lang.String getAppProtocol()
        The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:


        * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).


        * Kubernetes-defined prefixed names:

        * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540

        * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455

        * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455


        * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.

      • getName

        public java.lang.String getName()
        The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the 'name' field in the EndpointPort. Optional if only one ServicePort is defined on this service.
      • getNodePort

        public java.lang.Number getNodePort()
        The port on each node on which this service is exposed when type is NodePort or LoadBalancer. Usually assigned by the system. If a value is specified, in-range, and not in use it will be used, otherwise the operation will fail. If not specified, a port will be allocated if this Service requires one. If this field is specified when creating a Service which does not need it, creation will fail. This field will be wiped when updating a Service to no longer need it (e.g. changing type from NodePort to ClusterIP). More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
      • getPort

        @NonNull
        public @NonNull java.lang.Number getPort()
        The port that will be exposed by this service.
      • getProtocol

        public java.lang.String getProtocol()
        The IP protocol for this port. Supports "TCP", "UDP", and "SCTP". Default is TCP.
      • getTargetPort

        public java.lang.String getTargetPort()
      • setAppProtocol

        public void setAppProtocol​(java.lang.String appProtocol)
        The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:


        * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).


        * Kubernetes-defined prefixed names:

        * 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540

        * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455

        * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455


        * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.

      • setName

        public void setName​(java.lang.String name)
        The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the 'name' field in the EndpointPort. Optional if only one ServicePort is defined on this service.
      • setNodePort

        public void setNodePort​(java.lang.Number nodePort)
        The port on each node on which this service is exposed when type is NodePort or LoadBalancer. Usually assigned by the system. If a value is specified, in-range, and not in use it will be used, otherwise the operation will fail. If not specified, a port will be allocated if this Service requires one. If this field is specified when creating a Service which does not need it, creation will fail. This field will be wiped when updating a Service to no longer need it (e.g. changing type from NodePort to ClusterIP). More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
      • setPort

        public void setPort​(@NonNull
                            @NonNull java.lang.Number port)
        The port that will be exposed by this service.
      • setProtocol

        public void setProtocol​(java.lang.String protocol)
        The IP protocol for this port. Supports "TCP", "UDP", and "SCTP". Default is TCP.
      • setTargetPort

        public void setTargetPort​(java.lang.String targetPort)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object