Add o-ran devicemanager
[oam.git] / features / devicemanager / o-ran / ru-fh / provider / src / main / java / org / oransc / oam / features / devicemanager / oran / impl / NtsNetworkElement.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.oransc.oam.features.devicemanager.oran.impl;
22
23 import java.util.Optional;
24 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
25 import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
26 import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElementService;
27 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementDeviceType;
29 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
30 import org.slf4j.Logger;
31 import org.slf4j.LoggerFactory;
32
33 /**
34  * @author herbert
35  *
36  */
37 public class NtsNetworkElement implements NetworkElement {
38
39     private static final Logger LOG = LoggerFactory.getLogger(NtsNetworkElement.class);
40
41     private final NetconfAccessor netconfAccessor;
42
43     @SuppressWarnings("unused")
44     private final DataProvider databaseService;
45
46     NtsNetworkElement(NetconfAccessor netconfAccess, DataProvider databaseService) {
47         LOG.info("Create {}",NtsNetworkElement.class.getSimpleName());
48         this.netconfAccessor = netconfAccess;
49         this.databaseService = databaseService;
50     }
51
52     @Override
53     public void deregister() {
54     }
55
56     @Override
57     public NodeId getNodeId() {
58         return netconfAccessor.getNodeId();
59     }
60
61     @Override
62     public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) {
63         return Optional.empty();
64     }
65
66     @Override
67     public void warmstart() {
68     }
69
70     @Override
71     public void register() {
72     }
73
74     @Override
75     public NetworkElementDeviceType getDeviceType() {
76         return NetworkElementDeviceType.NtsManager;
77     }
78
79     @Override
80     public Optional<NetconfAccessor> getAcessor() {
81         return Optional.of(this.netconfAccessor);
82     }
83 }