2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml;
20 import javax.xml.bind.annotation.XmlElement;
21 import javax.xml.bind.annotation.XmlRootElement;
22 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.util.InternalDateAndTime;
23 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogBuilder;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.SourceType;
28 @XmlRootElement(name = "AttributeValueChangedNotification")
29 public class AttributeValueChangedNotificationXml extends MwtNotificationBase implements GetEventType {
31 private static String EVENTTYPE = "AttributeValueChangedNotification";
33 @XmlElement(name = "attributeName")
34 private String attributeName;
36 @XmlElement(name = "newValue")
37 private String newValue;
39 public AttributeValueChangedNotificationXml() {
44 * Normalized notification
46 * @param nodeName name of mountpoint
47 * @param counter of notification
48 * @param timeStamp from ne
49 * @param objectIdRef from ne
50 * @param attributeName from ne
51 * @param newValue from ne
53 public AttributeValueChangedNotificationXml(String nodeName, Integer counter, InternalDateAndTime timeStamp,
54 String objectIdRef, String attributeName, String newValue) {
55 super(nodeName, counter, timeStamp, objectIdRef);
56 this.attributeName = attributeName;
57 this.newValue = newValue;
60 public AttributeValueChangedNotificationXml(EventlogEntity eventlogEntitiy) {
61 this(eventlogEntitiy.getNodeId(), eventlogEntitiy.getCounter(),
62 InternalDateAndTime.valueOf(eventlogEntitiy.getTimestamp()), eventlogEntitiy.getObjectId(),
63 eventlogEntitiy.getAttributeName(), eventlogEntitiy.getNewValue());
67 public String getAttributeName() {
71 public String getNewValue() {
76 public String getEventType() {
80 public EventlogEntity getEventlogEntity() {
81 return new EventlogBuilder().setAttributeName(attributeName).setNewValue(newValue)
82 .setCounter(Integer.valueOf(this.getCounter())).setNodeId(this.getNodeName())
83 .setObjectId(this.getObjectId()).setTimestamp(new DateAndTime(this.getTimeStamp()))
84 .setSourceType(SourceType.Netconf).build();