class DataBaseCheck extends HealthCheck {

	@Override
	protected Result check() {	
        Mongo mongo = null;
        
		try{
			final ServerAddress adress = new ServerAddress(config.getHost() , config.getPort());
            mongo = new MongoClient(adress);

            final StringBuilder sb = new StringBuilder();
            sb.append("MogoDb version " + mongo.getVersion() + '\n');

            sb.append("  Available databases: ");
            for(final String dbName: mongo.getDatabaseNames()){
                sb.append(dbName);
                sb.append(' ');
            }
            sb.append('\n');

            return Result.healthy(sb.toString());

		}
		catch (Exception e) {
			return Result.unhealthy(e);
		}
        finally{
            if(mongo != null){
                mongo.close();
            }
        }
	}

	public  DataBaseCheck(final DataBaseConfig dataBaseConfig);

}