Interface NetconfController


  • public interface NetconfController
    Abstraction of an NETCONF controller. Serves as a one stop shop for obtaining NetconfDevice and (un)register listeners on NETCONF device events.
    • Method Detail

      • addDeviceListener

        void addDeviceListener​(NetconfDeviceListener listener)
        Adds Device Event Listener.
        Parameters:
        listener - node listener
      • removeDeviceListener

        void removeDeviceListener​(NetconfDeviceListener listener)
        Removes Device Listener.
        Parameters:
        listener - node listener
      • connectDevice

        NetconfDevice connectDevice​(org.onosproject.net.DeviceId deviceId)
                             throws NetconfException
        Tries to connect to a specific NETCONF device, if the connection is succesful it creates and adds the device to the ONOS core as a NetconfDevice.
        Parameters:
        deviceId - deviceId of the device to connect
        Returns:
        NetconfDevice Netconf device
        Throws:
        NetconfException - when device is not available
      • connectDevice

        default NetconfDevice connectDevice​(org.onosproject.net.DeviceId deviceId,
                                            boolean isMaster)
                                     throws NetconfException
        Tries to connect to a specific NETCONF device, if the connection is succesful it creates and adds the device to the ONOS core as a NetconfDevice. If isMaster true: Will create two sessions for a device : secure transport session and proxy session. If isMaster false: Will create only proxy session.
        Parameters:
        deviceId - deviceId of the device to connect
        isMaster - if the controller is master for the device
        Returns:
        NetconfDevice Netconf device
        Throws:
        NetconfException - when device is not available
      • disconnectDevice

        void disconnectDevice​(org.onosproject.net.DeviceId deviceId,
                              boolean remove)
        Disconnects a Netconf device and removes it from the core.
        Parameters:
        deviceId - id of the device to remove
        remove - true if device is to be removed from core
      • removeDevice

        void removeDevice​(org.onosproject.net.DeviceId deviceId)
        Removes a Netconf device from the core.
        Parameters:
        deviceId - id of the device to remove
      • getDevicesMap

        java.util.Map<org.onosproject.net.DeviceId,​NetconfDevice> getDevicesMap()
        Gets all the nodes information.
        Returns:
        map of devices
      • getNetconfDevices

        java.util.Set<org.onosproject.net.DeviceId> getNetconfDevices()
        Gets all Netconf Devices.
        Returns:
        List of all the NetconfDevices Ids
      • getNetconfDevice

        NetconfDevice getNetconfDevice​(org.onosproject.net.DeviceId deviceInfo)
        Gets a Netconf Device by node identifier.
        Parameters:
        deviceInfo - node identifier
        Returns:
        NetconfDevice Netconf device
      • getNetconfDevice

        NetconfDevice getNetconfDevice​(org.onlab.packet.IpAddress ip,
                                       int port)
        Gets a Netconf Device by node identifier.
        Parameters:
        ip - device ip
        port - device port
        Returns:
        NetconfDevice Netconf device
      • getNetconfDevice

        NetconfDevice getNetconfDevice​(org.onlab.packet.IpAddress ip,
                                       int port,
                                       java.lang.String path)
        Gets a Netconf Device by node identifier.
        Parameters:
        ip - device ip
        port - device port
        path - device path
        Returns:
        NetconfDevice Netconf device
      • executeAtMaster

        default <T> java.util.concurrent.CompletableFuture<T> executeAtMaster​(NetconfProxyMessage proxyMessage)
                                                                       throws NetconfException
        If master, will execute the call locally else will use clusterCommunicationManager to execute at master controller. Meant only for internal synchronization and not to be used by applications.
        Type Parameters:
        T - return type
        Parameters:
        proxyMessage - proxy message
        Returns:
        Completable future of class T
        Throws:
        NetconfException - netconf exception
      • getLocalNodeId

        default org.onosproject.cluster.NodeId getLocalNodeId()
        Get a contoller node Id .
        Returns:
        controller node Id