use of com.axway.ats.core.ssh.JschSftpClient in project ats-framework by Axway.
the class AgentController method isAgentInstalled.
/**
* Check whether the agent is installed or not. Currently are just checking
* whether the agentapp.war file is existing on the right place.
*
* @param agentAlias the agent alias declared in the configuration
* @return <code>true</code> if the ATS Agent is installed
* @throws AtsManagerException
*/
private boolean isAgentInstalled(AbstractApplicationInfo agentInfo) throws AtsManagerException {
JschSftpClient sftpClient = new JschSftpClient();
try {
sftpClient.connect(agentInfo.systemUser, agentInfo.systemPassword, agentInfo.host, agentInfo.sshPort, agentInfo.sshPrivateKey, agentInfo.sshPrivateKeyPassword);
boolean isDeployed = sftpClient.isRemoteFileOrDirectoryExisting(agentInfo.getSftpHome() + "ats-agent/webapp/agentapp.war");
log.info(agentInfo.getDescription() + " seems " + (isDeployed ? "" : "not") + " deployed in " + agentInfo.getSftpHome());
return isDeployed;
} finally {
sftpClient.disconnect();
}
}
Aggregations