package eu.univento.commons.security; import eu.univento.commons.Commons; import java.sql.SQLException; import java.util.function.Consumer; /** * @author joethei * @version 0.1 */ public class SecurityHandler { private Commons commons; public SecurityHandler(Commons commons) { this.commons = commons; } public void isValidServer(String ip, Consumer consumer) { commons.getDatabaseManager().getAsyncMySQL().query("SELECT * FROM Servers WHERE ip='" + ip + "';", resultSet -> { try { consumer.accept(resultSet.next()); } catch (SQLException e) { e.printStackTrace(); consumer.accept(false); } }); } }