Class TcpDirective

  • All Implemented Interfaces:
    HopDirective

    public class TcpDirective
    extends java.lang.Object
    implements HopDirective
    This class represents a tcp directive within a Hop's selector. This is a connection string used to establish a direct connection to a host, bypassing service lookups through Slobrok.
    Author:
    Simon Thoresen Hult
    • Constructor Summary

      Constructors 
      Constructor Description
      TcpDirective​(java.lang.String host, int port, java.lang.String session)
      Constructs a new directive to route directly to a tcp address.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String getHost()
      Returns the host to connect to.
      int getPort()
      Returns the port to connect to on the remove host.
      java.lang.String getSession()
      Returns the name of the session to route to.
      int hashCode()  
      boolean matches​(HopDirective dir)
      Returns true if this directive matches another.
      java.lang.String toDebugString()
      Returns a string representation of this that can be debugged but not parsed.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • TcpDirective

        public TcpDirective​(java.lang.String host,
                            int port,
                            java.lang.String session)
        Constructs a new directive to route directly to a tcp address.
        Parameters:
        host - The host name to connect to.
        port - The port to connect to.
        session - The session to route to.
    • Method Detail

      • matches

        public boolean matches​(HopDirective dir)
        Description copied from interface: HopDirective
        Returns true if this directive matches another.
        Specified by:
        matches in interface HopDirective
        Parameters:
        dir - The directive to compare this to.
        Returns:
        True if this matches the argument.
      • getHost

        public java.lang.String getHost()
        Returns the host to connect to. This may be an ip address or a name.
        Returns:
        The host.
      • getPort

        public int getPort()
        Returns the port to connect to on the remove host.
        Returns:
        The port number.
      • getSession

        public java.lang.String getSession()
        Returns the name of the session to route to.
        Returns:
        The session name.
      • equals

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

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

        public java.lang.String toDebugString()
        Description copied from interface: HopDirective
        Returns a string representation of this that can be debugged but not parsed.
        Specified by:
        toDebugString in interface HopDirective
        Returns:
        The debug string.
      • hashCode

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