sam-server/src/main/java/se/atg/sam/ui/dropwizard/db/MongoDatabaseHealthCheck.java
/**
   * Checks if the system database, available in all MongoDB instances can be
   * reached.
   */
Checks if the system database, available in all MongoDB instances can be
reached.
Checks if the system database available in all MongoDB instances can be reached .
@Override
  protected Result check() throws Exception {
    try {
      final Document result = mongoDatabase.runCommand(new Document("dbStats", 1));
      return Result.healthy(result.toJson());
    } catch (MongoClientException exc) {
      logger.warn("Unhealthy database", exc);
      return Result.unhealthy(exc);
    }
  }
@ Override protected Result check ( ) throws Exception { try { final Document result = mongoDatabase . runCommand ( new Document ( "dbStats" , 1 ) ) ; return Result . healthy ( result . toJson ( ) ) ; } catch ( MongoClientException exc ) { logger . warn ( "Unhealthy database" , exc ) ; return Result . unhealthy ( exc ) ; } }
Checks if the system database, available in all MongoDB instances can be
 reached.
Checks if the system database available in all MongoDB instances can be reached .