Package org.onosproject.netconf.config
Class NetconfDeviceConfig
- java.lang.Object
-
- org.onosproject.net.config.Config<org.onosproject.net.DeviceId>
-
- org.onosproject.netconf.config.NetconfDeviceConfig
-
@Beta public class NetconfDeviceConfig extends org.onosproject.net.config.Config<org.onosproject.net.DeviceId>Configuration for Netconf provider. The URI for a netconf device is of the formatnetconf:<ip>[:<port>][/<path>]Theipandportare used to create a netconf connection to the device. Thepathis an optional component that is not used by the default netconf driver, but is leveragable by custom drivers.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_KEYnetcfg ConfigKey.static java.lang.StringCONNECT_TIMEOUTstatic java.lang.StringIDLE_TIMEOUTstatic java.lang.StringIPstatic java.lang.StringPASSWORDstatic java.lang.StringPATHstatic java.lang.StringPORTstatic java.lang.StringREPLY_TIMEOUTstatic java.lang.StringSSHCLIENTstatic java.lang.StringSSHKEYstatic java.lang.StringUSERNAME
-
Constructor Summary
Constructors Constructor Description NetconfDeviceConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.OptionalIntconnectTimeout()Gets the connect timeout of the SSH connection.java.util.OptionalIntidleTimeout()Gets the idle timeout of the SSH connection.org.onlab.packet.IpAddressip()Gets the Ip of the NETCONF device.booleanisValid()java.lang.Stringpassword()Gets the password of the NETCONF device.java.util.Optional<java.lang.String>path()Gets the path of the NETCONF device.intport()Gets the port of the NETCONF device.java.util.OptionalIntreplyTimeout()Gets the reply timeout of the SSH connection.NetconfDeviceConfigsetConnectTimeout(java.lang.Integer connectTimeout)Sets the NETCONF Connect Timeout for the Device.NetconfDeviceConfigsetIdleTimeout(java.lang.Integer idleTimeout)Sets the NETCONF Idle Timeout for the Device.NetconfDeviceConfigsetIp(java.lang.String ip)Sets the Ip for the Device.NetconfDeviceConfigsetPassword(java.lang.String password)Sets the password for the Device.NetconfDeviceConfigsetPath(java.lang.String path)Sets the path for the device.NetconfDeviceConfigsetPort(int port)Sets the Port for the Device.NetconfDeviceConfigsetReplyTimeout(java.lang.Integer replyTimeout)Sets the NETCONF Reply Timeout for the Device.NetconfDeviceConfigsetSshImpl(java.lang.String sshimpl)Sets the NETCONF Ssh client implementation for the Device.NetconfDeviceConfigsetSshKey(java.lang.String sshKey)Sets the SshKey for the Device.NetconfDeviceConfigsetUsername(java.lang.String username)Sets the username for the Device.java.util.Optional<java.lang.String>sshClient()Gets the NETCONF SSH Client implementation.java.lang.StringsshKey()Gets the sshKey of the NETCONF device.java.lang.Stringusername()Gets the username of the NETCONF device.-
Methods inherited from class org.onosproject.net.config.Config
apply, clear, get, get, get, get, get, get, getList, getList, hasField, hasField, hasFields, hasFields, hasOnlyFields, hasOnlyFields, init, isBoolean, isBoolean, isConnectPoint, isConnectPoint, isDecimal, isDecimal, isIntegralNumber, isIntegralNumber, isIpAddress, isIpAddress, isIpPrefix, isIpPrefix, isMacAddress, isMacAddress, isNumber, isNumber, isString, isString, isTpPort, isTpPort, isValidLength, key, node, setList, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, subject, toString
-
-
-
-
Field Detail
-
CONFIG_KEY
public static final java.lang.String CONFIG_KEY
netcfg ConfigKey.- See Also:
- Constant Field Values
-
IP
public static final java.lang.String IP
- See Also:
- Constant Field Values
-
PORT
public static final java.lang.String PORT
- See Also:
- Constant Field Values
-
PATH
public static final java.lang.String PATH
- See Also:
- Constant Field Values
-
USERNAME
public static final java.lang.String USERNAME
- See Also:
- Constant Field Values
-
PASSWORD
public static final java.lang.String PASSWORD
- See Also:
- Constant Field Values
-
SSHKEY
public static final java.lang.String SSHKEY
- See Also:
- Constant Field Values
-
SSHCLIENT
public static final java.lang.String SSHCLIENT
- See Also:
- Constant Field Values
-
CONNECT_TIMEOUT
public static final java.lang.String CONNECT_TIMEOUT
- See Also:
- Constant Field Values
-
REPLY_TIMEOUT
public static final java.lang.String REPLY_TIMEOUT
- See Also:
- Constant Field Values
-
IDLE_TIMEOUT
public static final java.lang.String IDLE_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
isValid
public boolean isValid()
- Overrides:
isValidin classorg.onosproject.net.config.Config<org.onosproject.net.DeviceId>
-
ip
public org.onlab.packet.IpAddress ip()
Gets the Ip of the NETCONF device.- Returns:
- ip
-
port
public int port()
Gets the port of the NETCONF device.- Returns:
- port
-
path
public java.util.Optional<java.lang.String> path()
Gets the path of the NETCONF device.- Returns:
- path
-
username
public java.lang.String username()
Gets the username of the NETCONF device.- Returns:
- username
-
password
public java.lang.String password()
Gets the password of the NETCONF device.- Returns:
- password
-
sshKey
public java.lang.String sshKey()
Gets the sshKey of the NETCONF device.- Returns:
- sshkey
-
sshClient
public java.util.Optional<java.lang.String> sshClient()
Gets the NETCONF SSH Client implementation. Expecting "apache-mina"- Returns:
- sshClient
-
connectTimeout
public java.util.OptionalInt connectTimeout()
Gets the connect timeout of the SSH connection.- Returns:
- connectTimeout
-
replyTimeout
public java.util.OptionalInt replyTimeout()
Gets the reply timeout of the SSH connection.- Returns:
- replyTimeout
-
idleTimeout
public java.util.OptionalInt idleTimeout()
Gets the idle timeout of the SSH connection.- Returns:
- idleTimeout
-
setIp
public NetconfDeviceConfig setIp(java.lang.String ip)
Sets the Ip for the Device.- Parameters:
ip- the ip- Returns:
- instance for chaining
-
setPort
public NetconfDeviceConfig setPort(int port)
Sets the Port for the Device.- Parameters:
port- the port- Returns:
- instance for chaining
-
setPath
public NetconfDeviceConfig setPath(java.lang.String path)
Sets the path for the device.- Parameters:
path- the path- Returns:
- instance for chaining
-
setUsername
public NetconfDeviceConfig setUsername(java.lang.String username)
Sets the username for the Device.- Parameters:
username- username- Returns:
- instance for chaining
-
setPassword
public NetconfDeviceConfig setPassword(java.lang.String password)
Sets the password for the Device.- Parameters:
password- password- Returns:
- instance for chaining
-
setSshKey
public NetconfDeviceConfig setSshKey(java.lang.String sshKey)
Sets the SshKey for the Device.- Parameters:
sshKey- sshKey as string- Returns:
- instance for chaining
-
setSshImpl
public NetconfDeviceConfig setSshImpl(java.lang.String sshimpl)
Sets the NETCONF Ssh client implementation for the Device. Must be 'apache-mina' When specified, overrides NetconfControllerImpl.sshLibrary for this device- Parameters:
sshimpl- sshimpl as string- Returns:
- instance for chaining
-
setConnectTimeout
public NetconfDeviceConfig setConnectTimeout(java.lang.Integer connectTimeout)
Sets the NETCONF Connect Timeout for the Device. This is the amount of time in seconds allowed for the SSH handshake to take place Minimum 1 second When specified, overrides NetconfControllerImpl.netconfConnectTimeout for this device- Parameters:
connectTimeout- connectTimeout as int- Returns:
- instance for chaining
-
setReplyTimeout
public NetconfDeviceConfig setReplyTimeout(java.lang.Integer replyTimeout)
Sets the NETCONF Reply Timeout for the Device. This is the amount of time in seconds allowed for the NETCONF Reply to a command Minimum 1 second When specified, overrides NetconfControllerImpl.netconfReplyTimeout for this device- Parameters:
replyTimeout- replyTimeout as int- Returns:
- instance for chaining
-
setIdleTimeout
public NetconfDeviceConfig setIdleTimeout(java.lang.Integer idleTimeout)
Sets the NETCONF Idle Timeout for the Device. This is the amount of time in seconds after which the SSH connection will close if no traffic is detected Minimum 10 second When specified, overrides NetconfControllerImpl.netconfIdleTimeout for this device- Parameters:
idleTimeout- idleTimeout as int- Returns:
- instance for chaining
-
-