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 {
        return fetchFullDetail().isUp();
    }
}

@@ -806,40 +806,194 @@
     
-return fetchFullDetail().isUp();
+if (fetchFullDetail().isUp()) %7B%0A            return true;%0A        %7D else %7B%0A            throw new SystemException(%22Symphony java client is down!%5Cn%22+fetchFullDetail().toString());%0A        %7D
 %0A   

throw checked exception if JMX check is not up