aboutsummaryrefslogtreecommitdiffstats
path: root/dcae-analytics-model/src/main/java/org/openecomp/dcae/apod/analytics/model/domain/policy/tca/Threshold.java
blob: e05cc26e4ea6260833a4853879dd5ac05a59f4bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
 * ===============================LICENSE_START======================================
 *  dcae-analytics
 * ================================================================================
 *    Copyright © 2017 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  ============================LICENSE_END===========================================
 */

package org.openecomp.dcae.apod.analytics.model.domain.policy.tca;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.openecomp.dcae.apod.analytics.model.domain.cef.EventSeverity;

/**
 *
 * @author Rajiv Singla . Creation Date: 11/5/2016.
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Threshold extends BaseTCAPolicyModel {

    private static final long serialVersionUID = 1L;

    /**
     * Closed Loop Control Name
     *
     * @param closedLoopControlName New value for Closed Loop Control Name
     * @return Closed Loop Control Name
     */
    private String closedLoopControlName;


    /**
     * Closed Loop Event Status
     *
     * @param closedLoopEventStatus New value for Closed Loop Event Status
     * @return Closed Loop Event Status
     */
    private ControlLoopEventStatus closedLoopEventStatus;

    /**
     * Threshold Version
     *
     * @param version New value for Threshold Version
     * @return Threshold Version
     */
    private String version;

    /**
     * Path of the field inside Common Event Format which needs to be monitored by TCA App
     * for threshold crossing
     *
     * @param fieldPath New value for Path of the field inside CEF which needs to be monitored for TCA
     * @return Path of the field inside Common Event Format which needs to be monitored by TCA App
     */
    private String fieldPath;

    /**
     * Threshold Value
     *
     * @param thresholdValue New value for Threshold Value
     * @return Threshold Value
     */
    private Long thresholdValue;

    /**
     * Direction of threshold
     *
     * @param direction New value for Direction of threshold
     * @return Direction of threshold
     */
    private Direction direction;

    /**
     * Severity of Event based on CEF Convention
     *
     * @param severity New value for Severity of Event based on CEF Convention
     * @return Severity of Event based on CEF Convention
     */
    private EventSeverity severity;


    /**
     * Actual Field value that caused the threshold violation. Note: Ignored for serialization / deserialization
     *
     *
     * @param actualFieldValue new value for actual Field value that caused the violation
     * @return actual field value that caused the violation
     */
    private Long actualFieldValue;

    /**
     * Creates a deep copy of give {@link Threshold}
     *
     * @param threshold threshold that need to be copied
     *
     * @return new instance of threshold with copied value for give threshold
     */
    public static Threshold copy(final Threshold threshold) {
        final Threshold newThreshold = new Threshold();
        newThreshold.setClosedLoopControlName(threshold.getClosedLoopControlName());
        newThreshold.setClosedLoopEventStatus(threshold.getClosedLoopEventStatus());
        newThreshold.setFieldPath(threshold.getFieldPath());
        newThreshold.setThresholdValue(threshold.getThresholdValue());
        newThreshold.setDirection(threshold.getDirection());
        newThreshold.setSeverity(threshold.getSeverity());
        newThreshold.setActualFieldValue(threshold.getActualFieldValue());
        return newThreshold;
    }

}