summaryrefslogtreecommitdiffstats
path: root/lighty/ccsdk-lighty-module
diff options
context:
space:
mode:
authorTimoney, Dan (dt5972) <dtimoney@att.com>2019-08-29 11:23:04 -0400
committerTimoney, Dan (dt5972) <dtimoney@att.com>2019-08-29 11:23:21 -0400
commit22bb2af4ed106150230fd55e4314697e77f51e6a (patch)
treee6d74bea0de5b43e4eae2e77ac4ba5e4740bf739 /lighty/ccsdk-lighty-module
parent6e4a3b694045c930d4ce97766ed43d78e2cd3459 (diff)
Revert "Proposal to remove OSGi dependencies from the CCSDK project"
This reverts commit e385a7a1d1934c6a3d22df3c3244678ca415134a. Change-Id: I4d3e0d7996fc33ba443ce91f15e9a6dd670bec93 Signed-off-by: Timoney, Dan (dt5972) <dtimoney@att.com>
Diffstat (limited to 'lighty/ccsdk-lighty-module')
-rwxr-xr-xlighty/ccsdk-lighty-module/pom.xml97
-rw-r--r--lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/AAAEncryptionServiceLightyImpl.java116
-rw-r--r--lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/CcsdkLightyApplication.java170
-rw-r--r--lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/CcsdkLightyModule.java206
4 files changed, 0 insertions, 589 deletions
diff --git a/lighty/ccsdk-lighty-module/pom.xml b/lighty/ccsdk-lighty-module/pom.xml
deleted file mode 100755
index 063a17d0..00000000
--- a/lighty/ccsdk-lighty-module/pom.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.onap.ccsdk.parent</groupId>
- <artifactId>odlparent-lite</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
-
- <groupId>org.onap.ccsdk.distribution</groupId>
- <artifactId>ccsdk-lighty-module</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <properties>
- <jersey.version>2.26</jersey.version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>ccsdk-lighty-dependency-versions</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>io.lighty.core</groupId>
- <artifactId>lighty-controller</artifactId>
- </dependency>
- <dependency>
- <groupId>io.lighty.modules</groupId>
- <artifactId>lighty-restconf-nb-community</artifactId>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>ccsdk-core-lighty</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>org.apache.karaf.jaas.modules</artifactId>
- <groupId>org.apache.karaf.jaas</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.adaptors</groupId>
- <artifactId>ccsdk-adaptors-lighty</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.northbound</groupId>
- <artifactId>ccsdk-northbound-lighty</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.ccsdk.sli.plugins</groupId>
- <artifactId>ccsdk-plugins-lighty</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-recording</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.aaa</groupId>
- <artifactId>aaa-encrypt-service</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.5.2</version>
- </dependency>
- <!-- version 2.26 is not backwards compatible - https://stackoverflow.com/a/46405129/4727422 -->
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-common</artifactId>
- <version>${jersey.version}</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.inject</groupId>
- <artifactId>jersey-hk2</artifactId>
- <version>${jersey.version}</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/AAAEncryptionServiceLightyImpl.java b/lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/AAAEncryptionServiceLightyImpl.java
deleted file mode 100644
index 2610544a..00000000
--- a/lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/AAAEncryptionServiceLightyImpl.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * Copyright (c) 2019 PANTHEON.tech s.r.o.
- * ===================================================================
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- * OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END============================================
- *
- */
-package org.onap.ccsdk.distribution.lighty;
-
-import java.nio.charset.Charset;
-import javax.crypto.BadPaddingException;
-import javax.crypto.Cipher;
-import javax.crypto.IllegalBlockSizeException;
-import javax.xml.bind.DatatypeConverter;
-import org.onap.ccsdk.sli.core.dblib.DBLIBResourceProvider;
-import org.onap.ccsdk.sli.core.dblib.DBLIBResourceProviderLighty;
-import org.opendaylight.aaa.encrypt.AAAEncryptionService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Custom implementation of the {@link AAAEncryptionService}. Original class {@link DBLIBResourceProvider} was accessing
- * instance of this interface via OGSi (BundleContext) and java reflection. The implementation of
- * the {@link AAAEncryptionService} has to be injected via constructor into the lighty.io version of the class with
- * removed OSGi dependency {@link DBLIBResourceProviderLighty}.
- */
-public class AAAEncryptionServiceLightyImpl implements AAAEncryptionService {
-
- private static final Logger LOG = LoggerFactory.getLogger(AAAEncryptionServiceLightyImpl.class);
-
- private final Cipher encryptCipher;
- private final Cipher decryptCipher;
-
- public AAAEncryptionServiceLightyImpl(Cipher encryptCipher, Cipher decryptCipher) {
- this.encryptCipher = encryptCipher;
- this.decryptCipher = decryptCipher;
- }
-
- @Override
- public String encrypt(String data) {
- if (data != null && data.length() != 0 ) {
- try {
- synchronized (encryptCipher) {
- byte[] cryptobytes = encryptCipher.doFinal(data.getBytes(Charset.defaultCharset()));
- String cryptostring = DatatypeConverter.printBase64Binary(cryptobytes);
- return cryptostring;
- }
- } catch (IllegalBlockSizeException | BadPaddingException e) {
- LOG.error("Failed to encrypt data.", e);
- return data;
- }
- } else {
- LOG.warn("data is empty or null.");
- return data;
- }
- }
-
- @Override
- public byte[] encrypt(byte[] data) {
- if (data != null && data.length != 0) {
- try {
- synchronized (encryptCipher) {
- return encryptCipher.doFinal(data);
- }
- } catch (IllegalBlockSizeException | BadPaddingException e) {
- LOG.error("Failed to encrypt data.", e);
- return data;
- }
- } else {
- LOG.warn("data is empty or null.");
- return data;
- }
- }
-
- @Override
- public String decrypt(String encryptedData) {
- if (encryptedData != null && encryptedData.length() != 0) {
- try {
- byte[] cryptobytes = DatatypeConverter.parseBase64Binary(encryptedData);
- byte[] clearbytes = decryptCipher.doFinal(cryptobytes);
- return new String(clearbytes, Charset.defaultCharset());
- } catch (IllegalBlockSizeException | BadPaddingException e) {
- LOG.error("Failed to decrypt encoded data", e);
- return encryptedData;
- }
- } else {
- LOG.warn("encryptedData is empty or null.");
- return encryptedData;
- }
- }
-
- @Override
- public byte[] decrypt(byte[] encryptedData) {
- if (encryptedData != null && encryptedData.length != 0) {
- try {
- return decryptCipher.doFinal(encryptedData);
- } catch (IllegalBlockSizeException | BadPaddingException e) {
- LOG.error("Failed to decrypt encoded data", e);
- return encryptedData;
- }
- } else {
- LOG.warn("encryptedData is empty or null.");
- return encryptedData;
- }
- }
-
-}
diff --git a/lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/CcsdkLightyApplication.java b/lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/CcsdkLightyApplication.java
deleted file mode 100644
index efecb3f1..00000000
--- a/lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/CcsdkLightyApplication.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * Copyright (c) 2019 PANTHEON.tech s.r.o.
- * ===================================================================
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- * OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END============================================
- *
- */
-package org.onap.ccsdk.distribution.lighty;
-
-import io.lighty.core.controller.api.AbstractLightyModule;
-import io.lighty.core.controller.api.LightyController;
-import io.lighty.core.controller.impl.LightyControllerBuilder;
-import io.lighty.core.controller.impl.config.ConfigurationException;
-import io.lighty.core.controller.impl.config.ControllerConfiguration;
-import io.lighty.modules.northbound.restconf.community.impl.CommunityRestConf;
-import io.lighty.modules.northbound.restconf.community.impl.CommunityRestConfBuilder;
-import io.lighty.modules.northbound.restconf.community.impl.config.RestConfConfiguration;
-import io.lighty.modules.northbound.restconf.community.impl.util.RestConfConfigUtils;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-import java.util.Base64;
-import javax.crypto.Cipher;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.SecretKey;
-import javax.crypto.SecretKeyFactory;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.PBEKeySpec;
-import javax.crypto.spec.SecretKeySpec;
-import org.onap.ccsdk.sli.core.lighty.common.CcsdkLightyUtils;
-import org.opendaylight.aaa.encrypt.AAAEncryptionService;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yang.gen.v1.config.aaa.authn.encrypt.service.config.rev160915.AaaEncryptServiceConfig;
-import org.opendaylight.yang.gen.v1.config.aaa.authn.encrypt.service.config.rev160915.AaaEncryptServiceConfigBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that groups all necessary components
- * needed to start the CCSDK lighty.io application.
- */
-public class CcsdkLightyApplication extends AbstractLightyModule {
-
- private static final Logger LOG = LoggerFactory.getLogger(CcsdkLightyApplication.class);
-
- private ControllerConfiguration controllerConfiguration;
- private RestConfConfiguration restConfConfiguration;
-
- private LightyController lightyController;
- private CommunityRestConf communityRestConf;
- private CcsdkLightyModule ccsdkLightyModule;
-
- public CcsdkLightyApplication(ControllerConfiguration controllerConfiguration,
- RestConfConfiguration restConfConfiguration) {
- this.controllerConfiguration = controllerConfiguration;
- this.restConfConfiguration = restConfConfiguration;
- }
-
- @Override
- protected boolean initProcedure() {
- // Start Lighty Controller with base OLD services
- LightyControllerBuilder lightyControllerBuilder = new LightyControllerBuilder();
- try {
- lightyController = lightyControllerBuilder.from(controllerConfiguration).build();
- } catch (ConfigurationException e) {
- LOG.error("Exception thrown while starting Lighty controller!", e);
- return false;
- }
- if (!CcsdkLightyUtils.startLightyModule(lightyController)) {
- LOG.error("Unable to start Lighty controller!");
- return false;
- }
-
- // Start RestConf
- CommunityRestConfBuilder communityRestConfBuilder = new CommunityRestConfBuilder();
- communityRestConf = communityRestConfBuilder
- .from(RestConfConfigUtils.getRestConfConfiguration(restConfConfiguration,
- lightyController.getServices()))
- .build();
- if (!CcsdkLightyUtils.startLightyModule(communityRestConf)) {
- LOG.error("Unable to start RestConf!");
- return false;
- }
-
- // Start Lighty CCSDK
- AAAEncryptionService aaaEncryptionService = null;
- try {
- aaaEncryptionService = createAAAEncryptionService(getDefaultAaaEncryptServiceConfig());
- } catch (ConfigurationException e) {
- LOG.error("Exception thrown while initializing {}!", AAAEncryptionService.class, e);
- }
- DataBroker dataBroker = lightyController.getServices().getControllerBindingDataBroker();
- NotificationPublishService notificationPublishService = lightyController.getServices()
- .getControllerBindingNotificationPublishService();
- RpcProviderRegistry rpcProviderRegistry = lightyController.getServices().getControllerRpcProviderRegistry();
- ccsdkLightyModule = new CcsdkLightyModule(dataBroker, notificationPublishService,
- rpcProviderRegistry, aaaEncryptionService);
- if (!CcsdkLightyUtils.startLightyModule(ccsdkLightyModule)) {
- LOG.error("Unable to start CCSDK Lighty module!");
- return false;
- }
-
- return true;
- }
-
- @Override
- protected boolean stopProcedure() {
- boolean stopSuccessful = true;
-
- if (!CcsdkLightyUtils.stopLightyModule(ccsdkLightyModule)) {
- stopSuccessful = false;
- }
-
- if (!CcsdkLightyUtils.stopLightyModule(communityRestConf)) {
- stopSuccessful = false;
- }
-
- if (!CcsdkLightyUtils.stopLightyModule(lightyController)) {
- stopSuccessful = false;
- }
-
- return stopSuccessful;
- }
-
- private AAAEncryptionService createAAAEncryptionService(AaaEncryptServiceConfig encrySrvConfig)
- throws ConfigurationException {
- final byte[] encryptionKeySalt = Base64.getDecoder().decode(encrySrvConfig.getEncryptSalt());
- try {
- final SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(encrySrvConfig.getEncryptMethod());
- final KeySpec keySpec = new PBEKeySpec(encrySrvConfig.getEncryptKey().toCharArray(), encryptionKeySalt,
- encrySrvConfig.getEncryptIterationCount(), encrySrvConfig.getEncryptKeyLength());
- SecretKey key = new SecretKeySpec(keyFactory.generateSecret(keySpec).getEncoded(),
- encrySrvConfig.getEncryptType());
- IvParameterSpec ivParameterSpec = new IvParameterSpec(encryptionKeySalt);
-
- Cipher encryptCipher = Cipher.getInstance(encrySrvConfig.getCipherTransforms());
- encryptCipher.init(Cipher.ENCRYPT_MODE, key, ivParameterSpec);
-
- Cipher decryptCipher = Cipher.getInstance(encrySrvConfig.getCipherTransforms());
- decryptCipher.init(Cipher.DECRYPT_MODE, key, ivParameterSpec);
-
- return new AAAEncryptionServiceLightyImpl(encryptCipher, decryptCipher);
-
- } catch (NoSuchAlgorithmException | InvalidKeySpecException | NoSuchPaddingException
- | InvalidAlgorithmParameterException | InvalidKeyException e) {
- throw new ConfigurationException(e);
- }
- }
-
- private AaaEncryptServiceConfig getDefaultAaaEncryptServiceConfig() {
- return new AaaEncryptServiceConfigBuilder().setEncryptKey("V1S1ED4OMeEh")
- .setPasswordLength(12).setEncryptSalt("TdtWeHbch/7xP52/rp3Usw==")
- .setEncryptMethod("PBKDF2WithHmacSHA1").setEncryptType("AES")
- .setEncryptIterationCount(32768).setEncryptKeyLength(128)
- .setCipherTransforms("AES/CBC/PKCS5Padding").build();
- }
-}
diff --git a/lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/CcsdkLightyModule.java b/lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/CcsdkLightyModule.java
deleted file mode 100644
index 061afc8b..00000000
--- a/lighty/ccsdk-lighty-module/src/main/java/org/onap/ccsdk/distribution/lighty/CcsdkLightyModule.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * Copyright (c) 2019 PANTHEON.tech s.r.o.
- * ===================================================================
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
- * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- * OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END============================================
- *
- */
-package org.onap.ccsdk.distribution.lighty;
-
-import com.google.common.collect.ImmutableSet;
-import io.lighty.core.controller.api.AbstractLightyModule;
-import java.util.Set;
-import org.onap.ccsdk.sli.adaptors.lighty.CcsdkAdaptorsLightyModule;
-import org.onap.ccsdk.sli.core.dblib.lighty.DblibModule;
-import org.onap.ccsdk.sli.core.lighty.common.CcsdkLightyUtils;
-import org.onap.ccsdk.sli.core.sli.lighty.SliModule;
-import org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder;
-import org.onap.ccsdk.sli.core.sliapi.lighty.SliApiModule;
-import org.onap.ccsdk.sli.core.slipluginutils.lighty.SliPluginUtilsModule;
-import org.onap.ccsdk.sli.northbound.lighty.CcsdkNorhboundLightyModule;
-import org.onap.ccsdk.sli.plugins.lighty.CcsdkPluginsLightyModule;
-import org.opendaylight.aaa.encrypt.AAAEncryptionService;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The implementation of the {@link io.lighty.core.controller.api.LightyModule} that groups all other LightyModules
- * from the CCSDK project so they can be all treated as one component (for example started/stopped at once).
- * For more information about the lighty.io visit the website https://lighty.io.
- */
-public class CcsdkLightyModule extends AbstractLightyModule {
-
- private static final Logger LOG = LoggerFactory.getLogger(CcsdkLightyModule.class);
-
- public static final Set<YangModuleInfo> YANG_MODELS = ImmutableSet.of(
- org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.$YangModuleInfoImpl.getInstance(),
- org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.$YangModuleInfoImpl.getInstance(),
- org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.datachange.rev150519.$YangModuleInfoImpl.getInstance(),
- org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.asdcapi.common.rev170201.$YangModuleInfoImpl.getInstance(),
- org.opendaylight.yang.gen.v1.http.xmlns.onap.org.asdc.license.model._1._0.rev160427.$YangModuleInfoImpl.getInstance(),
- org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev170201.$YangModuleInfoImpl.getInstance()
- );
-
- private final DataBroker dataBroker;
- private final NotificationPublishService notificationPublishService;
- private final RpcProviderRegistry rpcProviderRegistry;
- private final AAAEncryptionService aaaEncryptionService;
-
- private CcsdkAdaptorsLightyModule ccsdkAdaptorsLightyModule;
- private CcsdkNorhboundLightyModule ccsdkNorhboundLightyModule;
- private CcsdkPluginsLightyModule ccsdkPluginsLightyModule;
- private DblibModule dblibModule;
- private SliModule sliModule;
- private SliApiModule sliApiModule;
- private SliPluginUtilsModule sliPluginUtilsModule;
-
- public CcsdkLightyModule(DataBroker dataBroker, NotificationPublishService notificationPublishService,
- RpcProviderRegistry rpcProviderRegistry, AAAEncryptionService aaaEncryptionService) {
- this.dataBroker = dataBroker;
- this.notificationPublishService = notificationPublishService;
- this.rpcProviderRegistry = rpcProviderRegistry;
- this.aaaEncryptionService = aaaEncryptionService;
- }
-
- protected boolean initProcedure() {
- // FIXME modules from CcsdkCoreLightyModule need to be started separately (not through CcsdkCoreLightyModule
- // itself) because SliApiModule is dependent on the adaptors
- try {
- LOG.debug("Initializing CCSDK Lighty module...");
-
- this.dblibModule = new DblibModule(aaaEncryptionService);
- if (!CcsdkLightyUtils.startLightyModule(dblibModule)) {
- LOG.error("Unable to start DblibModule in CCSDK Core Lighty module!");
- return false;
- }
-
- this.ccsdkAdaptorsLightyModule = new CcsdkAdaptorsLightyModule(dblibModule.getDbLibService());
- if (!CcsdkLightyUtils.startLightyModule(ccsdkAdaptorsLightyModule)) {
- LOG.error("Unable to start CcsdkAdaptorsLightyModule in CCSDK Lighty module!");
- return false;
- }
-
- this.sliModule = new SliModule(dblibModule.getDbLibService(),
- ccsdkAdaptorsLightyModule.getAaaServiceModule().getAAIService(), new Slf4jRecorder(),
- ccsdkAdaptorsLightyModule.getAaaServiceModule().getAAIService(), null);
- if (!CcsdkLightyUtils.startLightyModule(sliModule)) {
- LOG.error("Unable to start SliModule in CCSDK Core Lighty module!");
- return false;
- }
-
- this.sliApiModule = new SliApiModule(dataBroker, notificationPublishService, rpcProviderRegistry, sliModule.getSvcLogicServiceImpl());
- if (!CcsdkLightyUtils.startLightyModule(sliApiModule)) {
- LOG.error("Unable to start SliApiModule in CCSDK Core Lighty module!");
- return false;
- }
-
- this.sliPluginUtilsModule = new SliPluginUtilsModule();
- if (!CcsdkLightyUtils.startLightyModule(sliPluginUtilsModule)) {
- LOG.error("Unable to start SliPluginUtilsModule in CCSDK Core Lighty module!");
- return false;
- }
-
- this.ccsdkPluginsLightyModule = new CcsdkPluginsLightyModule();
- if (!CcsdkLightyUtils.startLightyModule(ccsdkPluginsLightyModule)) {
- LOG.error("Unable to start CcsdkPluginsLightyModule in CCSDK Lighty module!");
- return false;
- }
-
- this.ccsdkNorhboundLightyModule =
- new CcsdkNorhboundLightyModule(sliModule.getSvcLogicServiceImpl(), dataBroker,
- notificationPublishService, rpcProviderRegistry);
- if (!CcsdkLightyUtils.startLightyModule(ccsdkNorhboundLightyModule)) {
- LOG.error("Unable to start CcsdkNorhboundLightyModule in CCSDK Lighty module!");
- return false;
- }
-
- LOG.debug("CCSDK Lighty module was initialized successfully");
- return true;
- } catch (Exception e) {
- LOG.error("Exception caught!", e);
- throw e;
- }
- }
-
- protected boolean stopProcedure() {
- LOG.debug("Stopping CCSDK Lighty module...");
-
- boolean stopSuccessful = true;
-
- if (!CcsdkLightyUtils.stopLightyModule(ccsdkPluginsLightyModule)) {
- stopSuccessful = false;
- }
-
- if (!CcsdkLightyUtils.stopLightyModule(ccsdkNorhboundLightyModule)) {
- stopSuccessful = false;
- }
-
- if (!CcsdkLightyUtils.stopLightyModule(ccsdkAdaptorsLightyModule)) {
- stopSuccessful = false;
- }
-
- if (!CcsdkLightyUtils.stopLightyModule(sliPluginUtilsModule)) {
- stopSuccessful = false;
- }
-
- if (!CcsdkLightyUtils.stopLightyModule(sliApiModule)) {
- stopSuccessful = false;
- }
-
- if (!CcsdkLightyUtils.stopLightyModule(sliModule)) {
- stopSuccessful = false;
- }
-
- if (!CcsdkLightyUtils.stopLightyModule(dblibModule)) {
- stopSuccessful = false;
- }
-
- if (stopSuccessful) {
- LOG.debug("CCSDK Lighty module was stopped successfully");
- } else {
- LOG.error("CCSDK Lighty module was not stopped successfully!");
- }
- return stopSuccessful;
- }
-
- public CcsdkAdaptorsLightyModule getCcsdkAdaptorsLightyModule() {
- return ccsdkAdaptorsLightyModule;
- }
-
- public CcsdkNorhboundLightyModule getCcsdkNorhboundLightyModule() {
- return ccsdkNorhboundLightyModule;
- }
-
- public CcsdkPluginsLightyModule getCcsdkPluginsLightyModule() {
- return ccsdkPluginsLightyModule;
- }
-
- public DblibModule getDblibModule() {
- return dblibModule;
- }
-
- public SliModule getSliModule() {
- return sliModule;
- }
-
- public SliApiModule getSliApiModule() {
- return sliApiModule;
- }
-
- public SliPluginUtilsModule getSliPluginUtilsModule() {
- return sliPluginUtilsModule;
- }
-}