Proposal to remove OSGi dependencies from the CCSDK project
[ccsdk/sli/plugins.git] / restconf-client / lighty / src / main / java / org / onap / ccsdk / sli / plugins / restconf / lighty / RestconfClientModule.java
1 /*
2  * ============LICENSE_START==========================================
3  * Copyright (c) 2019 PANTHEON.tech s.r.o.
4  * ===================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
11  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
12  * OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
13  * limitations under the License.
14  * ============LICENSE_END============================================
15  *
16  */
17 package org.onap.ccsdk.sli.plugins.restconf.lighty;
18
19 import io.lighty.core.controller.api.AbstractLightyModule;
20 import io.lighty.core.controller.api.LightyModule;
21 import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode;
22 import org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode;
23 import org.onap.ccsdk.sli.plugins.restconfdiscovery.RestconfDiscoveryNode;
24
25 /**
26  * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that manages and provides services from
27  * the restconf-client-provider artifact.
28  */
29 public class RestconfClientModule extends AbstractLightyModule implements LightyModule {
30
31     private final RestapiCallNode restapiCallNode;
32
33     private RestconfApiCallNode restconfApiCallNode;
34     private RestconfDiscoveryNode restconfDiscoveryNode;
35
36     public RestconfClientModule(final RestapiCallNode restapiCallNode) {
37         this.restapiCallNode = restapiCallNode;
38     }
39
40     @Override
41     protected boolean initProcedure() {
42         this.restconfApiCallNode = new RestconfApiCallNode(restapiCallNode);
43         this.restconfDiscoveryNode = new RestconfDiscoveryNode(restconfApiCallNode);
44         return true;
45     }
46
47     @Override
48     protected boolean stopProcedure() {
49         return true;
50     }
51
52     public RestconfApiCallNode getRestconfApiCallNode() {
53         return this.restconfApiCallNode;
54     }
55
56     public RestconfDiscoveryNode getRestconfDiscoveryNode() {
57         return this.restconfDiscoveryNode;
58     }
59 }