9949056bbb7ed0d2cc8d7bcf78b90d3182152fe5
[ccsdk/features.git] /
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP : ccsdk features
4  * ================================================================================
5  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  */
22 package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl;
23
24 import java.util.Optional;
25 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
26 import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
27 import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElementService;
28 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
29 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
30 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementDeviceType;
32 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
33
34 public class OpenroadmNetworkElementBase implements NetworkElement {
35
36     protected final NetconfBindingAccessor netconfAccessor;
37     protected final DataProvider databaseService;
38
39     public OpenroadmNetworkElementBase(NetconfBindingAccessor netconfAccess,
40             DeviceManagerServiceProvider serviceProvider) {
41
42         this.netconfAccessor = netconfAccess;
43         this.databaseService = serviceProvider.getDataProvider();
44     }
45
46     @Override
47     public void register() {}
48
49     @Override
50     public void deregister() {}
51
52     @Override
53     public void warmstart() {}
54
55     @Override
56     public NodeId getNodeId() {
57         return netconfAccessor.getNodeId();
58     }
59
60     @Override
61     public NetworkElementDeviceType getDeviceType() {
62         return NetworkElementDeviceType.OROADM;
63     }
64
65     @Override
66     public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) {
67         return Optional.empty();
68     }
69
70     @Override
71     public Optional<NetconfAccessor> getAcessor() {
72         return Optional.of(netconfAccessor);
73     }
74 }