Class Origin


  • public class Origin
    extends java.lang.Object

    Class that groups the elements that uniquely identify a destination.

    The elements are scheme, host, port, a Origin.Protocol and a tag object that further distinguishes destinations that have the same origin and protocol.

    In general it is possible that, for the same origin, the server can speak different protocols (for example, clear-text HTTP/1.1 and clear-text HTTP/2), so the Origin.Protocol makes that distinction.

    Furthermore, it may be desirable to have different destinations for the same origin and protocol (for example, when using the PROXY protocol in a reverse proxy server, you want to be able to map the client ip:port to the destination tag, so that all the connections to the server associated to that destination can specify the PROXY protocol bytes for that particular client connection.

    • Constructor Detail

      • Origin

        public Origin​(java.lang.String scheme,
                      java.lang.String host,
                      int port)
      • Origin

        public Origin​(java.lang.String scheme,
                      java.lang.String host,
                      int port,
                      java.lang.Object tag)
      • Origin

        public Origin​(java.lang.String scheme,
                      java.lang.String host,
                      int port,
                      java.lang.Object tag,
                      Origin.Protocol protocol)
      • Origin

        public Origin​(java.lang.String scheme,
                      Origin.Address address)
      • Origin

        public Origin​(java.lang.String scheme,
                      Origin.Address address,
                      java.lang.Object tag)
    • Method Detail

      • getScheme

        public java.lang.String getScheme()
      • getTag

        public java.lang.Object getTag()
      • equals

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

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

        public java.lang.String asString()
      • toString

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