Package com.yahoo.messagebus.routing
Class TcpDirective
java.lang.Object
com.yahoo.messagebus.routing.TcpDirective
- All Implemented Interfaces:
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
ConstructorDescriptionTcpDirective
(String host, int port, String session) Constructs a new directive to route directly to a tcp address. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getHost()
Returns the host to connect to.int
getPort()
Returns the port to connect to on the remove host.Returns the name of the session to route to.int
hashCode()
boolean
matches
(HopDirective dir) Returns true if this directive matches another.Returns a string representation of this that can be debugged but not parsed.toString()
-
Constructor Details
-
TcpDirective
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 Details
-
matches
Description copied from interface:HopDirective
Returns true if this directive matches another.- Specified by:
matches
in interfaceHopDirective
- Parameters:
dir
- The directive to compare this to.- Returns:
- True if this matches the argument.
-
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
Returns the name of the session to route to.- Returns:
- The session name.
-
equals
-
toString
-
toDebugString
Description copied from interface:HopDirective
Returns a string representation of this that can be debugged but not parsed.- Specified by:
toDebugString
in interfaceHopDirective
- Returns:
- The debug string.
-
hashCode
public int hashCode()
-