Search in sources :

Example 1 with Template

use of de.cinovo.cloudconductor.api.model.Template in project cloudconductor-agent-redhat by cinovo.

the class NodeAgent method checkServer.

private boolean checkServer() throws ServerConnectionException {
    NodeAgent.LOGGER.info("Perform first authentication...");
    new RefreshJWTJob().run();
    NodeAgent.LOGGER.info("Get template from server...");
    try {
        Template template = ServerCom.getTemplate();
        if (template != null) {
            return true;
        }
        throw new ServerConnectionException();
    } catch (CloudConductorException e) {
        NodeAgent.LOGGER.error("Error getting template from server: ", e);
        throw new ServerConnectionException();
    }
}
Also used : CloudConductorException(de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException) ServerConnectionException(de.cinovo.cloudconductor.agent.exceptions.ServerConnectionException) RefreshJWTJob(de.cinovo.cloudconductor.agent.jobs.RefreshJWTJob) Template(de.cinovo.cloudconductor.api.model.Template)

Aggregations

ServerConnectionException (de.cinovo.cloudconductor.agent.exceptions.ServerConnectionException)1 RefreshJWTJob (de.cinovo.cloudconductor.agent.jobs.RefreshJWTJob)1 CloudConductorException (de.cinovo.cloudconductor.api.lib.exceptions.CloudConductorException)1 Template (de.cinovo.cloudconductor.api.model.Template)1