add new devicemanager
[ccsdk/features.git] / sdnr / wt / devicemanager / provider / src / main / java / org / onap / ccsdk / features / sdnr / wt / devicemanager / base / onfcore / ONFCoreNetworkElementEmpty.java
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 /**
19  *
20  */
21 package org.onap.ccsdk.features.sdnr.wt.devicemanager.base.onfcore;
22
23 import java.util.Optional;
24 import org.onap.ccsdk.features.sdnr.wt.devicemanager.NetworkElementService;
25 import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.onfcore.container.AllPm;
26 import org.onap.ccsdk.features.sdnr.wt.devicemanager.legacy.InventoryInformation;
27 import org.opendaylight.mdsal.binding.api.DataBroker;
28 import org.opendaylight.mdsal.binding.api.MountPoint;
29 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementDeviceType;
31 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
32 import org.slf4j.Logger;
33 import org.slf4j.LoggerFactory;
34
35 /**
36  * @author herbert
37  *
38  */
39 public class ONFCoreNetworkElementEmpty implements ONFCoreNetworkElementRepresentation {
40
41     private static final Logger LOG = LoggerFactory.getLogger(ONFCoreNetworkElementEmpty.class);
42
43     private final String mountPointNodeName;
44     private final NodeId nodeId;
45
46     ONFCoreNetworkElementEmpty(String mountPointNodeName) {
47         LOG.info("Create {}",ONFCoreNetworkElementEmpty.class.getSimpleName());
48         this.mountPointNodeName = mountPointNodeName;
49         this.nodeId = new NodeId(mountPointNodeName);
50     }
51
52     @Override
53     public void initialReadFromNetworkElement() {
54     }
55
56     @Override
57     public String getMountPointNodeName() {
58         return mountPointNodeName;
59     }
60
61     @Override
62     public String getMountpoint() {
63         return mountPointNodeName;
64     }
65
66     @Override
67     public void resetPMIterator() {
68     }
69
70     @Override
71     public boolean hasNext() {
72         return false;
73     }
74
75     @Override
76     public void next() {
77     }
78
79     @Override
80     public AllPm getHistoricalPM() {
81         return AllPm.getEmpty();
82     }
83
84     @Override
85     public String pmStatusToString() {
86         return this.getClass().getSimpleName();
87     }
88
89     @Override
90     public int removeAllCurrentProblemsOfNode() {
91         return 0;
92     }
93
94     @Override
95     public void doRegisterEventListener(MountPoint mointPoint) {
96         //Do nothing
97     }
98
99     @Override
100     public void prepareCheck() {
101         //Do nothing here
102     }
103
104     @Override
105     public boolean checkIfConnectionToMediatorIsOk() {
106         return true;
107     }
108
109     @Override
110     public boolean checkIfConnectionToNeIsOk() {
111         return true;
112     }
113
114     @Override
115     public InventoryInformation getInventoryInformation() {
116         return InventoryInformation.getDefault();
117     }
118
119     @Override
120     public InventoryInformation getInventoryInformation(String layerProtocolFilter) {
121         return InventoryInformation.getDefault();
122     }
123
124     @Override
125     public DataBroker getDataBroker() {
126         return null;
127     }
128
129     @Override
130     public NetworkElement getOptionalNetworkElement() {
131         return null;
132     }
133
134     @Override
135     public NetworkElementDeviceType getDeviceType() {
136         return  NetworkElementDeviceType.Unknown;
137     }
138
139     @Override
140     public void register() {
141     }
142
143     @Override
144     public void deregister() {
145     }
146
147     @Override
148     public NodeId getNodeId() {
149         return nodeId;
150     }
151
152     @Override
153     public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) {
154         return Optional.empty();
155     }
156
157     @Override
158     public void warmstart() {
159     }
160
161 }