private void runSSHCommand(
SSHShellInputs sshShellInputs,
Map<String, String> returnResult,
SSHService service, String sessionId,
boolean saveSSHSession) {
int timeoutNumber = StringUtils.toInt(sshShellInputs.getTimeout(), Constants.DEFAULT_TIMEOUT);
boolean usePseudoTerminal = StringUtils.toBoolean(sshShellInputs.getPty(), Constants.DEFAULT_USE_PSEUDO_TERMINAL);
boolean agentForwarding = StringUtils.toBoolean(sshShellInputs.getAgentForwarding(), Constants.DEFAULT_USE_AGENT_FORWARDING);
sshShellInputs.setCharacterSet(StringUtils.toNotEmptyString(sshShellInputs.getCharacterSet(), Constants.DEFAULT_CHARACTER_SET));
CommandResult commandResult = service.runShellCommand(
sshShellInputs.getCommand(),
sshShellInputs.getCharacterSet(),
usePseudoTerminal,
Constants.DEFAULT_CONNECT_TIMEOUT,
timeoutNumber,
agentForwarding);
handleSessionClosure(sshShellInputs, service, sessionId, saveSSHSession);
populateResult(returnResult, commandResult);
}