2 * ===============================LICENSE_START======================================
\r
4 * ================================================================================
\r
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============================LICENSE_END===========================================
\r
21 package org.openecomp.dcae.apod.analytics.model.domain.policy.tca;
\r
24 import lombok.EqualsAndHashCode;
\r
25 import org.openecomp.dcae.apod.analytics.model.domain.cef.EventSeverity;
\r
27 import java.math.BigDecimal;
\r
31 * @author Rajiv Singla . Creation Date: 11/5/2016.
\r
34 @EqualsAndHashCode(callSuper = true)
\r
35 public class Threshold extends BaseTCAPolicyModel {
\r
37 private static final long serialVersionUID = 1L;
\r
40 * Closed Loop Control Name
\r
42 * @param closedLoopControlName New value for Closed Loop Control Name
\r
43 * @return Closed Loop Control Name
\r
45 private String closedLoopControlName;
\r
49 * Closed Loop Event Status
\r
51 * @param closedLoopEventStatus New value for Closed Loop Event Status
\r
52 * @return Closed Loop Event Status
\r
54 private ClosedLoopEventStatus closedLoopEventStatus;
\r
59 * @param version New value for Threshold Version
\r
60 * @return Threshold Version
\r
62 private String version;
\r
65 * Path of the field inside Common Event Format which needs to be monitored by TCA App
\r
66 * for threshold crossing
\r
68 * @param fieldPath New value for Path of the field inside CEF which needs to be monitored for TCA
\r
69 * @return Path of the field inside Common Event Format which needs to be monitored by TCA App
\r
71 private String fieldPath;
\r
76 * @param thresholdValue New value for Threshold Value
\r
77 * @return Threshold Value
\r
79 private Long thresholdValue;
\r
82 * Direction of threshold
\r
84 * @param direction New value for Direction of threshold
\r
85 * @return Direction of threshold
\r
87 private Direction direction;
\r
90 * Severity of Event based on CEF Convention
\r
92 * @param severity New value for Severity of Event based on CEF Convention
\r
93 * @return Severity of Event based on CEF Convention
\r
95 private EventSeverity severity;
\r
99 * Actual Field value that caused the threshold violation. Note: Ignored for serialization / deserialization
\r
102 * @param actualFieldValue new value for actual Field value that caused the violation
\r
103 * @return actual field value that caused the violation
\r
105 private BigDecimal actualFieldValue;
\r
108 * Creates a deep copy of give {@link Threshold}
\r
110 * @param threshold threshold that need to be copied
\r
112 * @return new instance of threshold with copied value for give threshold
\r
114 public static Threshold copy(final Threshold threshold) {
\r
115 final Threshold newThreshold = new Threshold();
\r
116 newThreshold.setClosedLoopControlName(threshold.getClosedLoopControlName());
\r
117 newThreshold.setClosedLoopEventStatus(threshold.getClosedLoopEventStatus());
\r
118 newThreshold.setFieldPath(threshold.getFieldPath());
\r
119 newThreshold.setThresholdValue(threshold.getThresholdValue());
\r
120 newThreshold.setDirection(threshold.getDirection());
\r
121 newThreshold.setSeverity(threshold.getSeverity());
\r
122 newThreshold.setActualFieldValue(threshold.getActualFieldValue());
\r
123 return newThreshold;
\r