1 /*******************************************************************************
 
   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==========================================================================
 
  17  ******************************************************************************/
 
  18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml;
 
  20 import com.fasterxml.jackson.annotation.JsonProperty;
 
  21 import javax.xml.bind.annotation.XmlElement;
 
  22 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.internalTypes.InternalDateAndTime;
 
  24 public class MwtNotificationBase {
 
  26     private static String EMPTY = "empty";
 
  28     private String nodeName;
 
  29     private String counter;
 
  30     private String timeStamp;
 
  31     private String objectId;
 
  33     public MwtNotificationBase() {
 
  37     public MwtNotificationBase(String nodeName, String counter, InternalDateAndTime timeStamp, String objectId) {
 
  38         this.nodeName = nodeName;
 
  39         this.counter = counter;
 
  40         this.timeStamp = timeStamp.getValue();
 
  41         this.objectId = objectId;
 
  42         if (this.objectId == null) {
 
  43             this.objectId = EMPTY;
 
  47     @XmlElement(name = "nodeName")
 
  48     public String getNodeName() {
 
  52     @XmlElement(name = "counter")
 
  53     public String getCounter() {
 
  57     @XmlElement(name = "timeStamp")
 
  58     public String getTimeStamp() {
 
  62     @XmlElement(name = "objectId")
 
  63     public String getObjectId() {
 
  68      * Type for the Database to document the the same name that is used in the websockets.
 
  69      * @return String with type name of child class
 
  72     public String getType() {
 
  73         return this.getClass().getSimpleName();
 
  77     public String toString() {
 
  78         return "MwtNotificationBase [getType()="+ getType() + ", nodeName=" + nodeName + ", counter=" + counter + ", timeStamp=" + timeStamp
 
  79                 + ", objectId=" + objectId + "]";