SDN-R Server provide GUI cut through for ODLUX
[ccsdk/features.git] / sdnr / wt / devicemanager-adapter-manager / provider / src / main / java / org / onap / ccsdk / features / sdnr / wt / devicemanager / adaptermanager / impl / NtsNetworkElement.java
1 /*
2  * ============LICENSE_START========================================================================
3  * ONAP : ccsdk feature sdnr wt
4  * =================================================================================================
5  * Copyright (C) 2020 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.adaptermanager.impl;
19
20 import java.util.Optional;
21 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
22 import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
23 import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElementService;
24 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementDeviceType;
26 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30 /**
31  * @author herbert
32  *
33  */
34 public class NtsNetworkElement implements NetworkElement {
35
36     private static final Logger LOG = LoggerFactory.getLogger(NtsNetworkElement.class);
37
38     private final NetconfAccessor netconfAccessor;
39
40     @SuppressWarnings("unused")
41     private final DataProvider databaseService;
42
43     NtsNetworkElement(NetconfAccessor netconfAccess, DataProvider databaseService) {
44         LOG.info("Create {}", NtsNetworkElement.class.getSimpleName());
45         this.netconfAccessor = netconfAccess;
46         this.databaseService = databaseService;
47     }
48
49     @Override
50     public void deregister() {}
51
52     @Override
53     public NodeId getNodeId() {
54         return netconfAccessor.getNodeId();
55     }
56
57     @Override
58     public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) {
59         return Optional.empty();
60     }
61
62     @Override
63     public void warmstart() {}
64
65     @Override
66     public void register() {}
67
68     @Override
69     public NetworkElementDeviceType getDeviceType() {
70         return NetworkElementDeviceType.NtsManager;
71     }
72
73     @Override
74     public Optional<NetconfAccessor> getAcessor() {
75         return Optional.of(this.netconfAccessor);
76     }
77 }