blob: dc3ade7ee1445c36913795249a124f76f50d7083 [file] [log] [blame]
package pta.de.health;
import com.codahale.metrics.health.HealthCheck;
import pta.de.api.ServiceDistributionCluster;
import pta.de.core.controller.ServicesConfigCache;
public class ConfigFilePresentHealthCheck extends HealthCheck {
@Override
protected Result check() throws Exception {
ServiceDistributionCluster[] sdc = ServicesConfigCache.getInstance().getCache(); // Throws Exception if it fails
if( sdc.length > 0 ) {
return Result.healthy();
}
else {
return Result.unhealthy("No ServiceDistributionCluster available!");
}
}
}