de7ccc31cbc0f6f1dcd3e8a82d8562e405f6ba23
[ccsdk/features.git] /
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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
15  * the License.
16  * ============LICENSE_END==========================================================================
17  */
18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml;
19
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;
24
25 @Deprecated
26 public class MwtNotificationBase {
27
28     private static String EMPTY = "empty";
29
30     private String nodeName;
31     private String counter;
32     private String timeStamp;
33     private @Nonnull String objectId;
34
35     public MwtNotificationBase() {
36         // For Jaxb
37         this.objectId = EMPTY;
38     }
39
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;
47         }
48     }
49
50     @XmlElement(name = "nodeName")
51     public String getNodeName() {
52         return nodeName;
53     }
54
55     @XmlElement(name = "counter")
56     public String getCounter() {
57         return counter;
58     }
59
60     @XmlElement(name = "timeStamp")
61     public String getTimeStamp() {
62         return timeStamp;
63     }
64
65     @XmlElement(name = "objectId")
66     public String getObjectId() {
67         return objectId;
68     }
69
70     /**
71      * Type for the Database to document the the same name that is used in the websockets.
72      *
73      * @return String with type name of child class
74      */
75     @JsonProperty("type")
76     public String getType() {
77         return this.getClass().getSimpleName();
78     }
79
80     @Override
81     public String toString() {
82         return "MwtNotificationBase [getType()=" + getType() + ", nodeName=" + nodeName + ", counter=" + counter
83                 + ", timeStamp=" + timeStamp + ", objectId=" + objectId + "]";
84     }
85
86
87
88 }