Class SshScriptingServiceImpl
- java.lang.Object
-
- org.opennms.features.deviceconfig.sshscripting.impl.SshScriptingServiceImpl
-
- All Implemented Interfaces:
SshScriptingService
public class SshScriptingServiceImpl extends Object implements SshScriptingService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opennms.features.deviceconfig.sshscripting.SshScriptingService
SshScriptingService.Result
-
-
Field Summary
Fields Modifier and Type Field Description static String
SCRIPT_VAR_TFTP_SERVER_IP
-
Constructor Summary
Constructors Constructor Description SshScriptingServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SshScriptingService.Result
execute(String script, String user, String password, SocketAddress target, String hostKeyFingerprint, Map<String,String> vars, java.time.Duration timeout)
Executes the given script and optionally returns a failure.void
setTftpServerIPv4Address(String tftpServerIPv4Address)
void
setTftpServerIPv6Address(String tftpServerIPv6Address)
-
-
-
Field Detail
-
SCRIPT_VAR_TFTP_SERVER_IP
public static final String SCRIPT_VAR_TFTP_SERVER_IP
- See Also:
- Constant Field Values
-
-
Method Detail
-
setTftpServerIPv4Address
public void setTftpServerIPv4Address(String tftpServerIPv4Address) throws UnknownHostException
- Throws:
UnknownHostException
-
setTftpServerIPv6Address
public void setTftpServerIPv6Address(String tftpServerIPv6Address) throws UnknownHostException
- Throws:
UnknownHostException
-
execute
public SshScriptingService.Result execute(String script, String user, String password, SocketAddress target, String hostKeyFingerprint, Map<String,String> vars, java.time.Duration timeout)
Description copied from interface:SshScriptingService
Executes the given script and optionally returns a failure.- Specified by:
execute
in interfaceSshScriptingService
- Parameters:
script
- contains statements separated by new linesuser
- the ssh userpassword
- the ssh user's passwordtarget
- the ssh target to connect tohostKeyFingerprint
- host key fingerprint to accept from the target systemvars
- variables that can be referenced in the script; variables are referenced by "${varname}
" expressionstimeout
- used when establishing the ssh interaction and for await statements- Returns:
-
-