Interface Endpoint

  • All Superinterfaces:
    Cloneable, javax.sip.address.Hop, javax.sip.ListeningPoint, Serializable

    public interface Endpoint
    extends javax.sip.address.Hop, javax.sip.ListeningPoint
    Represents a local or remote SIP endpoint, a triple of host/port/transport. This proposed interface effectively combines the JAIN SIP 1.1 Hop and ListeningPoint interfaces. Because a SipStack may listen on any number of IP addresses, it is simple to just use Endpoints to represent both local listening points and next-hop addresses. The SipStack is responsible for creating Endpoints, using SipStack#createEndpoint(java.lang.String,int,java.lang.String)
    See Also:
    SipStack
    • Field Summary

      • Fields inherited from interface javax.sip.ListeningPoint

        PORT_5060, PORT_5061, SCTP, TCP, TLS, UDP
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean equals​(Object other)
      Implementations should implement equals() such that two Endpoints are equal if and only if their host, port and transport fields are equal.
      String getHost()
      Convenience method to get the String representation of the Endpoint's IP address.
      int getPort()
      Get the port number of this endpoint.
      InetSocketAddress getSocketAddress()  
      String getTransport()
      Get the name for the transport used by this endpoint, for example "TCP", "UDP" or "SCTP".
      int hashCode()  
      boolean isAnyLocalAddress()
      Convenience method to determine if the endpoint's address is a wildcard address (0.0.0.0 or 0:0:0:0:0:0:0:0), as per InetAddress.isAnyLocalAddress().
      boolean isIPv6Address()
      Convenience method to determine if the endpoint is using an IPv6 address.
      boolean isReliable()
      Is the transport for this endpoint reliable?
      boolean isSecure()
      Is the transport for this endpoint secure?
      • Methods inherited from interface javax.sip.address.Hop

        toString
      • Methods inherited from interface javax.sip.ListeningPoint

        getIPAddress, getSentBy, setSentBy
    • Method Detail

      • getHost

        String getHost()
        Convenience method to get the String representation of the Endpoint's IP address.
        Specified by:
        getHost in interface javax.sip.address.Hop
      • getPort

        int getPort()
        Get the port number of this endpoint.
        Specified by:
        getPort in interface javax.sip.address.Hop
        Specified by:
        getPort in interface javax.sip.ListeningPoint
        Returns:
        the port number the endpoint is bound to.
      • getTransport

        String getTransport()
        Get the name for the transport used by this endpoint, for example "TCP", "UDP" or "SCTP".
        Specified by:
        getTransport in interface javax.sip.address.Hop
        Specified by:
        getTransport in interface javax.sip.ListeningPoint
        Returns:
        this endpoint's transport name
      • isReliable

        boolean isReliable()
        Is the transport for this endpoint reliable? (eg. TCP, SCTP)
        Returns:
        true if the transport for this endpoint is a reliable protocol (no SIP retransmits required), false otherwise.
      • isSecure

        boolean isSecure()
        Is the transport for this endpoint secure? (eg. TLS)
        Returns:
        true if the transport for this endpoint is secure, ie. data is encrypted in some way, or false otherwise.
      • isIPv6Address

        boolean isIPv6Address()
        Convenience method to determine if the endpoint is using an IPv6 address.
        Returns:
        true if this endpoint's IP address is an IPv6 address, false if IPv4.
      • isAnyLocalAddress

        boolean isAnyLocalAddress()
        Convenience method to determine if the endpoint's address is a wildcard address (0.0.0.0 or 0:0:0:0:0:0:0:0), as per InetAddress.isAnyLocalAddress().
        Returns:
        true if this endpoint's IP address is a wildcard address, otherwise false.
      • equals

        boolean equals​(Object other)
        Implementations should implement equals() such that two Endpoints are equal if and only if their host, port and transport fields are equal. Hosts are equal if they resolve to the same IP address, and transports must be compared case-insensitive.
        Specified by:
        equals in interface javax.sip.ListeningPoint
        Overrides:
        equals in class Object
        Parameters:
        other - the object with which to compare
        Returns:
        true if the endpoints are equal; false otherwise.