Package org.onosproject.netconf
Class NetconfDeviceInfo
- java.lang.Object
-
- org.onosproject.netconf.NetconfDeviceInfo
-
public class NetconfDeviceInfo extends java.lang.ObjectRepresents a Netconf device information.
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Loggerlog
-
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 booleanequals(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.OptionalIntgetConnectTimeoutSec()Exposes the device specific connect timeout.org.onosproject.net.DeviceIdgetDeviceId()Return the DeviceId about the device containing the URI.java.util.OptionalIntgetIdleTimeoutSec()Exposes the device specific idle timeout.char[]getKey()Exposes the key of the controller.java.util.OptionalIntgetReplyTimeoutSec()Exposes the device specific reply timeout.inthashCode()org.onlab.packet.IpAddressip()Exposes the ip address of the controller.java.lang.Stringname()Exposes the name of the controller.java.lang.Stringpassword()Exposes the password of the controller.java.util.Optional<java.lang.String>path()intport()Exposes the port of the controller.voidsetConnectTimeoutSec(java.util.OptionalInt connectTimeoutSec)Allows the NETCONF SSH session initial connect timeout to be set.voidsetIdleTimeoutSec(java.util.OptionalInt idleTimeoutSec)Allows the NETCONF SSH session idle timeout to be set.voidsetPath(java.util.Optional<java.lang.String> path)Allows the path aspect of the device URI to be set.voidsetReplyTimeoutSec(java.util.OptionalInt replyTimeoutSec)Allows the NETCONF SSH session replies timeout to be set.voidsetSshClientLib(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.StringtoString()Return the info about the device in a string.
-
-
-
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 typepassword- the password for the deviceipAddress- the ip addressport- the tcp portpath- 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 typepassword- the password for the deviceipAddress- the ip addressport- 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 typepassword- the password for the deviceipAddress- the ip addressport- the tcp portpath- the path partkeyString- 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:
toStringin classjava.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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object toBeCompared)
- Overrides:
equalsin classjava.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)
-
-