/** * Sets the list of probe patterns. * * @param strPatternList * The new list with pattern strings. * * @param updateConfig * Whether the pattern file should be updated or not. */ protected void setProbePatternList(final List<String> strPatternList, final boolean updateConfig) { if (!this.enabled) { LOGGER.warn("Adapative Monitoring is disabled!"); return; } synchronized (this) { this.patterns.clear(); this.signatureCache.clear(); for (final String pattern : strPatternList) { this.addToPatternEntryList(pattern); } if (updateConfig && this.configFileUpdate) { this.updatePatternFile(); } } }
private boolean addPattern(final String strPattern, final boolean activated) { if (!this.enabled) { LOGGER.warn("Adapative Monitoring is disabled!"); return false; } synchronized (this) { // we must always clear the cache! this.signatureCache.clear(); final Pattern pattern; try { pattern = PatternParser.parseToPattern(strPattern); } catch (final InvalidPatternException ex) { LOGGER.error("'{}' is not a valid pattern.", strPattern, ex); return false; } this.patterns.add(new PatternEntry(strPattern, pattern, activated)); if (this.configFileUpdate) { this.updatePatternFile(); } } return true; }
/** * Sets the list of probe patterns. * * @param strPatternList * The new list with pattern strings. * * @param updateConfig * Whether the pattern file should be updated or not. */ protected void setProbePatternList(final List<String> strPatternList, final boolean updateConfig) { if (!this.enabled) { LOG.warn("Adapative Monitoring is disabled!"); return; } synchronized (this) { this.patternList.clear(); this.signatureCache.clear(); for (final String pattern : strPatternList) { this.addToPatternEntryList(pattern); } if (updateConfig && this.configFileUpdate) { this.updatePatternFile(); } } }
private boolean addPattern(final String strPattern, final boolean activated) { if (!this.enabled) { LOG.warn("Adapative Monitoring is disabled!"); return false; } synchronized (this) { // we must always clear the cache! this.signatureCache.clear(); final Pattern pattern; try { pattern = PatternParser.parseToPattern(strPattern); } catch (final InvalidPatternException ex) { LOG.error("'" + strPattern + "' is not a valid pattern.", ex); return false; } this.patternList.add(new PatternEntry(strPattern, pattern, activated)); if (this.configFileUpdate) { this.updatePatternFile(); } } return true; }