daa98559c4a0fd7e97fd7a1003a5085232904aef
[dcaegen2/services/mapper.git] /
1 /*\r
2 * ============LICENSE_START=======================================================\r
3 * ONAP : DCAE\r
4 * ================================================================================\r
5 * Copyright 2018 TechMahindra\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
10 *\r
11 *     http://www.apache.org/licenses/LICENSE-2.0\r
12 *\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
19 */\r
20 package org.onap.dcaegen2.ves.domain.ves7_0;\r
21 \r
22 import java.util.ArrayList;\r
23 import java.util.HashMap;\r
24 import java.util.List;\r
25 import java.util.Map;\r
26 import com.fasterxml.jackson.annotation.JsonCreator;\r
27 import com.fasterxml.jackson.annotation.JsonInclude;\r
28 import com.fasterxml.jackson.annotation.JsonProperty;\r
29 import com.fasterxml.jackson.annotation.JsonPropertyDescription;\r
30 import com.fasterxml.jackson.annotation.JsonPropertyOrder;\r
31 import com.fasterxml.jackson.annotation.JsonValue;\r
32 import org.apache.commons.lang.builder.EqualsBuilder;\r
33 import org.apache.commons.lang.builder.HashCodeBuilder;\r
34 import org.apache.commons.lang.builder.ToStringBuilder;\r
35 \r
36 \r
37 /**\r
38  * fields specific to threshold crossing alert events\r
39  * \r
40  */\r
41 @JsonInclude(JsonInclude.Include.NON_NULL)\r
42 @JsonPropertyOrder({\r
43     "additionalFields",\r
44     "additionalParameters",\r
45     "alertAction",\r
46     "alertDescription",\r
47     "alertType",\r
48     "alertValue",\r
49     "associatedAlertIdList",\r
50     "collectionTimestamp",\r
51     "dataCollector",\r
52     "elementType",\r
53     "eventSeverity",\r
54     "eventStartTimestamp",\r
55     "interfaceName",\r
56     "networkService",\r
57     "possibleRootCause",\r
58     "thresholdCrossingFieldsVersion"\r
59 })\r
60 public class ThresholdCrossingAlertFields {\r
61 \r
62     /**\r
63      * an associative array which is an array of key:value pairs\r
64      * \r
65      */\r
66     @JsonProperty("additionalFields")\r
67     @JsonPropertyDescription("an associative array which is an array of key:value pairs")\r
68     private AlarmAdditionalInformation additionalFields;\r
69     /**\r
70      * performance counters\r
71      * (Required)\r
72      * \r
73      */\r
74     @JsonProperty("additionalParameters")\r
75     @JsonPropertyDescription("performance counters")\r
76     private List<AdditionalParameter> additionalParameters = new ArrayList<AdditionalParameter>();\r
77     /**\r
78      * Event action\r
79      * (Required)\r
80      * \r
81      */\r
82     @JsonProperty("alertAction")\r
83     @JsonPropertyDescription("Event action")\r
84     private ThresholdCrossingAlertFields.AlertAction alertAction;\r
85     /**\r
86      * Unique short alert description such as IF-SHUB-ERRDROP\r
87      * (Required)\r
88      * \r
89      */\r
90     @JsonProperty("alertDescription")\r
91     @JsonPropertyDescription("Unique short alert description such as IF-SHUB-ERRDROP")\r
92     private String alertDescription;\r
93     /**\r
94      * Event type\r
95      * (Required)\r
96      * \r
97      */\r
98     @JsonProperty("alertType")\r
99     @JsonPropertyDescription("Event type")\r
100     private ThresholdCrossingAlertFields.AlertType alertType;\r
101     /**\r
102      * Calculated API value (if applicable)\r
103      * \r
104      */\r
105     @JsonProperty("alertValue")\r
106     @JsonPropertyDescription("Calculated API value (if applicable)")\r
107     private String alertValue;\r
108     /**\r
109      * List of eventIds associated with the event being reported\r
110      * \r
111      */\r
112     @JsonProperty("associatedAlertIdList")\r
113     @JsonPropertyDescription("List of eventIds associated with the event being reported")\r
114     private List<String> associatedAlertIdList = new ArrayList<String>();\r
115     /**\r
116      * Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800\r
117      * (Required)\r
118      * \r
119      */\r
120     @JsonProperty("collectionTimestamp")\r
121     @JsonPropertyDescription("Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800")\r
122     private String collectionTimestamp;\r
123     /**\r
124      * Specific performance collector instance used\r
125      * \r
126      */\r
127     @JsonProperty("dataCollector")\r
128     @JsonPropertyDescription("Specific performance collector instance used")\r
129     private String dataCollector;\r
130     /**\r
131      * type of network element - internal ATT field\r
132      * \r
133      */\r
134     @JsonProperty("elementType")\r
135     @JsonPropertyDescription("type of network element - internal ATT field")\r
136     private String elementType;\r
137     /**\r
138      * event severity or priority\r
139      * (Required)\r
140      * \r
141      */\r
142     @JsonProperty("eventSeverity")\r
143     @JsonPropertyDescription("event severity or priority")\r
144     private ThresholdCrossingAlertFields.EventSeverity eventSeverity;\r
145     /**\r
146      * Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800\r
147      * (Required)\r
148      * \r
149      */\r
150     @JsonProperty("eventStartTimestamp")\r
151     @JsonPropertyDescription("Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800")\r
152     private String eventStartTimestamp;\r
153     /**\r
154      * Physical or logical port or card (if applicable)\r
155      * \r
156      */\r
157     @JsonProperty("interfaceName")\r
158     @JsonPropertyDescription("Physical or logical port or card (if applicable)")\r
159     private String interfaceName;\r
160     /**\r
161      * network name - internal ATT field\r
162      * \r
163      */\r
164     @JsonProperty("networkService")\r
165     @JsonPropertyDescription("network name - internal ATT field")\r
166     private String networkService;\r
167     /**\r
168      * Reserved for future use\r
169      * \r
170      */\r
171     @JsonProperty("possibleRootCause")\r
172     @JsonPropertyDescription("Reserved for future use")\r
173     private String possibleRootCause;\r
174     /**\r
175      * version of the thresholdCrossingAlertFields block\r
176      * (Required)\r
177      * \r
178      */\r
179     @JsonProperty("thresholdCrossingFieldsVersion")\r
180     @JsonPropertyDescription("version of the thresholdCrossingAlertFields block")\r
181     private ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion thresholdCrossingFieldsVersion;\r
182 \r
183     /**\r
184      * an associative array which is an array of key:value pairs\r
185      * \r
186      */\r
187     @JsonProperty("additionalFields")\r
188     public AlarmAdditionalInformation getAdditionalFields() {\r
189         return additionalFields;\r
190     }\r
191 \r
192     /**\r
193      * an associative array which is an array of key:value pairs\r
194      * \r
195      */\r
196     @JsonProperty("additionalFields")\r
197     public void setAdditionalFields(AlarmAdditionalInformation additionalFields) {\r
198         this.additionalFields = additionalFields;\r
199     }\r
200 \r
201     /**\r
202      * performance counters\r
203      * (Required)\r
204      * \r
205      */\r
206     @JsonProperty("additionalParameters")\r
207     public List<AdditionalParameter> getAdditionalParameters() {\r
208         return additionalParameters;\r
209     }\r
210 \r
211     /**\r
212      * performance counters\r
213      * (Required)\r
214      * \r
215      */\r
216     @JsonProperty("additionalParameters")\r
217     public void setAdditionalParameters(List<AdditionalParameter> additionalParameters) {\r
218         this.additionalParameters = additionalParameters;\r
219     }\r
220 \r
221     /**\r
222      * Event action\r
223      * (Required)\r
224      * \r
225      */\r
226     @JsonProperty("alertAction")\r
227     public ThresholdCrossingAlertFields.AlertAction getAlertAction() {\r
228         return alertAction;\r
229     }\r
230 \r
231     /**\r
232      * Event action\r
233      * (Required)\r
234      * \r
235      */\r
236     @JsonProperty("alertAction")\r
237     public void setAlertAction(ThresholdCrossingAlertFields.AlertAction alertAction) {\r
238         this.alertAction = alertAction;\r
239     }\r
240 \r
241     /**\r
242      * Unique short alert description such as IF-SHUB-ERRDROP\r
243      * (Required)\r
244      * \r
245      */\r
246     @JsonProperty("alertDescription")\r
247     public String getAlertDescription() {\r
248         return alertDescription;\r
249     }\r
250 \r
251     /**\r
252      * Unique short alert description such as IF-SHUB-ERRDROP\r
253      * (Required)\r
254      * \r
255      */\r
256     @JsonProperty("alertDescription")\r
257     public void setAlertDescription(String alertDescription) {\r
258         this.alertDescription = alertDescription;\r
259     }\r
260 \r
261     /**\r
262      * Event type\r
263      * (Required)\r
264      * \r
265      */\r
266     @JsonProperty("alertType")\r
267     public ThresholdCrossingAlertFields.AlertType getAlertType() {\r
268         return alertType;\r
269     }\r
270 \r
271     /**\r
272      * Event type\r
273      * (Required)\r
274      * \r
275      */\r
276     @JsonProperty("alertType")\r
277     public void setAlertType(ThresholdCrossingAlertFields.AlertType alertType) {\r
278         this.alertType = alertType;\r
279     }\r
280 \r
281     /**\r
282      * Calculated API value (if applicable)\r
283      * \r
284      */\r
285     @JsonProperty("alertValue")\r
286     public String getAlertValue() {\r
287         return alertValue;\r
288     }\r
289 \r
290     /**\r
291      * Calculated API value (if applicable)\r
292      * \r
293      */\r
294     @JsonProperty("alertValue")\r
295     public void setAlertValue(String alertValue) {\r
296         this.alertValue = alertValue;\r
297     }\r
298 \r
299     /**\r
300      * List of eventIds associated with the event being reported\r
301      * \r
302      */\r
303     @JsonProperty("associatedAlertIdList")\r
304     public List<String> getAssociatedAlertIdList() {\r
305         return associatedAlertIdList;\r
306     }\r
307 \r
308     /**\r
309      * List of eventIds associated with the event being reported\r
310      * \r
311      */\r
312     @JsonProperty("associatedAlertIdList")\r
313     public void setAssociatedAlertIdList(List<String> associatedAlertIdList) {\r
314         this.associatedAlertIdList = associatedAlertIdList;\r
315     }\r
316 \r
317     /**\r
318      * Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800\r
319      * (Required)\r
320      * \r
321      */\r
322     @JsonProperty("collectionTimestamp")\r
323     public String getCollectionTimestamp() {\r
324         return collectionTimestamp;\r
325     }\r
326 \r
327     /**\r
328      * Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800\r
329      * (Required)\r
330      * \r
331      */\r
332     @JsonProperty("collectionTimestamp")\r
333     public void setCollectionTimestamp(String collectionTimestamp) {\r
334         this.collectionTimestamp = collectionTimestamp;\r
335     }\r
336 \r
337     /**\r
338      * Specific performance collector instance used\r
339      * \r
340      */\r
341     @JsonProperty("dataCollector")\r
342     public String getDataCollector() {\r
343         return dataCollector;\r
344     }\r
345 \r
346     /**\r
347      * Specific performance collector instance used\r
348      * \r
349      */\r
350     @JsonProperty("dataCollector")\r
351     public void setDataCollector(String dataCollector) {\r
352         this.dataCollector = dataCollector;\r
353     }\r
354 \r
355     /**\r
356      * type of network element - internal ATT field\r
357      * \r
358      */\r
359     @JsonProperty("elementType")\r
360     public String getElementType() {\r
361         return elementType;\r
362     }\r
363 \r
364     /**\r
365      * type of network element - internal ATT field\r
366      * \r
367      */\r
368     @JsonProperty("elementType")\r
369     public void setElementType(String elementType) {\r
370         this.elementType = elementType;\r
371     }\r
372 \r
373     /**\r
374      * event severity or priority\r
375      * (Required)\r
376      * \r
377      */\r
378     @JsonProperty("eventSeverity")\r
379     public ThresholdCrossingAlertFields.EventSeverity getEventSeverity() {\r
380         return eventSeverity;\r
381     }\r
382 \r
383     /**\r
384      * event severity or priority\r
385      * (Required)\r
386      * \r
387      */\r
388     @JsonProperty("eventSeverity")\r
389     public void setEventSeverity(ThresholdCrossingAlertFields.EventSeverity eventSeverity) {\r
390         this.eventSeverity = eventSeverity;\r
391     }\r
392 \r
393     /**\r
394      * Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800\r
395      * (Required)\r
396      * \r
397      */\r
398     @JsonProperty("eventStartTimestamp")\r
399     public String getEventStartTimestamp() {\r
400         return eventStartTimestamp;\r
401     }\r
402 \r
403     /**\r
404      * Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800\r
405      * (Required)\r
406      * \r
407      */\r
408     @JsonProperty("eventStartTimestamp")\r
409     public void setEventStartTimestamp(String eventStartTimestamp) {\r
410         this.eventStartTimestamp = eventStartTimestamp;\r
411     }\r
412 \r
413     /**\r
414      * Physical or logical port or card (if applicable)\r
415      * \r
416      */\r
417     @JsonProperty("interfaceName")\r
418     public String getInterfaceName() {\r
419         return interfaceName;\r
420     }\r
421 \r
422     /**\r
423      * Physical or logical port or card (if applicable)\r
424      * \r
425      */\r
426     @JsonProperty("interfaceName")\r
427     public void setInterfaceName(String interfaceName) {\r
428         this.interfaceName = interfaceName;\r
429     }\r
430 \r
431     /**\r
432      * network name - internal ATT field\r
433      * \r
434      */\r
435     @JsonProperty("networkService")\r
436     public String getNetworkService() {\r
437         return networkService;\r
438     }\r
439 \r
440     /**\r
441      * network name - internal ATT field\r
442      * \r
443      */\r
444     @JsonProperty("networkService")\r
445     public void setNetworkService(String networkService) {\r
446         this.networkService = networkService;\r
447     }\r
448 \r
449     /**\r
450      * Reserved for future use\r
451      * \r
452      */\r
453     @JsonProperty("possibleRootCause")\r
454     public String getPossibleRootCause() {\r
455         return possibleRootCause;\r
456     }\r
457 \r
458     /**\r
459      * Reserved for future use\r
460      * \r
461      */\r
462     @JsonProperty("possibleRootCause")\r
463     public void setPossibleRootCause(String possibleRootCause) {\r
464         this.possibleRootCause = possibleRootCause;\r
465     }\r
466 \r
467     /**\r
468      * version of the thresholdCrossingAlertFields block\r
469      * (Required)\r
470      * \r
471      */\r
472     @JsonProperty("thresholdCrossingFieldsVersion")\r
473     public ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion getThresholdCrossingFieldsVersion() {\r
474         return thresholdCrossingFieldsVersion;\r
475     }\r
476 \r
477     /**\r
478      * version of the thresholdCrossingAlertFields block\r
479      * (Required)\r
480      * \r
481      */\r
482     @JsonProperty("thresholdCrossingFieldsVersion")\r
483     public void setThresholdCrossingFieldsVersion(ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion thresholdCrossingFieldsVersion) {\r
484         this.thresholdCrossingFieldsVersion = thresholdCrossingFieldsVersion;\r
485     }\r
486 \r
487     @Override\r
488     public String toString() {\r
489         return ToStringBuilder.reflectionToString(this);\r
490     }\r
491 \r
492     @Override\r
493     public int hashCode() {\r
494         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();\r
495     }\r
496 \r
497     @Override\r
498     public boolean equals(Object other) {\r
499         if (other == this) {\r
500             return true;\r
501         }\r
502         if ((other instanceof ThresholdCrossingAlertFields) == false) {\r
503             return false;\r
504         }\r
505         ThresholdCrossingAlertFields rhs = ((ThresholdCrossingAlertFields) other);\r
506         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();\r
507     }\r
508 \r
509     public enum AlertAction {\r
510 \r
511         CLEAR("CLEAR"),\r
512         CONT("CONT"),\r
513         SET("SET");\r
514         private final String value;\r
515         private final static Map<String, ThresholdCrossingAlertFields.AlertAction> CONSTANTS = new HashMap<String, ThresholdCrossingAlertFields.AlertAction>();\r
516 \r
517         static {\r
518             for (ThresholdCrossingAlertFields.AlertAction c: values()) {\r
519                 CONSTANTS.put(c.value, c);\r
520             }\r
521         }\r
522 \r
523         private AlertAction(String value) {\r
524             this.value = value;\r
525         }\r
526 \r
527         @Override\r
528         public String toString() {\r
529             return this.value;\r
530         }\r
531 \r
532         @JsonValue\r
533         public String value() {\r
534             return this.value;\r
535         }\r
536 \r
537         @JsonCreator\r
538         public static ThresholdCrossingAlertFields.AlertAction fromValue(String value) {\r
539             ThresholdCrossingAlertFields.AlertAction constant = CONSTANTS.get(value);\r
540             if (constant == null) {\r
541                 throw new IllegalArgumentException(value);\r
542             } else {\r
543                 return constant;\r
544             }\r
545         }\r
546 \r
547     }\r
548 \r
549     public enum AlertType {\r
550 \r
551         CARD_ANOMALY("CARD-ANOMALY"),\r
552         ELEMENT_ANOMALY("ELEMENT-ANOMALY"),\r
553         INTERFACE_ANOMALY("INTERFACE-ANOMALY"),\r
554         SERVICE_ANOMALY("SERVICE-ANOMALY");\r
555         private final String value;\r
556         private final static Map<String, ThresholdCrossingAlertFields.AlertType> CONSTANTS = new HashMap<String, ThresholdCrossingAlertFields.AlertType>();\r
557 \r
558         static {\r
559             for (ThresholdCrossingAlertFields.AlertType c: values()) {\r
560                 CONSTANTS.put(c.value, c);\r
561             }\r
562         }\r
563 \r
564         private AlertType(String value) {\r
565             this.value = value;\r
566         }\r
567 \r
568         @Override\r
569         public String toString() {\r
570             return this.value;\r
571         }\r
572 \r
573         @JsonValue\r
574         public String value() {\r
575             return this.value;\r
576         }\r
577 \r
578         @JsonCreator\r
579         public static ThresholdCrossingAlertFields.AlertType fromValue(String value) {\r
580             ThresholdCrossingAlertFields.AlertType constant = CONSTANTS.get(value);\r
581             if (constant == null) {\r
582                 throw new IllegalArgumentException(value);\r
583             } else {\r
584                 return constant;\r
585             }\r
586         }\r
587 \r
588     }\r
589 \r
590     public enum EventSeverity {\r
591 \r
592         CRITICAL("CRITICAL"),\r
593         MAJOR("MAJOR"),\r
594         MINOR("MINOR"),\r
595         WARNING("WARNING"),\r
596         NORMAL("NORMAL");\r
597         private final String value;\r
598         private final static Map<String, ThresholdCrossingAlertFields.EventSeverity> CONSTANTS = new HashMap<String, ThresholdCrossingAlertFields.EventSeverity>();\r
599 \r
600         static {\r
601             for (ThresholdCrossingAlertFields.EventSeverity c: values()) {\r
602                 CONSTANTS.put(c.value, c);\r
603             }\r
604         }\r
605 \r
606         private EventSeverity(String value) {\r
607             this.value = value;\r
608         }\r
609 \r
610         @Override\r
611         public String toString() {\r
612             return this.value;\r
613         }\r
614 \r
615         @JsonValue\r
616         public String value() {\r
617             return this.value;\r
618         }\r
619 \r
620         @JsonCreator\r
621         public static ThresholdCrossingAlertFields.EventSeverity fromValue(String value) {\r
622             ThresholdCrossingAlertFields.EventSeverity constant = CONSTANTS.get(value);\r
623             if (constant == null) {\r
624                 throw new IllegalArgumentException(value);\r
625             } else {\r
626                 return constant;\r
627             }\r
628         }\r
629 \r
630     }\r
631 \r
632     public enum ThresholdCrossingFieldsVersion {\r
633 \r
634         _4_0("4.0");\r
635         private final String value;\r
636         private final static Map<String, ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion> CONSTANTS = new HashMap<String, ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion>();\r
637 \r
638         static {\r
639             for (ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion c: values()) {\r
640                 CONSTANTS.put(c.value, c);\r
641             }\r
642         }\r
643 \r
644         private ThresholdCrossingFieldsVersion(String value) {\r
645             this.value = value;\r
646         }\r
647 \r
648         @Override\r
649         public String toString() {\r
650             return this.value;\r
651         }\r
652 \r
653         @JsonValue\r
654         public String value() {\r
655             return this.value;\r
656         }\r
657 \r
658         @JsonCreator\r
659         public static ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion fromValue(String value) {\r
660             ThresholdCrossingAlertFields.ThresholdCrossingFieldsVersion constant = CONSTANTS.get(value);\r
661             if (constant == null) {\r
662                 throw new IllegalArgumentException(value);\r
663             } else {\r
664                 return constant;\r
665             }\r
666         }\r
667 \r
668     }\r
669 \r
670 }\r