All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.symphonyoss.symphony.clients.jmx.ClientCheck Maven / Gradle / Ivy

The newest version!
package org.symphonyoss.symphony.clients.jmx;

import org.symphonyoss.client.SymphonyClient;
import org.symphonyoss.client.exceptions.SystemException;
import org.symphonyoss.symphony.clients.AgentSystemClient;
import org.symphonyoss.symphony.clients.AgentSystemClientFactory;
import org.symphonyoss.symphony.clients.model.SymAgentHealthCheck;

public class ClientCheck implements ClientCheckMBean {

    AgentSystemClient agentSystemClient;

    public ClientCheck(SymphonyClient symClient) {
        this.agentSystemClient = AgentSystemClientFactory.getClient(symClient);
    }

    @Override
    public SymAgentHealthCheck fetchFullDetail() throws SystemException {
        return this.agentSystemClient.getAgentHealthCheck();
    }

    @Override
    public Boolean isUp() throws SystemException {
        if (fetchFullDetail().isUp()) {
            return true;
        } else {
            throw new SystemException("Symphony java client is down!\n"+fetchFullDetail().toString());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy