From 2f9e781a7c3e22bf25df83dcc3ff44b885a80957 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Wed, 3 Feb 2021 14:09:25 +0100 Subject: Adapt SDNR northbound to Aluminium Adapt SDNR northbound to Aluminium Issue-ID: CCSDK-3128 Signed-off-by: Ravi Pendurty Change-Id: Id2dc38d4f2573d5c6aeedfb42349433f22aa86f5 Signed-off-by: Ravi Pendurty --- sdnr/northbound/oofpcipoc/consumer/pom.xml | 16 +------- .../northbound/oofpcipoc/OofpcipocHandleNotif.java | 44 ++++++++++----------- .../oofpcipoc/handlenotif/pojos/CellConfig.java | 20 ++++++++++ .../handlenotif/pojos/NeighborListInUse.java | 20 ++++++++++ .../OSGI-INF/blueprint/impl-blueprint.xml | 45 ---------------------- .../org/opendaylight/blueprint/impl-blueprint.xml | 2 +- 6 files changed, 62 insertions(+), 85 deletions(-) delete mode 100644 sdnr/northbound/oofpcipoc/consumer/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml (limited to 'sdnr/northbound/oofpcipoc/consumer') diff --git a/sdnr/northbound/oofpcipoc/consumer/pom.xml b/sdnr/northbound/oofpcipoc/consumer/pom.xml index b05464d5a..950ee3524 100644 --- a/sdnr/northbound/oofpcipoc/consumer/pom.xml +++ b/sdnr/northbound/oofpcipoc/consumer/pom.xml @@ -26,7 +26,7 @@ org.onap.ccsdk.parent binding-parent - 2.1.0 + 2.1.1-SNAPSHOT @@ -66,20 +66,6 @@ oofpcipoc-provider ${project.version} - - - org.opendaylight.controller - sal-binding-api - - - org.opendaylight.controller - sal-common-util - - - org.opendaylight.controller - sal-core-api - org.opendaylight.yangtools yang-data-impl diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocHandleNotif.java b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocHandleNotif.java index 98b16f549..dd1ca7086 100644 --- a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocHandleNotif.java +++ b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/OofpcipocHandleNotif.java @@ -25,8 +25,8 @@ import java.io.Writer; import java.io.StringWriter; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.io.IOException; -import java.util.Properties; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -41,32 +41,23 @@ import org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.handlenotif.pojos.Paylo import org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.handlenotif.pojos.RAN; import org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.handlenotif.pojos.RadioAccess; import org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.handlenotif.pojos.X0005b9Lte; -import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.rev190308.*; + +import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.OofpcipocListener; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.Payload; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.NbrlistChangeNotification; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.NetconfConfigChange; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.nbrlist.change.notification.*; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.features.sdnr.northbound.oofpcipoc.rev190308.nbrlist.change.notification.fap.service.*; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Preconditions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.json.JSONArray; import org.json.JSONObject; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.FutureCallback; -import com.google.common.util.concurrent.MoreExecutors; /** * Defines a base implementation for your listener. This class extends from a @@ -92,25 +83,28 @@ public class OofpcipocHandleNotif implements AutoCloseable, OofpcipocListener { protected DataBroker dataBroker; - private final OofpcipocClient OofpcipocClient; + private OofpcipocClient OofpcipocClient; - public OofpcipocHandleNotif(final DataBroker dataBroker, final OofpcipocClient OofpcipocClient) { + public OofpcipocHandleNotif() { this.LOG.info("Creating listener for {}", APPLICATION_NAME); executor = Executors.newFixedThreadPool(1); + this.dataBroker = null; + this.OofpcipocClient = null; + } + + public void setDataBroker(DataBroker dataBroker) { this.dataBroker = dataBroker; + } + + public void setClient(OofpcipocClient OofpcipocClient) { this.OofpcipocClient = OofpcipocClient; - initialize(); } - public void initialize() { + public void init() { LOG.info("Placeholder: Initializing listener for {}", APPLICATION_NAME); } - protected void initializeChild() { - // Override if you have custom initialization intelligence - } - @Override public void close() throws Exception { LOG.info("Closing listener for {}", APPLICATION_NAME); @@ -134,18 +128,20 @@ public class OofpcipocHandleNotif implements AutoCloseable, OofpcipocListener { List fAPServiceList = new ArrayList<>(); radioAccess.setFAPServiceNumberOfEntries(notification.getFapServiceNumberOfEntriesChanged().toString()); + Map fapSvcs = notification.getFapService(); - for (FapService fapSvc : notification.getFapService()) { + for (Map.Entry entry : fapSvcs.entrySet() ) { + FapService fapSvc = entry.getValue(); FAPServiceList fapServiceElement = new FAPServiceList(); fapServiceElement.setAlias(fapSvc.getAlias()); fapServiceElement.setX0005b9Lte(new X0005b9Lte(fapSvc.getPhyCellIdInUse().toString(), fapSvc.getPnfName())); List lTENeighborListInUseLTECell = new ArrayList<>(); - - for (LteRanNeighborListInUseLteCellChanged lteRanElement : fapSvc - .getLteRanNeighborListInUseLteCellChanged()) { + Map lteRanElements = fapSvc.getLteRanNeighborListInUseLteCellChanged(); + for (Map.Entry lteRanEntry : lteRanElements.entrySet()) { + LteRanNeighborListInUseLteCellChanged lteRanElement = lteRanEntry.getValue(); LTENeighborListInUseLTECell lTENeighborListInUseLTECellElement = new LTENeighborListInUseLTECell(); lTENeighborListInUseLTECellElement.setAlias(lteRanElement.getCid()); lTENeighborListInUseLTECellElement.setBlacklisted(lteRanElement.isBlacklisted().toString()); diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/CellConfig.java b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/CellConfig.java index def38a3db..36c0ce623 100644 --- a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/CellConfig.java +++ b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/CellConfig.java @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2020 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * 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.features.sdnr.northbound.oofpcipoc.handlenotif.pojos; diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/NeighborListInUse.java b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/NeighborListInUse.java index 39cc22208..634d9707b 100644 --- a/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/NeighborListInUse.java +++ b/sdnr/northbound/oofpcipoc/consumer/src/main/java/org/onap/ccsdk/features/sdnr/northbound/oofpcipoc/handlenotif/pojos/NeighborListInUse.java @@ -1,3 +1,23 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2020 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * 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.features.sdnr.northbound.oofpcipoc.handlenotif.pojos; diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml b/sdnr/northbound/oofpcipoc/consumer/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml deleted file mode 100644 index 90ae11a51..000000000 --- a/sdnr/northbound/oofpcipoc/consumer/src/main/resources/OSGI-INF/blueprint/impl-blueprint.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sdnr/northbound/oofpcipoc/consumer/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/northbound/oofpcipoc/consumer/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml index 90ae11a51..33d4142f6 100644 --- a/sdnr/northbound/oofpcipoc/consumer/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml +++ b/sdnr/northbound/oofpcipoc/consumer/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml @@ -30,7 +30,7 @@ - -- cgit 1.2.3-korg