aboutsummaryrefslogtreecommitdiffstats
path: root/UniversalVesAdapter/src/main/java/org/onap/dcaegen2/ves/domain/ves7_0/ThresholdCrossingAlertFields.java
blob: daa98559c4a0fd7e97fd7a1003a5085232904aef (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
/*
* ============LICENSE_START=======================================================
* ONAP : DCAE
* ================================================================================
* Copyright 2018 TechMahindra
*=================================================================================
* 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.onap.dcaegen2.ves.domain.ves7_0;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/**
 * fields specific to threshold crossing alert events
 * 
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "additionalFields",
    "additionalParameters",
    "alertAction",
    "alertDescription",
    "alertType",
    "alertValue",
    "associatedAlertIdList",
    "collectionTimestamp",
    "dataCollector",
    "elementType",
    "eventSeverity",
    "eventStartTimestamp",
    "interfaceName",
    "networkService",
    "possibleRootCause",
    "thresholdCrossingFieldsVersion"
})
public class ThresholdCrossingAlertFields {

    /**
     * an associative array which is an array of key:value pairs
     * 
     */
    @JsonProperty("additionalFields")
    @JsonPropertyDescription("an associative array which is an array of key:value pairs")
    private AlarmAdditionalInformation additionalFields;
    /**
     * performance counters
     * (Required)
     * 
     */
    @JsonProperty("additionalParameters")
    @JsonPropertyDescription("performance counters")
    private List<AdditionalParameter> additionalParameters = new ArrayList<AdditionalParameter>();
    /**
     * Event action
     * (Required)
     * 
     */
    @JsonProperty("alertAction")
    @JsonPropertyDescription("Event action")
    private ThresholdCrossingAlertFields.AlertAction alertAction;
    /**
     * Unique short alert description such as IF-SHUB-ERRDROP
     * (Required)
     * 
     */
    @JsonProperty("alertDescription")
    @JsonPropertyDescription("Unique short alert description such as IF-SHUB-ERRDROP")
    private String alertDescription;
    /**
     * Event type
     * (Required)
     * 
     */
    @JsonProperty("alertType")
    @JsonPropertyDescription("Event type")
    private ThresholdCrossingAlertFields.AlertType alertType;
    /**
     * Calculated API value (if applicable)
     * 
     */
    @JsonProperty("alertValue")
    @JsonPropertyDescription("Calculated API value (if applicable)")
    private String alertValue;
    /**
     * List of eventIds associated with the event being reported
     * 
     */
    @JsonProperty("associatedAlertIdList")
    @JsonPropertyDescription("List of eventIds associated with the event being reported")
    private List<String> associatedAlertIdList = new ArrayList<String>();
    /**
     * Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800
     * (Required)
     * 
     */
    @JsonProperty("collectionTimestamp")
    @JsonPropertyDescription("Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800")
    private String collectionTimestamp;
    /**
     * Specific performance collector instance used
     * 
     */
    @JsonProperty("dataCollector")
    @JsonPropertyDescription("Specific performance collector instance used")
    private String dataCollector;
    /**
     * type of network element - internal ATT field
     * 
     */
    @JsonProperty("elementType")
    @JsonPropertyDescription("type of network element - internal ATT field")
    private String elementType;
    /**
     * event severity or priority
     * (Required)
     * 
     */
    @JsonProperty("eventSeverity")
    @JsonPropertyDescription("event severity or priority")
    private ThresholdCrossingAlertFields.EventSeverity eventSeverity;
    /**
     * Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800
     * (Required)
     * 
     */
    @JsonProperty("eventStartTimestamp")
    @JsonPropertyDescription("Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800")
    private String eventStartTimestamp;
    /**
     * Physical or logical port or card (if applicable)
     * 
     */
    @JsonProperty("interfaceName")
    @JsonPropertyDescription("Physical or logical port or card (if applicable)")
    private String interfaceName;
    /**
     * network name - internal ATT field
     * 
     */
    @JsonProperty("networkService")
    @JsonPropertyDescription("network name - internal ATT field")
    private String networkService;
    /**
     * Reserved for future use
     * 
     */
    @JsonProperty("possibleRootCause")
    @JsonPropertyDescription("Reserved for future use")
    private String possibleRootCause;
    /**
     * version of the thresholdCrossingAlertFields block
     * (Required)
     * 
     */
    @JsonProperty("thresholdCrossingFieldsVersion")
    @JsonPropertyDescription("version of the thresholdCrossingAlertFields block")
    private ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion thresholdCrossingFieldsVersion;

    /**
     * an associative array which is an array of key:value pairs
     * 
     */
    @JsonProperty("additionalFields")
    public AlarmAdditionalInformation getAdditionalFields() {
        return additionalFields;
    }

    /**
     * an associative array which is an array of key:value pairs
     * 
     */
    @JsonProperty("additionalFields")
    public void setAdditionalFields(AlarmAdditionalInformation additionalFields) {
        this.additionalFields = additionalFields;
    }

    /**
     * performance counters
     * (Required)
     * 
     */
    @JsonProperty("additionalParameters")
    public List<AdditionalParameter> getAdditionalParameters() {
        return additionalParameters;
    }

    /**
     * performance counters
     * (Required)
     * 
     */
    @JsonProperty("additionalParameters")
    public void setAdditionalParameters(List<AdditionalParameter> additionalParameters) {
        this.additionalParameters = additionalParameters;
    }

    /**
     * Event action
     * (Required)
     * 
     */
    @JsonProperty("alertAction")
    public ThresholdCrossingAlertFields.AlertAction getAlertAction() {
        return alertAction;
    }

    /**
     * Event action
     * (Required)
     * 
     */
    @JsonProperty("alertAction")
    public void setAlertAction(ThresholdCrossingAlertFields.AlertAction alertAction) {
        this.alertAction = alertAction;
    }

    /**
     * Unique short alert description such as IF-SHUB-ERRDROP
     * (Required)
     * 
     */
    @JsonProperty("alertDescription")
    public String getAlertDescription() {
        return alertDescription;
    }

    /**
     * Unique short alert description such as IF-SHUB-ERRDROP
     * (Required)
     * 
     */
    @JsonProperty("alertDescription")
    public void setAlertDescription(String alertDescription) {
        this.alertDescription = alertDescription;
    }

    /**
     * Event type
     * (Required)
     * 
     */
    @JsonProperty("alertType")
    public ThresholdCrossingAlertFields.AlertType getAlertType() {
        return alertType;
    }

    /**
     * Event type
     * (Required)
     * 
     */
    @JsonProperty("alertType")
    public void setAlertType(ThresholdCrossingAlertFields.AlertType alertType) {
        this.alertType = alertType;
    }

    /**
     * Calculated API value (if applicable)
     * 
     */
    @JsonProperty("alertValue")
    public String getAlertValue() {
        return alertValue;
    }

    /**
     * Calculated API value (if applicable)
     * 
     */
    @JsonProperty("alertValue")
    public void setAlertValue(String alertValue) {
        this.alertValue = alertValue;
    }

    /**
     * List of eventIds associated with the event being reported
     * 
     */
    @JsonProperty("associatedAlertIdList")
    public List<String> getAssociatedAlertIdList() {
        return associatedAlertIdList;
    }

    /**
     * List of eventIds associated with the event being reported
     * 
     */
    @JsonProperty("associatedAlertIdList")
    public void setAssociatedAlertIdList(List<String> associatedAlertIdList) {
        this.associatedAlertIdList = associatedAlertIdList;
    }

    /**
     * Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800
     * (Required)
     * 
     */
    @JsonProperty("collectionTimestamp")
    public String getCollectionTimestamp() {
        return collectionTimestamp;
    }

    /**
     * Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800
     * (Required)
     * 
     */
    @JsonProperty("collectionTimestamp")
    public void setCollectionTimestamp(String collectionTimestamp) {
        this.collectionTimestamp = collectionTimestamp;
    }

    /**
     * Specific performance collector instance used
     * 
     */
    @JsonProperty("dataCollector")
    public String getDataCollector() {
        return dataCollector;
    }

    /**
     * Specific performance collector instance used
     * 
     */
    @JsonProperty("dataCollector")
    public void setDataCollector(String dataCollector) {
        this.dataCollector = dataCollector;
    }

    /**
     * type of network element - internal ATT field
     * 
     */
    @JsonProperty("elementType")
    public String getElementType() {
        return elementType;
    }

    /**
     * type of network element - internal ATT field
     * 
     */
    @JsonProperty("elementType")
    public void setElementType(String elementType) {
        this.elementType = elementType;
    }

    /**
     * event severity or priority
     * (Required)
     * 
     */
    @JsonProperty("eventSeverity")
    public ThresholdCrossingAlertFields.EventSeverity getEventSeverity() {
        return eventSeverity;
    }

    /**
     * event severity or priority
     * (Required)
     * 
     */
    @JsonProperty("eventSeverity")
    public void setEventSeverity(ThresholdCrossingAlertFields.EventSeverity eventSeverity) {
        this.eventSeverity = eventSeverity;
    }

    /**
     * Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800
     * (Required)
     * 
     */
    @JsonProperty("eventStartTimestamp")
    public String getEventStartTimestamp() {
        return eventStartTimestamp;
    }

    /**
     * Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800
     * (Required)
     * 
     */
    @JsonProperty("eventStartTimestamp")
    public void setEventStartTimestamp(String eventStartTimestamp) {
        this.eventStartTimestamp = eventStartTimestamp;
    }

    /**
     * Physical or logical port or card (if applicable)
     * 
     */
    @JsonProperty("interfaceName")
    public String getInterfaceName() {
        return interfaceName;
    }

    /**
     * Physical or logical port or card (if applicable)
     * 
     */
    @JsonProperty("interfaceName")
    public void setInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
    }

    /**
     * network name - internal ATT field
     * 
     */
    @JsonProperty("networkService")
    public String getNetworkService() {
        return networkService;
    }

    /**
     * network name - internal ATT field
     * 
     */
    @JsonProperty("networkService")
    public void setNetworkService(String networkService) {
        this.networkService = networkService;
    }

    /**
     * Reserved for future use
     * 
     */
    @JsonProperty("possibleRootCause")
    public String getPossibleRootCause() {
        return possibleRootCause;
    }

    /**
     * Reserved for future use
     * 
     */
    @JsonProperty("possibleRootCause")
    public void setPossibleRootCause(String possibleRootCause) {
        this.possibleRootCause = possibleRootCause;
    }

    /**
     * version of the thresholdCrossingAlertFields block
     * (Required)
     * 
     */
    @JsonProperty("thresholdCrossingFieldsVersion")
    public ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion getThresholdCrossingFieldsVersion() {
        return thresholdCrossingFieldsVersion;
    }

    /**
     * version of the thresholdCrossingAlertFields block
     * (Required)
     * 
     */
    @JsonProperty("thresholdCrossingFieldsVersion")
    public void setThresholdCrossingFieldsVersion(ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion thresholdCrossingFieldsVersion) {
        this.thresholdCrossingFieldsVersion = thresholdCrossingFieldsVersion;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(additionalFields).append(additionalParameters).append(alertAction).append(alertDescription).append(alertType).append(alertValue).append(associatedAlertIdList).append(collectionTimestamp).append(dataCollector).append(elementType).append(eventSeverity).append(eventStartTimestamp).append(interfaceName).append(networkService).append(possibleRootCause).append(thresholdCrossingFieldsVersion).toHashCode();
    }

    @Override
    public boolean equals(Object other) {
        if (other == this) {
            return true;
        }
        if ((other instanceof ThresholdCrossingAlertFields) == false) {
            return false;
        }
        ThresholdCrossingAlertFields rhs = ((ThresholdCrossingAlertFields) other);
        return new EqualsBuilder().append(additionalFields, rhs.additionalFields).append(additionalParameters, rhs.additionalParameters).append(alertAction, rhs.alertAction).append(alertDescription, rhs.alertDescription).append(alertType, rhs.alertType).append(alertValue, rhs.alertValue).append(associatedAlertIdList, rhs.associatedAlertIdList).append(collectionTimestamp, rhs.collectionTimestamp).append(dataCollector, rhs.dataCollector).append(elementType, rhs.elementType).append(eventSeverity, rhs.eventSeverity).append(eventStartTimestamp, rhs.eventStartTimestamp).append(interfaceName, rhs.interfaceName).append(networkService, rhs.networkService).append(possibleRootCause, rhs.possibleRootCause).append(thresholdCrossingFieldsVersion, rhs.thresholdCrossingFieldsVersion).isEquals();
    }

    public enum AlertAction {

        CLEAR("CLEAR"),
        CONT("CONT"),
        SET("SET");
        private final String value;
        private final static Map<String, ThresholdCrossingAlertFields.AlertAction> CONSTANTS = new HashMap<String, ThresholdCrossingAlertFields.AlertAction>();

        static {
            for (ThresholdCrossingAlertFields.AlertAction c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        private AlertAction(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.value;
        }

        @JsonValue
        public String value() {
            return this.value;
        }

        @JsonCreator
        public static ThresholdCrossingAlertFields.AlertAction fromValue(String value) {
            ThresholdCrossingAlertFields.AlertAction constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

    public enum AlertType {

        CARD_ANOMALY("CARD-ANOMALY"),
        ELEMENT_ANOMALY("ELEMENT-ANOMALY"),
        INTERFACE_ANOMALY("INTERFACE-ANOMALY"),
        SERVICE_ANOMALY("SERVICE-ANOMALY");
        private final String value;
        private final static Map<String, ThresholdCrossingAlertFields.AlertType> CONSTANTS = new HashMap<String, ThresholdCrossingAlertFields.AlertType>();

        static {
            for (ThresholdCrossingAlertFields.AlertType c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        private AlertType(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.value;
        }

        @JsonValue
        public String value() {
            return this.value;
        }

        @JsonCreator
        public static ThresholdCrossingAlertFields.AlertType fromValue(String value) {
            ThresholdCrossingAlertFields.AlertType constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

    public enum EventSeverity {

        CRITICAL("CRITICAL"),
        MAJOR("MAJOR"),
        MINOR("MINOR"),
        WARNING("WARNING"),
        NORMAL("NORMAL");
        private final String value;
        private final static Map<String, ThresholdCrossingAlertFields.EventSeverity> CONSTANTS = new HashMap<String, ThresholdCrossingAlertFields.EventSeverity>();

        static {
            for (ThresholdCrossingAlertFields.EventSeverity c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        private EventSeverity(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.value;
        }

        @JsonValue
        public String value() {
            return this.value;
        }

        @JsonCreator
        public static ThresholdCrossingAlertFields.EventSeverity fromValue(String value) {
            ThresholdCrossingAlertFields.EventSeverity constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

    public enum ThresholdCrossingFieldsVersion {

        _4_0("4.0");
        private final String value;
        private final static Map<String, ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion> CONSTANTS = new HashMap<String, ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion>();

        static {
            for (ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        private ThresholdCrossingFieldsVersion(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.value;
        }

        @JsonValue
        public String value() {
            return this.value;
        }

        @JsonCreator
        public static ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion fromValue(String value) {
            ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

}