2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright 2019 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
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.onap.dcaegen2.ves.domain.ves54;
\r
23 import java.util.HashMap;
\r
24 import java.util.Map;
\r
26 import org.apache.commons.lang.builder.HashCodeBuilder;
\r
27 import org.apache.commons.lang.builder.ToStringBuilder;
\r
29 import com.fasterxml.jackson.annotation.JsonAnyGetter;
\r
30 import com.fasterxml.jackson.annotation.JsonAnySetter;
\r
31 import com.fasterxml.jackson.annotation.JsonCreator;
\r
32 import com.fasterxml.jackson.annotation.JsonIgnore;
\r
33 import com.fasterxml.jackson.annotation.JsonInclude;
\r
34 import com.fasterxml.jackson.annotation.JsonProperty;
\r
35 import com.fasterxml.jackson.annotation.JsonPropertyDescription;
\r
36 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
\r
37 import com.fasterxml.jackson.annotation.JsonValue;
\r
41 * fields common to all events
\r
44 @JsonInclude(JsonInclude.Include.NON_NULL)
\r
45 @JsonPropertyOrder({"domain", "eventId", "eventName", "eventType", "internalHeaderFields",
\r
46 "lastEpochMicrosec", "nfcNamingCode", "nfNamingCode", "priority", "reportingEntityId",
\r
47 "reportingEntityName", "sequence", "sourceId", "sourceName", "startEpochMicrosec",
\r
49 public class CommonEventHeader {
\r
52 * the eventing domain associated with the event (Required)
\r
55 @JsonProperty("domain")
\r
56 @JsonPropertyDescription("the eventing domain associated with the event")
\r
57 private CommonEventHeader.Domain domain;
\r
59 * event key that is unique to the event source (Required)
\r
62 @JsonProperty("eventId")
\r
63 @JsonPropertyDescription("event key that is unique to the event source")
\r
64 private String eventId;
\r
66 * unique event name (Required)
\r
69 @JsonProperty("eventName")
\r
70 @JsonPropertyDescription("unique event name")
\r
71 private String eventName;
\r
73 * for example - applicationVnf, guestOS, hostOS, platform
\r
76 @JsonProperty("eventType")
\r
77 @JsonPropertyDescription("for example - applicationVnf, guestOS, hostOS, platform")
\r
78 private String eventType;
\r
80 * enrichment fields for internal VES Event Listener service use only, not supplied by event
\r
84 @JsonProperty("internalHeaderFields")
\r
85 @JsonPropertyDescription("enrichment fields for internal VES Event Listener service use only, not supplied by event sources")
\r
86 private InternalHeaderFields internalHeaderFields;
\r
88 * the latest unix time aka epoch time associated with the event from any component--as
\r
89 * microseconds elapsed since 1 Jan 1970 not including leap seconds (Required)
\r
92 @JsonProperty("lastEpochMicrosec")
\r
93 @JsonPropertyDescription("the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds")
\r
94 private Double lastEpochMicrosec;
\r
96 * 3 character network function component type, aligned with vfc naming standards
\r
99 @JsonProperty("nfcNamingCode")
\r
100 @JsonPropertyDescription("3 character network function component type, aligned with vfc naming standards")
\r
101 private String nfcNamingCode;
\r
103 * 4 character network function type, aligned with vnf naming standards
\r
106 @JsonProperty("nfNamingCode")
\r
107 @JsonPropertyDescription("4 character network function type, aligned with vnf naming standards")
\r
108 private String nfNamingCode;
\r
110 * processing priority (Required)
\r
113 @JsonProperty("priority")
\r
114 @JsonPropertyDescription("processing priority")
\r
115 private CommonEventHeader.Priority priority;
\r
117 * UUID identifying the entity reporting the event, for example an OAM VM; must be populated by
\r
118 * the ATT enrichment process
\r
121 @JsonProperty("reportingEntityId")
\r
122 @JsonPropertyDescription("UUID identifying the entity reporting the event, for example an OAM VM; must be populated by the ATT enrichment process")
\r
123 private String reportingEntityId;
\r
125 * name of the entity reporting the event, for example, an EMS name; may be the same as
\r
126 * sourceName (Required)
\r
129 @JsonProperty("reportingEntityName")
\r
130 @JsonPropertyDescription("name of the entity reporting the event, for example, an EMS name; may be the same as sourceName")
\r
131 private String reportingEntityName;
\r
133 * ordering of events communicated by an event source instance or 0 if not needed (Required)
\r
136 @JsonProperty("sequence")
\r
137 @JsonPropertyDescription("ordering of events communicated by an event source instance or 0 if not needed")
\r
138 private Integer sequence;
\r
140 * UUID identifying the entity experiencing the event issue; must be populated by the ATT
\r
141 * enrichment process
\r
144 @JsonProperty("sourceId")
\r
145 @JsonPropertyDescription("UUID identifying the entity experiencing the event issue; must be populated by the ATT enrichment process")
\r
146 private String sourceId;
\r
148 * name of the entity experiencing the event issue (Required)
\r
151 @JsonProperty("sourceName")
\r
152 @JsonPropertyDescription("name of the entity experiencing the event issue")
\r
153 private String sourceName;
\r
155 * the earliest unix time aka epoch time associated with the event from any component--as
\r
156 * microseconds elapsed since 1 Jan 1970 not including leap seconds (Required)
\r
159 @JsonProperty("startEpochMicrosec")
\r
160 @JsonPropertyDescription("the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds")
\r
161 private Double startEpochMicrosec;
\r
163 * version of the event header (Required)
\r
166 @JsonProperty("version")
\r
167 @JsonPropertyDescription("version of the event header")
\r
168 private Double version;
\r
170 private Map<String, Object> additionalProperties = new HashMap<String, Object>();
\r
173 * the eventing domain associated with the event (Required)
\r
176 @JsonProperty("domain")
\r
177 public CommonEventHeader.Domain getDomain() {
\r
182 * the eventing domain associated with the event (Required)
\r
185 @JsonProperty("domain")
\r
186 public void setDomain(CommonEventHeader.Domain domain) {
\r
187 this.domain = domain;
\r
191 * event key that is unique to the event source (Required)
\r
194 @JsonProperty("eventId")
\r
195 public String getEventId() {
\r
200 * event key that is unique to the event source (Required)
\r
203 @JsonProperty("eventId")
\r
204 public void setEventId(String eventId) {
\r
205 this.eventId = eventId;
\r
209 * unique event name (Required)
\r
212 @JsonProperty("eventName")
\r
213 public String getEventName() {
\r
218 * unique event name (Required)
\r
221 @JsonProperty("eventName")
\r
222 public void setEventName(String eventName) {
\r
223 this.eventName = eventName;
\r
227 * for example - applicationVnf, guestOS, hostOS, platform
\r
230 @JsonProperty("eventType")
\r
231 public String getEventType() {
\r
236 * for example - applicationVnf, guestOS, hostOS, platform
\r
239 @JsonProperty("eventType")
\r
240 public void setEventType(String eventType) {
\r
241 this.eventType = eventType;
\r
245 * enrichment fields for internal VES Event Listener service use only, not supplied by event
\r
249 @JsonProperty("internalHeaderFields")
\r
250 public InternalHeaderFields getInternalHeaderFields() {
\r
251 return internalHeaderFields;
\r
255 * enrichment fields for internal VES Event Listener service use only, not supplied by event
\r
259 @JsonProperty("internalHeaderFields")
\r
260 public void setInternalHeaderFields(InternalHeaderFields internalHeaderFields) {
\r
261 this.internalHeaderFields = internalHeaderFields;
\r
265 * the latest unix time aka epoch time associated with the event from any component--as
\r
266 * microseconds elapsed since 1 Jan 1970 not including leap seconds (Required)
\r
269 @JsonProperty("lastEpochMicrosec")
\r
270 public Double getLastEpochMicrosec() {
\r
271 return lastEpochMicrosec;
\r
275 * the latest unix time aka epoch time associated with the event from any component--as
\r
276 * microseconds elapsed since 1 Jan 1970 not including leap seconds (Required)
\r
279 @JsonProperty("lastEpochMicrosec")
\r
280 public void setLastEpochMicrosec(Double lastEpochMicrosec) {
\r
281 this.lastEpochMicrosec = lastEpochMicrosec;
\r
285 * 3 character network function component type, aligned with vfc naming standards
\r
288 @JsonProperty("nfcNamingCode")
\r
289 public String getNfcNamingCode() {
\r
290 return nfcNamingCode;
\r
294 * 3 character network function component type, aligned with vfc naming standards
\r
297 @JsonProperty("nfcNamingCode")
\r
298 public void setNfcNamingCode(String nfcNamingCode) {
\r
299 this.nfcNamingCode = nfcNamingCode;
\r
303 * 4 character network function type, aligned with vnf naming standards
\r
306 @JsonProperty("nfNamingCode")
\r
307 public String getNfNamingCode() {
\r
308 return nfNamingCode;
\r
312 * 4 character network function type, aligned with vnf naming standards
\r
315 @JsonProperty("nfNamingCode")
\r
316 public void setNfNamingCode(String nfNamingCode) {
\r
317 this.nfNamingCode = nfNamingCode;
\r
321 * processing priority (Required)
\r
324 @JsonProperty("priority")
\r
325 public CommonEventHeader.Priority getPriority() {
\r
330 * processing priority (Required)
\r
333 @JsonProperty("priority")
\r
334 public void setPriority(CommonEventHeader.Priority priority) {
\r
335 this.priority = priority;
\r
339 * UUID identifying the entity reporting the event, for example an OAM VM; must be populated by
\r
340 * the ATT enrichment process
\r
343 @JsonProperty("reportingEntityId")
\r
344 public String getReportingEntityId() {
\r
345 return reportingEntityId;
\r
349 * UUID identifying the entity reporting the event, for example an OAM VM; must be populated by
\r
350 * the ATT enrichment process
\r
353 @JsonProperty("reportingEntityId")
\r
354 public void setReportingEntityId(String reportingEntityId) {
\r
355 this.reportingEntityId = reportingEntityId;
\r
359 * name of the entity reporting the event, for example, an EMS name; may be the same as
\r
360 * sourceName (Required)
\r
363 @JsonProperty("reportingEntityName")
\r
364 public String getReportingEntityName() {
\r
365 return reportingEntityName;
\r
369 * name of the entity reporting the event, for example, an EMS name; may be the same as
\r
370 * sourceName (Required)
\r
373 @JsonProperty("reportingEntityName")
\r
374 public void setReportingEntityName(String reportingEntityName) {
\r
375 this.reportingEntityName = reportingEntityName;
\r
379 * ordering of events communicated by an event source instance or 0 if not needed (Required)
\r
382 @JsonProperty("sequence")
\r
383 public Integer getSequence() {
\r
388 * ordering of events communicated by an event source instance or 0 if not needed (Required)
\r
391 @JsonProperty("sequence")
\r
392 public void setSequence(Integer sequence) {
\r
393 this.sequence = sequence;
\r
397 * UUID identifying the entity experiencing the event issue; must be populated by the ATT
\r
398 * enrichment process
\r
401 @JsonProperty("sourceId")
\r
402 public String getSourceId() {
\r
407 * UUID identifying the entity experiencing the event issue; must be populated by the ATT
\r
408 * enrichment process
\r
411 @JsonProperty("sourceId")
\r
412 public void setSourceId(String sourceId) {
\r
413 this.sourceId = sourceId;
\r
417 * name of the entity experiencing the event issue (Required)
\r
420 @JsonProperty("sourceName")
\r
421 public String getSourceName() {
\r
426 * name of the entity experiencing the event issue (Required)
\r
429 @JsonProperty("sourceName")
\r
430 public void setSourceName(String sourceName) {
\r
431 this.sourceName = sourceName;
\r
435 * the earliest unix time aka epoch time associated with the event from any component--as
\r
436 * microseconds elapsed since 1 Jan 1970 not including leap seconds (Required)
\r
439 @JsonProperty("startEpochMicrosec")
\r
440 public Double getStartEpochMicrosec() {
\r
441 return startEpochMicrosec;
\r
445 * the earliest unix time aka epoch time associated with the event from any component--as
\r
446 * microseconds elapsed since 1 Jan 1970 not including leap seconds (Required)
\r
449 @JsonProperty("startEpochMicrosec")
\r
450 public void setStartEpochMicrosec(Double startEpochMicrosec) {
\r
451 this.startEpochMicrosec = startEpochMicrosec;
\r
455 * version of the event header (Required)
\r
458 @JsonProperty("version")
\r
459 public Double getVersion() {
\r
464 * version of the event header (Required)
\r
467 @JsonProperty("version")
\r
468 public void setVersion(Double version) {
\r
469 this.version = version;
\r
473 public String toString() {
\r
474 return ToStringBuilder.reflectionToString(this);
\r
478 public Map<String, Object> getAdditionalProperties() {
\r
479 return this.additionalProperties;
\r
483 public void setAdditionalProperty(String name, Object value) {
\r
484 this.additionalProperties.put(name, value);
\r
488 public int hashCode() {
\r
489 return new HashCodeBuilder().append(domain).append(eventId).append(eventName)
\r
490 .append(eventType).append(internalHeaderFields).append(lastEpochMicrosec)
\r
491 .append(nfcNamingCode).append(nfNamingCode).append(priority)
\r
492 .append(reportingEntityId).append(reportingEntityName).append(sequence)
\r
493 .append(sourceId).append(sourceName).append(startEpochMicrosec).append(version)
\r
494 .append(additionalProperties).toHashCode();
\r
498 public enum Domain {
\r
500 FAULT("fault"), HEARTBEAT("heartbeat"), MEASUREMENTS_FOR_VF_SCALING(
\r
501 "measurementsForVfScaling"), MOBILE_FLOW(
\r
502 "mobileFlow"), OTHER("other"), SIP_SIGNALING("sipSignaling"), STATE_CHANGE(
\r
503 "stateChange"), SYSLOG("syslog"), THRESHOLD_CROSSING_ALERT(
\r
504 "thresholdCrossingAlert"), VOICE_QUALITY("voiceQuality");
\r
505 private final String value;
\r
506 private final static Map<String, CommonEventHeader.Domain> CONSTANTS =
\r
507 new HashMap<String, CommonEventHeader.Domain>();
\r
510 for (CommonEventHeader.Domain c : values()) {
\r
511 CONSTANTS.put(c.value, c);
\r
515 private Domain(String value) {
\r
516 this.value = value;
\r
520 public String toString() {
\r
525 public String value() {
\r
530 public static CommonEventHeader.Domain fromValue(String value) {
\r
531 CommonEventHeader.Domain constant = CONSTANTS.get(value);
\r
532 if (constant == null) {
\r
533 throw new IllegalArgumentException(value);
\r
541 public enum Priority {
\r
543 HIGH("High"), MEDIUM("Medium"), NORMAL("Normal"), LOW("Low");
\r
544 private final String value;
\r
545 private final static Map<String, CommonEventHeader.Priority> CONSTANTS =
\r
546 new HashMap<String, CommonEventHeader.Priority>();
\r
549 for (CommonEventHeader.Priority c : values()) {
\r
550 CONSTANTS.put(c.value, c);
\r
554 private Priority(String value) {
\r
555 this.value = value;
\r
559 public String toString() {
\r
564 public String value() {
\r
569 public static CommonEventHeader.Priority fromValue(String value) {
\r
570 CommonEventHeader.Priority constant = CONSTANTS.get(value);
\r
571 if (constant == null) {
\r
572 throw new IllegalArgumentException(value);
\r