@PostConstruct public void init() throws Exception { try { initSqlQueries(datasource.getConnection(), sqlFileUrl); // create table if not exist createTable("greyListTableName", "createGreyListTable"); } catch (Exception e) { throw new RuntimeException("Unable to init datasource", e); } }
/** * Setup the autowhitelist lifetime for which we should whitelist a triplet. * After this lifetime the record will be deleted * * @param autoWhiteListLifeTime * The lifeTime */ public void setAutoWhiteListLifeTime(String autoWhiteListLifeTime) { setAutoWhiteListLifeTime(TimeConverter.getMilliSeconds(autoWhiteListLifeTime)); }
/** * Setup the temporary blocking time * * @param tempBlockTime * The temporary blocking time */ public void setTempBlockTime(String tempBlockTime) { setTempBlockTime(TimeConverter.getMilliSeconds(tempBlockTime)); }
@Override public void init(Configuration handlerConfiguration) throws ConfigurationException { try { setTempBlockTime(handlerConfiguration.getString("tempBlockTime")); } catch (NumberFormatException e) { throw new ConfigurationException(e.getMessage()); setAutoWhiteListLifeTime(handlerConfiguration.getString("autoWhiteListLifeTime")); } catch (NumberFormatException e) { throw new ConfigurationException(e.getMessage()); setUnseenLifeTime(handlerConfiguration.getString("unseenLifeTime")); } catch (NumberFormatException e) { throw new ConfigurationException(e.getMessage()); LOGGER.info("Whitelisted addresses: {}", getWhiteListedNetworks()); if (sFile != null) { setSqlFileUrl(sFile); initSqlQueries(datasource.getConnection(), sqlFileUrl); createTable("greyListTableName", "createGreyListTable"); } catch (Exception e) { throw new RuntimeException("Unable to init datasource", e);
setTempBlockTime(handlerConfiguration.getString("tempBlockTime")); } catch (NumberFormatException e) { throw new ConfigurationException(e.getMessage()); setAutoWhiteListLifeTime(handlerConfiguration.getString("autoWhiteListLifeTime")); } catch (NumberFormatException e) { throw new ConfigurationException(e.getMessage()); setUnseenLifeTime(handlerConfiguration.getString("unseenLifeTime")); } catch (NumberFormatException e) { throw new ConfigurationException(e.getMessage()); wList.add(whitelistArray[i].trim()); setWhiteListedNetworks( new NetMatcher(wList ,dnsService)); serviceLog.info("Whitelisted addresses: " + getWhiteListedNetworks().toString()); if (sFile != null) { setSqlFileUrl(sFile);
/** * Set up the liftime of only once seen triplet. After this liftime the * record will be deleted * * @param unseenLifeTime * The lifetime */ public void setUnseenLifeTime(String unseenLifeTime) { setUnseenLifeTime(TimeConverter.getMilliSeconds(unseenLifeTime)); }
/** * Set up the liftime of only once seen triplet. After this liftime the * record will be deleted * * @param unseenLifeTime * The lifetime */ public void setUnseenLifeTime(String unseenLifeTime) { setUnseenLifeTime(TimeConverter.getMilliSeconds(unseenLifeTime)); }
/** * Setup the temporary blocking time * * @param tempBlockTime * The temporary blocking time */ public void setTempBlockTime(String tempBlockTime) { setTempBlockTime(TimeConverter.getMilliSeconds(tempBlockTime)); }
/** * Setup the autowhitelist lifetime for which we should whitelist a triplet. * After this lifetime the record will be deleted * * @param autoWhiteListLifeTime * The lifeTime */ public void setAutoWhiteListLifeTime(String autoWhiteListLifeTime) { setAutoWhiteListLifeTime(TimeConverter.getMilliSeconds(autoWhiteListLifeTime)); }