2 * ===============================LICENSE_START======================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============================LICENSE_END===========================================
21 package org.openecomp.dcae.apod.analytics.model.domain.policy.tca;
24 import lombok.EqualsAndHashCode;
25 import org.openecomp.dcae.apod.analytics.model.domain.cef.EventSeverity;
29 * @author Rajiv Singla . Creation Date: 11/5/2016.
32 @EqualsAndHashCode(callSuper = true)
33 public class Threshold extends BaseTCAPolicyModel {
35 private static final long serialVersionUID = 1L;
38 * Closed Loop Control Name
40 * @param closedLoopControlName New value for Closed Loop Control Name
41 * @return Closed Loop Control Name
43 private String closedLoopControlName;
48 * @param version New value for Threshold Version
49 * @return Threshold Version
51 private String version;
54 * Path of the field inside Common Event Format which needs to be monitored by TCA App
55 * for threshold crossing
57 * @param fieldPath New value for Path of the field inside CEF which needs to be monitored for TCA
58 * @return Path of the field inside Common Event Format which needs to be monitored by TCA App
60 private String fieldPath;
65 * @param thresholdValue New value for Threshold Value
66 * @return Threshold Value
68 private Long thresholdValue;
71 * Direction of threshold
73 * @param direction New value for Direction of threshold
74 * @return Direction of threshold
76 private Direction direction;
79 * Severity of Event based on CEF Convention
81 * @param severity New value for Severity of Event based on CEF Convention
82 * @return Severity of Event based on CEF Convention
84 private EventSeverity severity;
88 * Actual Field value that caused the threshold violation. Ignored for deserialization
91 * @param actualFieldValue new value value for actual Field value that caused the violation
92 * @return actual field value that caused the violation
94 private Long actualFieldValue;
97 * Creates a copy of give {@link Threshold}
99 * @param threshold threshold that need to be copied
101 * @return new instance of threshold with copied value for give threshold
103 public static Threshold copy(final Threshold threshold) {
104 final Threshold newThreshold = new Threshold();
105 newThreshold.setClosedLoopControlName(threshold.getClosedLoopControlName());
106 newThreshold.setFieldPath(threshold.getFieldPath());
107 newThreshold.setThresholdValue(threshold.getThresholdValue());
108 newThreshold.setDirection(threshold.getDirection());
109 newThreshold.setSeverity(threshold.getSeverity());
110 newThreshold.setActualFieldValue(threshold.getActualFieldValue());