ae49542b41f4710ed8cb3f821d13c80aeea166ae
[ccsdk/sli/adaptors.git] /
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.adaptors.ansible.lighty;
18
19 import io.lighty.core.controller.api.AbstractLightyModule;
20 import org.onap.ccsdk.sli.adaptors.ansible.AnsibleAdapter;
21 import org.onap.ccsdk.sli.adaptors.ansible.impl.AnsibleAdapterImpl;
22 import org.onap.ccsdk.sli.adaptors.ansible.impl.AnsibleAdapterPropertiesProviderImplLighty;
23
24 /**
25  * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that manages and provides services from
26  * the ansible-adaptor artifact.
27  */
28 public class AnsibleAdapterModule extends AbstractLightyModule {
29
30     private AnsibleAdapterPropertiesProviderImplLighty ansibleProviderImpl;
31     private AnsibleAdapterImpl ansibleAdapterImpl;
32
33     @Override
34     protected boolean initProcedure() {
35         this.ansibleProviderImpl = new AnsibleAdapterPropertiesProviderImplLighty();
36         this.ansibleAdapterImpl = new AnsibleAdapterImpl(ansibleProviderImpl);
37         return true;
38     }
39
40     @Override
41     protected boolean stopProcedure() {
42         return true;
43     }
44
45     public AnsibleAdapterPropertiesProviderImplLighty getAnsibleAdapterPropertiesProviderImpl() {
46         return this.ansibleProviderImpl;
47     }
48
49     public AnsibleAdapter getAnsibleAdapterImpl() {
50         return ansibleAdapterImpl;
51     }
52 }