- private void execute() throws SQLException {
-
- ResultSet rs = searchNeededPings.executeQuery();
- while (rs.next()) {
- String type = rs.getString("type");
- String config = rs.getString("info");
- DomainPinger dp = pingers.get(type);
- if (dp != null) {
- String token = null;
- if (dp instanceof EmailPinger) {
- token = RandomToken.generateToken(16);
- config = config + ":" + token;
- }
- updatePingStatus.setInt(1, rs.getInt("id"));
- updatePingStatus.execute();
- enterPingResult.setInt(1, rs.getInt("id"));
- String resp = dp.ping(Domain.getById(rs.getInt("domainid")), config, User.getById(rs.getInt("memid")));
- enterPingResult.setString(2, DomainPinger.PING_STILL_PENDING == resp ? "open" : DomainPinger.PING_SUCCEDED.equals(resp) ? "success" : "failed");
- enterPingResult.setString(3, resp);
- enterPingResult.setString(4, token);
- enterPingResult.execute();
+ private void handle(DomainPingConfiguration conf) {
+ PingType type = conf.getType();
+ String config = conf.getInfo();
+ DomainPinger dp = pingers.get(type);
+ if (dp != null) {
+ String token = null;
+ if (dp instanceof EmailPinger) {
+ token = RandomToken.generateToken(16);
+ config = config + ":" + token;