Skip to content

Commit

Permalink
add Optional/clean up thresholding
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Apr 24, 2017
1 parent 4dd6d26 commit a139e27
Show file tree
Hide file tree
Showing 40 changed files with 1,235 additions and 4,002 deletions.

Large diffs are not rendered by default.

@@ -1,7 +1,7 @@
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2017-2017 The OpenNMS Group, Inc.
* Copyright (C) 2017 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2017 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
Expand Down Expand Up @@ -29,110 +29,75 @@
package org.opennms.netmgt.config.threshd;


import java.io.Serializable;
import java.util.Objects;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

import org.opennms.core.xml.ValidateUsing;
import org.opennms.netmgt.config.utils.ConfigUtils;

/**
* Range of adresses to be excluded from this
* Range of addresses to be excluded from this
* package
*
* @version $Revision$ $Date$
*/
@XmlRootElement(name = "exclude-range")
@XmlAccessorType(XmlAccessType.FIELD)
public class ExcludeRange implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@ValidateUsing("thresholding.xsd")
public class ExcludeRange implements Serializable {
private static final long serialVersionUID = 2L;

/**
* Starting address of the range
*/
@XmlAttribute(name = "begin", required = true)
private String begin;
private String m_begin;

/**
* Ending address of the range
*/
@XmlAttribute(name = "end", required = true)
private String end;
private String m_end;

public ExcludeRange() {
}

/**
* Overrides the Object.equals method.
*
* @param obj
* @return true if the objects are equal.
*/
@Override
public boolean equals(final Object obj) {
if ( this == obj ) {
return true;
}

if (obj instanceof ExcludeRange) {
ExcludeRange temp = (ExcludeRange)obj;
boolean equals = Objects.equals(temp.begin, begin)
&& Objects.equals(temp.end, end);
return equals;
}
return false;
public String getBegin() {
return m_begin;
}

/**
* Returns the value of field 'begin'. The field 'begin' has the following
* description: Starting address of the range
*
* @return the value of field 'Begin'.
*/
public String getBegin() {
return this.begin;
public void setBegin(final String begin) {
m_begin = ConfigUtils.assertNotEmpty(begin, "begin");
}

/**
* Returns the value of field 'end'. The field 'end' has the following
* description: Ending address of the range
*
* @return the value of field 'End'.
*/
public String getEnd() {
return this.end;
return m_end;
}

public void setEnd(final String end) {
m_end = ConfigUtils.assertNotEmpty(end, "end");
}

/**
* Method hashCode.
*
* @return a hash code value for the object.
*/
@Override
public int hashCode() {
int hash = Objects.hash(
begin,
end);
return hash;
return Objects.hash(m_begin, m_end);
}

/**
* Sets the value of field 'begin'. The field 'begin' has the following
* description: Starting address of the range
*
* @param begin the value of field 'begin'.
*/
public void setBegin(final String begin) {
this.begin = begin;
}
@Override
public boolean equals(final Object obj) {
if ( this == obj ) {
return true;
}

/**
* Sets the value of field 'end'. The field 'end' has the following
* description: Ending address of the range
*
* @param end the value of field 'end'.
*/
public void setEnd(final String end) {
this.end = end;
if (obj instanceof ExcludeRange) {
final ExcludeRange that = (ExcludeRange)obj;
return Objects.equals(this.m_begin, that.m_begin)
&& Objects.equals(this.m_end, that.m_end);
}
return false;
}

}
@@ -1,7 +1,7 @@
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2017-2017 The OpenNMS Group, Inc.
* Copyright (C) 2017 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2017 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
Expand Down Expand Up @@ -29,93 +29,65 @@
package org.opennms.netmgt.config.threshd;


import java.io.Serializable;
import java.util.Objects;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

import org.opennms.core.xml.ValidateUsing;
import org.opennms.netmgt.config.utils.ConfigUtils;

/**
* Threshold definition
*
* @version $Revision$ $Date$
*/
@XmlRootElement(name = "expression")
@XmlAccessorType(XmlAccessType.FIELD)
public class Expression extends Basethresholddef implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@ValidateUsing("thresholding.xsd")
public class Expression extends Basethresholddef implements Serializable {
private static final long serialVersionUID = 2L;

/**
* An expression of Datasource names and constants to be
* evaluate
*
*/
@XmlAttribute(name = "expression", required = true)
private String expression;
private String m_expression;

public Expression() {
}

/**
* Overrides the Object.equals method.
*
* @param obj
* @return true if the objects are equal.
*/
public String getExpression() {
return m_expression;
}

public void setExpression(final String expression) {
m_expression = ConfigUtils.assertNotEmpty(expression, "expression");
}

@Override
public int hashCode() {
return super.hashCode() + Objects.hash(m_expression);
}

@Override
public boolean equals(final Object obj) {
if ( this == obj ) {
return true;
}

if (super.equals(obj)==false) {
return false;
}

if (obj instanceof Expression) {
Expression temp = (Expression)obj;
boolean equals = Objects.equals(temp.expression, expression);
return equals;
final Expression that = (Expression)obj;
return Objects.equals(this.m_expression, that.m_expression);
}
return false;
}

/**
* Returns the value of field 'expression'. The field 'expression' has the
* following description: An expression of Datasource names and constants to
* be
* evaluate
*
*
* @return the value of field 'Expression'.
*/
public String getExpression() {
return this.expression;
}

/**
* Method hashCode.
*
* @return a hash code value for the object.
*/
@Override
public int hashCode() {
int hash = Objects.hash(
expression);
return hash;
}

/**
* Sets the value of field 'expression'. The field 'expression' has the
* following description: An expression of Datasource names and constants to
* be
* evaluate
*
*
* @param expression the value of field 'expression'.
*/
public void setExpression(final String expression) {
this.expression = expression;
}

}

0 comments on commit a139e27

Please sign in to comment.