class SshUtils implements InitializingBean {

    protected void waitUntilCommandFinishes(String hostIp, String command, Session sshSession) {
        Integer exitStatus = sshSession.getExitStatus();
        while (exitStatus == null) {
            exitStatus = sshSession.getExitStatus();
            threadUtils.sleepThread(5);
        }
        logger.info(String.format("Command [%s] executed on [%s] has the following exitStatus [%d]", command, hostIp, exitStatus));
    }

}