HealthzIO.java

  1. package de.dlr.shepard.neo4Core.io;

  2. import io.swagger.v3.oas.annotations.media.Schema;
  3. import lombok.Data;
  4. import lombok.NoArgsConstructor;

  5. enum Healthy {
  6.     healthy, unhealthy
  7. }

  8. @Data
  9. @Schema(name = "Healthz")
  10. @NoArgsConstructor
  11. public class HealthzIO {
  12.     private Healthy shepard;
  13.     private Healthy neo4j;
  14.     private Healthy mongodb;
  15.     private Healthy influxdb;

  16.     public HealthzIO(boolean neo4j, boolean mongodb, boolean influxdb) {
  17.         this.shepard = Healthy.healthy;
  18.         this.neo4j = neo4j ? Healthy.healthy : Healthy.unhealthy;
  19.         this.mongodb = mongodb ? Healthy.healthy : Healthy.unhealthy;
  20.         this.influxdb = influxdb ? Healthy.healthy : Healthy.unhealthy;
  21.     }
  22. }