Package zipkin2

Class Endpoint

  • All Implemented Interfaces:
    java.io.Serializable

    public final class Endpoint
    extends java.lang.Object
    implements java.io.Serializable
    The network context of a node in the service graph.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Endpoint.Builder  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String ipv4()
      The text representation of the primary IPv4 address associated with this a connection.
      byte[] ipv4Bytes()
      IPv4 endpoint address packed into 4 bytes or null if unknown.
      java.lang.String ipv6()
      The text representation of the primary IPv6 address associated with this a connection.
      byte[] ipv6Bytes()
      IPv6 endpoint address packed into 16 bytes or null if unknown.
      static Endpoint.Builder newBuilder()  
      java.lang.Integer port()
      Port of the IP's socket or null, if not known.
      int portAsInt()
      Like port() except returns a primitive where zero implies absent.
      java.lang.String serviceName()
      Lower-case label of this node in the service graph, such as "favstar".
      Endpoint.Builder toBuilder()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • serviceName

        @Nullable
        public java.lang.String serviceName()
        Lower-case label of this node in the service graph, such as "favstar". Leave absent if unknown.

        This is a primary label for trace lookup and aggregation, so it should be intuitive and consistent. Many use a name from service discovery.

      • ipv4

        @Nullable
        public java.lang.String ipv4()
        The text representation of the primary IPv4 address associated with this a connection. Ex. 192.168.99.100 Absent if unknown.
      • ipv4Bytes

        @Nullable
        public byte[] ipv4Bytes()
        IPv4 endpoint address packed into 4 bytes or null if unknown.
        See Also:
        ipv6(), Inet4Address.getAddress()
      • ipv6

        @Nullable
        public java.lang.String ipv6()
        The text representation of the primary IPv6 address associated with this a connection. Ex. 2001:db8::c001 Absent if unknown.
        See Also:
        for mapped addresses, ipv6Bytes()
      • ipv6Bytes

        @Nullable
        public byte[] ipv6Bytes()
        IPv6 endpoint address packed into 16 bytes or null if unknown.
        See Also:
        ipv6(), Inet6Address.getAddress()
      • port

        @Nullable
        public java.lang.Integer port()
        Port of the IP's socket or null, if not known.
        See Also:
        InetSocketAddress.getPort()
      • portAsInt

        public int portAsInt()
        Like port() except returns a primitive where zero implies absent.

        Using this method will avoid allocation, so is encouraged when copying data.

      • toString

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

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

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