9f69018f80f1bcc295d09ba4adc1efd78765a7c0
[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     // variables
36     protected final NetconfBindingAccessor netconfAccessor;
37     protected final DataProvider databaseService;
38     // end of variables
39     // constructors
40     public OpenroadmNetworkElementBase(NetconfBindingAccessor netconfAccess,
41             DeviceManagerServiceProvider serviceProvider) {
42
43         this.netconfAccessor = netconfAccess;
44         this.databaseService = serviceProvider.getDataProvider();
45     }
46     // end of constructors
47     //public methods
48     @Override
49     public void register() {}
50
51     @Override
52     public void deregister() {}
53
54     @Override
55     public void warmstart() {}
56
57     @Override
58     public NodeId getNodeId() {
59         return netconfAccessor.getNodeId();
60     }
61
62     @Override
63     public NetworkElementDeviceType getDeviceType() {
64         return NetworkElementDeviceType.OROADM;
65     }
66
67     @Override
68     public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) {
69         return Optional.empty();
70     }
71
72     @Override
73     public Optional<NetconfAccessor> getAcessor() {
74         return Optional.of(netconfAccessor);
75     }
76     // end of public methods
77 }