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 com.fasterxml.jackson.annotation.JsonProperty;
21 import javax.annotation.Nonnull;
22 import javax.xml.bind.annotation.XmlElement;
23 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.util.InternalDateAndTime;
26 public class MwtNotificationBase {
28 private static String EMPTY = "empty";
30 private String nodeName;
31 private String counter;
32 private String timeStamp;
33 private @Nonnull String objectId;
35 public MwtNotificationBase() {
37 this.objectId = EMPTY;
40 public MwtNotificationBase(String nodeName, Integer counter, InternalDateAndTime timeStamp, String objectId) {
41 this.nodeName = nodeName;
42 this.counter = String.valueOf(counter);
43 this.timeStamp = timeStamp.getValue();
44 this.objectId = objectId;
45 if (this.objectId == null) {
46 this.objectId = EMPTY;
50 @XmlElement(name = "nodeName")
51 public String getNodeName() {
55 @XmlElement(name = "counter")
56 public String getCounter() {
60 @XmlElement(name = "timeStamp")
61 public String getTimeStamp() {
65 @XmlElement(name = "objectId")
66 public String getObjectId() {
71 * Type for the Database to document the the same name that is used in the websockets.
73 * @return String with type name of child class
76 public String getType() {
77 return this.getClass().getSimpleName();
81 public String toString() {
82 return "MwtNotificationBase [getType()=" + getType() + ", nodeName=" + nodeName + ", counter=" + counter
83 + ", timeStamp=" + timeStamp + ", objectId=" + objectId + "]";