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 int
DEFAULT_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 boolean
equals(java.lang.Object o)
int
hashCode()
java.lang.String
host()
Returns the host name of the controller instance.NodeId
id()
Returns the instance identifier.IpAddress
ip(boolean resolve)
Returns the IP address of the controller instance.int
tcpPort()
Returns the TCP port on which the node listens for connections.java.lang.String
toString()
-
-
-
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:Node
Returns the host name of the controller instance.
-
ip
public IpAddress ip(boolean resolve)
Description copied from interface:Node
Returns the IP address of the controller instance.
-
tcpPort
public int tcpPort()
Description copied from interface:Node
Returns the TCP port on which the node listens for connections.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-