Class DefaultControllerNode

  • All Implemented Interfaces:
    ControllerNode, Node

    public class DefaultControllerNode
    extends java.lang.Object
    implements ControllerNode
    Default implementation of a controller instance descriptor.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_PORT  
    • 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()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.onosproject.cluster.Node

        ip
    • 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 identifier
        host - 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 identifier
        host - instance host name
        tcpPort - TCP port
      • DefaultControllerNode

        public DefaultControllerNode​(NodeId id,
                                     IpAddress ip)
        Creates a new instance with the specified id and IP address.
        Parameters:
        id - instance identifier
        ip - instance IP address
      • DefaultControllerNode

        public DefaultControllerNode​(NodeId id,
                                     IpAddress ip,
                                     int tcpPort)
        Creates a new instance with the specified id and IP address.
        Parameters:
        id - instance identifier
        ip - instance IP address
        tcpPort - TCP port
    • Method Detail

      • id

        public NodeId id()
        Description copied from interface: Node
        Returns the instance identifier.
        Specified by:
        id in interface Node
        Returns:
        instance identifier
      • host

        public java.lang.String host()
        Description copied from interface: Node
        Returns the host name of the controller instance.
        Specified by:
        host in 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.
        Specified by:
        ip in interface Node
        Parameters:
        resolve - whether to resolve the hostname
        Returns:
        IP address
      • tcpPort

        public int tcpPort()
        Description copied from interface: Node
        Returns the TCP port on which the node listens for connections.
        Specified by:
        tcpPort in interface Node
        Returns:
        TCP port
      • hashCode

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

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

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