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
29 * @author Rajiv Singla . Creation Date: 11/5/2016.
\r
32 @EqualsAndHashCode(callSuper = true)
\r
33 public class Threshold extends BaseTCAPolicyModel {
\r
35 private static final long serialVersionUID = 1L;
\r
38 * Closed Loop Control Name
\r
40 * @param closedLoopControlName New value for Closed Loop Control Name
\r
41 * @return Closed Loop Control Name
\r
43 private String closedLoopControlName;
\r
47 * Closed Loop Event Status
\r
49 * @param closedLoopEventStatus New value for Closed Loop Event Status
\r
50 * @return Closed Loop Event Status
\r
52 private ClosedLoopEventStatus closedLoopEventStatus;
\r
57 * @param version New value for Threshold Version
\r
58 * @return Threshold Version
\r
60 private String version;
\r
63 * Path of the field inside Common Event Format which needs to be monitored by TCA App
\r
64 * for threshold crossing
\r
66 * @param fieldPath New value for Path of the field inside CEF which needs to be monitored for TCA
\r
67 * @return Path of the field inside Common Event Format which needs to be monitored by TCA App
\r
69 private String fieldPath;
\r
74 * @param thresholdValue New value for Threshold Value
\r
75 * @return Threshold Value
\r
77 private Long thresholdValue;
\r
80 * Direction of threshold
\r
82 * @param direction New value for Direction of threshold
\r
83 * @return Direction of threshold
\r
85 private Direction direction;
\r
88 * Severity of Event based on CEF Convention
\r
90 * @param severity New value for Severity of Event based on CEF Convention
\r
91 * @return Severity of Event based on CEF Convention
\r
93 private EventSeverity severity;
\r
97 * Actual Field value that caused the threshold violation. Note: Ignored for serialization / deserialization
\r
100 * @param actualFieldValue new value for actual Field value that caused the violation
\r
101 * @return actual field value that caused the violation
\r
103 private Long actualFieldValue;
\r
106 * Creates a deep copy of give {@link Threshold}
\r
108 * @param threshold threshold that need to be copied
\r
110 * @return new instance of threshold with copied value for give threshold
\r
112 public static Threshold copy(final Threshold threshold) {
\r
113 final Threshold newThreshold = new Threshold();
\r
114 newThreshold.setClosedLoopControlName(threshold.getClosedLoopControlName());
\r
115 newThreshold.setClosedLoopEventStatus(threshold.getClosedLoopEventStatus());
\r
116 newThreshold.setFieldPath(threshold.getFieldPath());
\r
117 newThreshold.setThresholdValue(threshold.getThresholdValue());
\r
118 newThreshold.setDirection(threshold.getDirection());
\r
119 newThreshold.setSeverity(threshold.getSeverity());
\r
120 newThreshold.setActualFieldValue(threshold.getActualFieldValue());
\r
121 return newThreshold;
\r