Class NetconfDeviceInfo


  • public class NetconfDeviceInfo
    extends java.lang.Object
    Represents a Netconf device information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger log  
    • Constructor Summary

      Constructors 
      Constructor Description
      NetconfDeviceInfo​(java.lang.String name, java.lang.String password, org.onlab.packet.IpAddress ipAddress, int port)
      Information for contacting the controller.
      NetconfDeviceInfo​(java.lang.String name, java.lang.String password, org.onlab.packet.IpAddress ipAddress, int port, java.lang.String path)
      Information for contacting the controller.
      NetconfDeviceInfo​(java.lang.String name, java.lang.String password, org.onlab.packet.IpAddress ipAddress, int port, java.lang.String path, java.lang.String keyString)
      Information for contacting the controller.
      NetconfDeviceInfo​(NetconfDeviceConfig netconfConfig)
      Convenieince constructor that converts all known fields from NetCfg data.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object toBeCompared)  
      static org.apache.commons.lang3.tuple.Triple<java.lang.String,​java.lang.Integer,​java.util.Optional<java.lang.String>> extractIpPortPath​(org.onosproject.net.DeviceId deviceId)  
      java.util.OptionalInt getConnectTimeoutSec()
      Exposes the device specific connect timeout.
      org.onosproject.net.DeviceId getDeviceId()
      Return the DeviceId about the device containing the URI.
      java.util.OptionalInt getIdleTimeoutSec()
      Exposes the device specific idle timeout.
      char[] getKey()
      Exposes the key of the controller.
      java.util.OptionalInt getReplyTimeoutSec()
      Exposes the device specific reply timeout.
      int hashCode()  
      org.onlab.packet.IpAddress ip()
      Exposes the ip address of the controller.
      java.lang.String name()
      Exposes the name of the controller.
      java.lang.String password()
      Exposes the password of the controller.
      java.util.Optional<java.lang.String> path()  
      int port()
      Exposes the port of the controller.
      void setConnectTimeoutSec​(java.util.OptionalInt connectTimeoutSec)
      Allows the NETCONF SSH session initial connect timeout to be set.
      void setIdleTimeoutSec​(java.util.OptionalInt idleTimeoutSec)
      Allows the NETCONF SSH session idle timeout to be set.
      void setPath​(java.util.Optional<java.lang.String> path)
      Allows the path aspect of the device URI to be set.
      void setReplyTimeoutSec​(java.util.OptionalInt replyTimeoutSec)
      Allows the NETCONF SSH session replies timeout to be set.
      void setSshClientLib​(java.util.Optional<NetconfSshClientLib> sshClientLib)
      Allows the NETCONF SSH Client library to be set.
      java.util.Optional<NetconfSshClientLib> sshClientLib()
      Exposes the Client library implementation.
      java.lang.String toString()
      Return the info about the device in a string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • log

        public static final org.slf4j.Logger log
    • Constructor Detail

      • NetconfDeviceInfo

        public NetconfDeviceInfo​(java.lang.String name,
                                 java.lang.String password,
                                 org.onlab.packet.IpAddress ipAddress,
                                 int port,
                                 java.lang.String path)
        Information for contacting the controller.
        Parameters:
        name - the connection type
        password - the password for the device
        ipAddress - the ip address
        port - the tcp port
        path - the path part
      • NetconfDeviceInfo

        public NetconfDeviceInfo​(java.lang.String name,
                                 java.lang.String password,
                                 org.onlab.packet.IpAddress ipAddress,
                                 int port)
        Information for contacting the controller.
        Parameters:
        name - the connection type
        password - the password for the device
        ipAddress - the ip address
        port - the tcp port
      • NetconfDeviceInfo

        public NetconfDeviceInfo​(java.lang.String name,
                                 java.lang.String password,
                                 org.onlab.packet.IpAddress ipAddress,
                                 int port,
                                 java.lang.String path,
                                 java.lang.String keyString)
        Information for contacting the controller.
        Parameters:
        name - the connection type
        password - the password for the device
        ipAddress - the ip address
        port - the tcp port
        path - the path part
        keyString - the string containing a DSA or RSA private key of the user in OpenSSH key format
      • NetconfDeviceInfo

        public NetconfDeviceInfo​(NetconfDeviceConfig netconfConfig)
        Convenieince constructor that converts all known fields from NetCfg data.
        Parameters:
        netconfConfig - NetCf configuration
    • Method Detail

      • setSshClientLib

        public void setSshClientLib​(java.util.Optional<NetconfSshClientLib> sshClientLib)
        Allows the NETCONF SSH Client library to be set.
        Parameters:
        sshClientLib - An enumerated value
      • setConnectTimeoutSec

        public void setConnectTimeoutSec​(java.util.OptionalInt connectTimeoutSec)
        Allows the NETCONF SSH session initial connect timeout to be set.
        Parameters:
        connectTimeoutSec - value in seconds
      • setReplyTimeoutSec

        public void setReplyTimeoutSec​(java.util.OptionalInt replyTimeoutSec)
        Allows the NETCONF SSH session replies timeout to be set.
        Parameters:
        replyTimeoutSec - value in seconds
      • setIdleTimeoutSec

        public void setIdleTimeoutSec​(java.util.OptionalInt idleTimeoutSec)
        Allows the NETCONF SSH session idle timeout to be set.
        Parameters:
        idleTimeoutSec - value in seconds
      • setPath

        public void setPath​(java.util.Optional<java.lang.String> path)
        Allows the path aspect of the device URI to be set.
        Parameters:
        path - path aspect value
      • name

        public java.lang.String name()
        Exposes the name of the controller.
        Returns:
        String name
      • password

        public java.lang.String password()
        Exposes the password of the controller.
        Returns:
        String password
      • ip

        public org.onlab.packet.IpAddress ip()
        Exposes the ip address of the controller.
        Returns:
        IpAddress ip address
      • port

        public int port()
        Exposes the port of the controller.
        Returns:
        port number
      • path

        public java.util.Optional<java.lang.String> path()
      • getKey

        public char[] getKey()
        Exposes the key of the controller.
        Returns:
        char[] containing a DSA or RSA private key of the user in OpenSSH key format or null if device is not configured to use public key authentication
      • sshClientLib

        public java.util.Optional<NetconfSshClientLib> sshClientLib()
        Exposes the Client library implementation.
        Returns:
        Enumerated value
      • getConnectTimeoutSec

        public java.util.OptionalInt getConnectTimeoutSec()
        Exposes the device specific connect timeout.
        Returns:
        The timeout value in seconds
      • getReplyTimeoutSec

        public java.util.OptionalInt getReplyTimeoutSec()
        Exposes the device specific reply timeout.
        Returns:
        The timeout value in seconds
      • getIdleTimeoutSec

        public java.util.OptionalInt getIdleTimeoutSec()
        Exposes the device specific idle timeout.
        Returns:
        The timeout value in seconds
      • toString

        public java.lang.String toString()
        Return the info about the device in a string. String format: "netconf:name@ip:port"
        Overrides:
        toString in class java.lang.Object
        Returns:
        String device info
      • getDeviceId

        public org.onosproject.net.DeviceId getDeviceId()
        Return the DeviceId about the device containing the URI.
        Returns:
        DeviceId
      • hashCode

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

        public boolean equals​(java.lang.Object toBeCompared)
        Overrides:
        equals in class java.lang.Object
      • extractIpPortPath

        public static org.apache.commons.lang3.tuple.Triple<java.lang.String,​java.lang.Integer,​java.util.Optional<java.lang.String>> extractIpPortPath​(org.onosproject.net.DeviceId deviceId)