2 * ============LICENSE_START========================================================================
3 * ONAP : tr-069-adapter
4 * =================================================================================================
5 * Copyright (C) 2020 CommScope Inc Intellectual Property.
6 * =================================================================================================
7 * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
9 * may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14 * either express or implied. See the License for the specific language governing permissions and
15 * limitations under the License.
16 * ===============LICENSE_END=======================================================================
19 package org.commscope.tr069adapter.vesagent.util;
\r
21 import org.commscope.tr069adapter.acs.common.DeviceInform;
\r
22 import org.commscope.tr069adapter.vesagent.VesConfiguration;
\r
23 import org.commscope.tr069adapter.vesagent.model.CommonEventHeader;
\r
25 public class EventUtil {
\r
26 private EventUtil() {
\r
30 public static void populateEventHeaderFields(CommonEventHeader eventHeader,
\r
31 DeviceInform notification, String eNodeBName, VesConfiguration config) {
\r
32 eventHeader.setLastEpochMicrosec(System.currentTimeMillis());
\r
33 eventHeader.setSequence(0);
\r
34 populateEnodeBName(eventHeader, notification, eNodeBName);
\r
36 eventHeader.setStartEpochMicrosec(System.currentTimeMillis());
\r
37 eventHeader.setVersion(config.getEventVersion());
\r
38 eventHeader.setNfNamingCode("");
\r
39 eventHeader.setNfcNamingCode("");
\r
40 eventHeader.setNfVendorName(config.getVendorName());
\r
41 eventHeader.setVesEventListenerVersion(config.getVesVersion());
\r
44 public static void populateEnodeBName(CommonEventHeader eventHeader, DeviceInform notification,
\r
45 String eNodeBName) {
\r
46 if (eNodeBName == null) {
\r
47 eventHeader.setReportingEntityName(notification.getDeviceDetails().getDeviceId());
\r
48 eventHeader.setReportingEntityId(notification.getDeviceDetails().getDeviceId());
\r
49 eventHeader.setSourceId(notification.getDeviceDetails().getDeviceId());
\r
50 eventHeader.setSourceName(notification.getDeviceDetails().getDeviceId());
\r
52 eventHeader.setReportingEntityName(eNodeBName);
\r
53 eventHeader.setSourceName(eNodeBName);
\r
54 eventHeader.setReportingEntityId(notification.getDeviceDetails().getDeviceId());
\r
55 eventHeader.setSourceId(notification.getDeviceDetails().getDeviceId());
\r