/** * <p>merge</p> * * @param threshold a {@link org.opennms.netmgt.threshd.BaseThresholdDefConfigWrapper} object. */ public void merge(BaseThresholdDefConfigWrapper threshold) { m_baseDef = threshold.getBasethresholddef(); }
/** * Returns the names of the datasources required from the resource filters * * @return Collection of the names of datasources */ public List<String> getFilterDatasources() { final List<String> dataSources = new ArrayList<>(); for (ResourceFilter s : getBasethresholddef().getResourceFilters()) { dataSources.add(s.getField()); } return dataSources; }
/** {@inheritDoc} */ @Override public boolean equals(final Object obj) { if ( this == obj ) { return true; } if (obj instanceof BaseThresholdDefConfigWrapper) { final BaseThresholdDefConfigWrapper that = (BaseThresholdDefConfigWrapper)obj; return Objects.equals(this.getType(), that.getType()) && Objects.equals(this.getDsType(), that.getDsType()) && Objects.equals(this.getDatasourceExpression(), that.getDatasourceExpression()) && Objects.equals(this.getDsLabel(), that.getDsLabel()) && Objects.equals(this.getTriggeredUEI(), that.getTriggeredUEI()) && Objects.equals(this.getRearmedUEI(), that.getRearmedUEI()) && Objects.equals(this.getValue(), that.getValue()) && Objects.equals(this.getRearm(), that.getRearm()) && Objects.equals(this.getTrigger(), that.getTrigger()) && Objects.equals(this.getBasethresholddef().getFilterOperator(), that.getBasethresholddef().getFilterOperator()) && Objects.equals(this.getBasethresholddef().getRelaxed(), that.getBasethresholddef().getRelaxed()) && Objects.equals(this.getBasethresholddef().getResourceFilters(), that.getBasethresholddef().getResourceFilters()); } return false; }
final Map<String, Double> values = new HashMap<String,Double>(); boolean valueMissing = false; boolean relaxed = thresholdEntity.getThresholdConfig().getBasethresholddef().getRelaxed(); for(final String ds : requiredDatasources) { final Double dsValue = resourceWrapper.getAttributeValue(ds);
final List<ResourceFilter> filters = thresholdEntity.getThresholdConfig().getBasethresholddef().getResourceFilters(); if (filters.size() == 0) return true; final FilterOperator operator = thresholdEntity.getThresholdConfig().getBasethresholddef().getFilterOperator(); boolean andResult = true; for (ResourceFilter f : filters) {
final String descr = getThresholdConfig().getBasethresholddef().getDescription().orElse(getThresholdConfig().getDatasourceExpression()); bldr.addParam("description", descr);