protected SSHService getFromCache(SSHShellInputs sshShellInputs, String sessionId) { if (sessionId != null) { synchronized (sessionId) { return CacheUtils.getFromCache(sshShellInputs.getSshGlobalSessionObject().getResource(), sessionId); } } else { return null; } }
protected SSHService getFromCache(SSHShellInputs sshShellInputs, String sessionId) { if (sessionId != null) { synchronized (sessionId) { return CacheUtils.getFromCache(sshShellInputs.getSshGlobalSessionObject().getResource(), sessionId); } } else { return null; } }
protected void cleanupService(SSHShellInputs sshShellInputs, SSHService service, String sessionId) { service.close(); service.removeFromCache(sshShellInputs.getSshGlobalSessionObject(), sessionId); }
protected void cleanupService(SSHShellInputs sshShellInputs, SSHService service, String sessionId) { service.close(); service.removeFromCache(sshShellInputs.getSshGlobalSessionObject(), sessionId); }
protected SSHService getFromCache(SSHShellInputs sshShellInputs, String sessionId) { if (sessionId != null) { synchronized (sessionId) { return CacheUtils.getFromCache(sshShellInputs.getSshGlobalSessionObject().getResource(), sessionId); } } else { return null; } }
protected void cleanupService(SSHShellInputs sshShellInputs, SSHService service, String sessionId) { service.close(); service.removeFromCache(sshShellInputs.getSshGlobalSessionObject(), sessionId); }
private void handleSessionClosure(SSHShellInputs sshShellInputs, SSHService service, String sessionId, boolean saveSSHSession) { boolean closeSessionBoolean = StringUtils.toBoolean(sshShellInputs.getCloseSession(), Constants.DEFAULT_CLOSE_SESSION); if (closeSessionBoolean) { cleanupService(sshShellInputs, service, sessionId); } else if (saveSSHSession) { // save SSH session in the cache final boolean saved = saveToCache(sshShellInputs.getSshGlobalSessionObject(), service, sessionId); if (!saved) { throw new RuntimeException("The SSH session could not be saved in the given sessionParam."); } } }
private void handleSessionClosure(SSHShellInputs sshShellInputs, SSHService service, String sessionId, boolean saveSSHSession) { boolean closeSessionBoolean = StringUtils.toBoolean(sshShellInputs.getCloseSession(), Constants.DEFAULT_CLOSE_SESSION); if (closeSessionBoolean) { cleanupService(sshShellInputs, service, sessionId); } else if (saveSSHSession) { // save SSH session in the cache final boolean saved = saveToCache(sshShellInputs.getSshGlobalSessionObject(), service, sessionId); if (!saved) { throw new RuntimeException("The SSH session could not be saved in the given sessionParam."); } } }
private void handleSessionClosure(SSHShellInputs sshShellInputs, SSHService service, String sessionId, boolean saveSSHSession) { boolean closeSessionBoolean = StringUtils.toBoolean(sshShellInputs.getCloseSession(), Constants.DEFAULT_CLOSE_SESSION); if (closeSessionBoolean) { cleanupService(sshShellInputs, service, sessionId); } else if (saveSSHSession) { // save SSH session in the cache final boolean saved = saveToCache(sshShellInputs.getSshGlobalSessionObject(), service, sessionId); if (!saved) { throw new RuntimeException("The SSH session could not be saved in the given sessionParam."); } } }