Package org.onosproject.cluster
Class DefaultControllerNode
- java.lang.Object
-
- org.onosproject.cluster.DefaultControllerNode
-
- All Implemented Interfaces:
ControllerNode,Node
public class DefaultControllerNode extends java.lang.Object implements ControllerNode
Default implementation of a controller instance descriptor.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.onosproject.cluster.ControllerNode
ControllerNode.State
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PORT
-
Constructor Summary
Constructors Constructor Description DefaultControllerNode(NodeId id, java.lang.String host)Creates a new instance with the specified id and IP address.DefaultControllerNode(NodeId id, java.lang.String host, int tcpPort)Creates a new instance with the specified id and IP address and TCP port.DefaultControllerNode(NodeId id, IpAddress ip)Creates a new instance with the specified id and IP address.DefaultControllerNode(NodeId id, IpAddress ip, int tcpPort)Creates a new instance with the specified id and IP address.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)inthashCode()java.lang.Stringhost()Returns the host name of the controller instance.NodeIdid()Returns the instance identifier.IpAddressip(boolean resolve)Returns the IP address of the controller instance.inttcpPort()Returns the TCP port on which the node listens for connections.java.lang.StringtoString()
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultControllerNode
public DefaultControllerNode(NodeId id, java.lang.String host)
Creates a new instance with the specified id and IP address.- Parameters:
id- instance identifierhost- instance hostname
-
DefaultControllerNode
public DefaultControllerNode(NodeId id, java.lang.String host, int tcpPort)
Creates a new instance with the specified id and IP address and TCP port.- Parameters:
id- instance identifierhost- instance host nametcpPort- TCP port
-
DefaultControllerNode
public DefaultControllerNode(NodeId id, IpAddress ip)
Creates a new instance with the specified id and IP address.- Parameters:
id- instance identifierip- instance IP address
-
-
Method Detail
-
host
public java.lang.String host()
Description copied from interface:NodeReturns the host name of the controller instance.
-
ip
public IpAddress ip(boolean resolve)
Description copied from interface:NodeReturns the IP address of the controller instance.
-
tcpPort
public int tcpPort()
Description copied from interface:NodeReturns the TCP port on which the node listens for connections.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-