2 * Copyright (c) 2016 Wipro Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.mwtn.devicemanager.impl.xml;
11 import javax.xml.bind.annotation.XmlElement;
13 import org.opendaylight.mwtn.base.internalTypes.InternalDateAndTime;
15 import com.fasterxml.jackson.annotation.JsonProperty;
17 public class MwtNotificationBase {
19 private static String EMPTY = "empty";
21 private String nodeName;
22 private String counter;
23 private String timeStamp;
24 private String objectId;
26 public MwtNotificationBase() {
30 public MwtNotificationBase(String nodeName, String counter, InternalDateAndTime timeStamp, String objectId) {
31 this.nodeName = nodeName;
32 this.counter = counter;
33 this.timeStamp = timeStamp.getValue();
34 this.objectId = objectId;
35 if (this.objectId == null) {
36 this.objectId = EMPTY;
40 @XmlElement(name = "nodeName")
41 public String getNodeName() {
45 @XmlElement(name = "counter")
46 public String getCounter() {
50 @XmlElement(name = "timeStamp")
51 public String getTimeStamp() {
55 @XmlElement(name = "objectId")
56 public String getObjectId() {
61 * Type for the Database to document the the same name that is used in the websockets.
62 * @return String with type name of child class
65 public String getType() {
66 return this.getClass().getSimpleName();
70 public String toString() {
71 return "MwtNotificationBase [getType()="+ getType() + ", nodeName=" + nodeName + ", counter=" + counter + ", timeStamp=" + timeStamp
72 + ", objectId=" + objectId + "]";