class SSHServiceImpl implements SSHService {

    @Override
    public CommandResult runShell(
            final String command,
            final String characterSet,
            boolean usePseudoTerminal,
            int connectTimeout,
            int commandTimeout,
            boolean agentForwarding) {

        try {
            if (!isConnected()) {
                session.connect(connectTimeout);
            }

            final ChannelShell channelShell = (ChannelShell) session.openChannel(SHELL_CHANNEL);
            channelShell.setPty(usePseudoTerminal);
            channelShell.setAgentForwarding(agentForwarding);

            final OutputStream shellIn = channelShell.getOutputStream();
            final InputStream shellOut = channelShell.getInputStream();

            channelShell.connect(connectTimeout);

            final PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(shellIn, characterSet));

            printWriter.println(command);
            printWriter.flush();

            try {
                Thread.sleep(commandTimeout);
            } catch (InterruptedException ignored) {
            }

            printWriter.println(EXIT_COMMAND);
            printWriter.flush();

            final String result = IOUtils.toString(shellOut, characterSet);

            final CommandResult commandResult = new CommandResult();
            commandResult.setStandardOutput(result);

            return commandResult;
        } catch (JSchException | IOException e) {
            throw new RuntimeException(e);
        }
    }

    public  SSHServiceImpl(Session session, Channel channel);
    public  SSHServiceImpl(ConnectionDetails details, IdentityKey identityKey, KnownHostsFile knownHostsFile,
                          int connectTimeout, boolean keepContextForExpectCommand, ProxyHTTP proxyHTTP, String allowedCiphers);

}