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

com.frightanic.smn.health.SmnHealthCheck Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package com.frightanic.smn.health;

import com.frightanic.smn.core.GeoAdmin;
import com.codahale.metrics.health.HealthCheck;

import java.io.IOException;

public class SmnHealthCheck extends HealthCheck {
  private final GeoAdmin geoAdmin;

  public SmnHealthCheck(GeoAdmin geoAdmin) {
    this.geoAdmin = geoAdmin;
  }

  @Override
  protected Result check() throws IOException {
    if (geoAdmin.getSmnData().getAllRecords().size() > 0) {
      return Result.healthy();
    } else {
      return Result.unhealthy("No SMN data available.");
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy