From 0bce413218560b0f5df834581f22841eb0bc7074 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 30 Aug 2017 10:28:08 -0400 Subject: Prune migrated components from sdnc/northbound Prune components that were migrated from sdnc/northbound to ccsdk by removing code and replacing with a README.md that redirects the reader to the appropriate CCSDK repo Change-Id: I317b1d0093a1dd4647feaf6b852826a2230f4879 Issue-ID: SDNC-59 Signed-off-by: Dan Timoney --- dataChange/provider/pom.xml | 137 ---------------- .../impl/rev140523/DataChangeProviderModule.java | 55 ------- .../rev140523/DataChangeProviderModuleFactory.java | 34 ---- .../sdnc/datachange/DataChangeClient.java | 115 ------------- .../sdnc/datachange/DataChangeProvider.java | 181 --------------------- .../main/resources/initial/dataChange-provider.xml | 72 -------- .../src/main/yang/DataChange-provider-impl.yang | 61 ------- 7 files changed, 655 deletions(-) delete mode 100755 dataChange/provider/pom.xml delete mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java delete mode 100644 dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java delete mode 100644 dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java delete mode 100644 dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java delete mode 100644 dataChange/provider/src/main/resources/initial/dataChange-provider.xml delete mode 100755 dataChange/provider/src/main/yang/DataChange-provider-impl.yang (limited to 'dataChange/provider') diff --git a/dataChange/provider/pom.xml b/dataChange/provider/pom.xml deleted file mode 100755 index fe46b7d0..00000000 --- a/dataChange/provider/pom.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - 4.0.0 - - dataChange - org.openecomp.sdnc.northbound - 1.1.2-SNAPSHOT - - dataChange-provider - bundle - - - - - org.apache.felix - maven-bundle-plugin - true - - - org.opendaylight.controller.config.yang.config.DataChange_provider.impl - * - - - - - org.opendaylight.yangtools - yang-maven-plugin - ${odl.yangtools.yang.maven.plugin.version} - - - - config - - generate-sources - - - - - org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - ${jmxGeneratorPath} - - urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang - - - - org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl - ${salGeneratorPath} - - - true - - - - - - org.opendaylight.mdsal - maven-sal-api-gen-plugin - ${odl.sal.api.gen.plugin.version} - jar - - - org.opendaylight.controller - yang-jmx-generator-plugin - ${odl.yang.jmx.generator.version} - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/initial/${feature-name}-provider.xml - xml - config - - - - - - - - - - - - org.openecomp.sdnc.northbound - dataChange-model - - - org.opendaylight.controller - config-api - - ${odl.controller.config.api.version} - - - org.opendaylight.controller - sal-binding-config - ${odl.mdsal.version} - - - org.opendaylight.controller - sal-binding-api - ${odl.mdsal.version} - - - org.opendaylight.controller - sal-common-util - ${odl.mdsal.version} - - - org.openecomp.sdnc.core - sli-common - ${sdnctl.sli.version} - - - org.openecomp.sdnc.core - sli-provider - ${sdnctl.sli.version} - - - junit - junit - ${junit.version} - test - - - diff --git a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java deleted file mode 100644 index 9f488436..00000000 --- a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModule.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 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.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523; - -import org.openecomp.sdnc.datachange.DataChangeProvider; - -public class DataChangeProviderModule extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523.AbstractDataChangeProviderModule { - public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public DataChangeProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523.DataChangeProviderModule oldModule, java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @Override - public java.lang.AutoCloseable createInstance() { - final DataChangeProvider provider = new DataChangeProvider(getDataBrokerDependency() - , getNotificationServiceDependency() - , getRpcRegistryDependency()); - - return new AutoCloseable() { - - @Override - public void close() throws Exception { - provider.close(); - } - }; - } - -} diff --git a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java b/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java deleted file mode 100644 index 18006903..00000000 --- a/dataChange/provider/src/main/java/org/opendaylight/yang/gen/v1/org/openecomp/sdnc/datachange/provider/impl/rev140523/DataChangeProviderModuleFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 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========================================================= - */ - -/* -* Generated file -* -* Generated from: yang module name: DataChange-provider-impl yang module local name: DataChange-provider-impl -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Wed Nov 02 06:00:03 EDT 2016 -* -* Do not modify this file unless it is present under src/main directory -*/ -package org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523; -public class DataChangeProviderModuleFactory extends org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.provider.impl.rev140523.AbstractDataChangeProviderModuleFactory { - -} diff --git a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java b/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java deleted file mode 100644 index 6ca7618d..00000000 --- a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeClient.java +++ /dev/null @@ -1,115 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 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.openecomp.sdnc.datachange; - -import java.util.Properties; - -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationOutputBuilder; -import org.openecomp.sdnc.sli.SvcLogicException; -import org.openecomp.sdnc.sli.provider.MdsalHelper; -import org.openecomp.sdnc.sli.provider.SvcLogicService; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DataChangeClient { - - private static final Logger LOG = LoggerFactory - .getLogger(DataChangeClient.class); - - private SvcLogicService svcLogic = null; - - public DataChangeClient() - { - BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); - - // Get SvcLogicService reference - ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME); - if (sref != null) - { - svcLogic = (SvcLogicService) bctx.getService(sref); - - } - else - { - LOG.warn("Cannot find service reference for "+SvcLogicService.NAME); - - } - } - - public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException - { - return(svcLogic.hasGraph(module, rpc, version, mode)); - } - - public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData) - throws SvcLogicException { - - Properties parms = new Properties(); - - return execute(module,rpc,version, mode,serviceData,parms); - } - - public Properties execute(String module, String rpc, String version, String mode, DataChangeNotificationOutputBuilder serviceData, Properties parms) - throws SvcLogicException { - - parms = MdsalHelper.toProperties(parms, serviceData); - - if (LOG.isDebugEnabled()) - { - LOG.debug("Parameters passed to SLI"); - - for (Object key : parms.keySet()) { - String parmName = (String) key; - String parmValue = parms.getProperty(parmName); - - LOG.debug(parmName+" = "+parmValue); - - } - } - - Properties respProps = svcLogic.execute(module, rpc, version, mode, parms); - - if (LOG.isDebugEnabled()) - { - LOG.debug("Parameters returned by SLI"); - - for (Object key : respProps.keySet()) { - String parmName = (String) key; - String parmValue = respProps.getProperty(parmName); - - LOG.debug(parmName+" = "+parmValue); - - } - } - if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { - return (respProps); - } - - MdsalHelper.toBuilder(respProps, serviceData); - - return (respProps); - } - -} diff --git a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java b/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java deleted file mode 100644 index ee2fe4d4..00000000 --- a/dataChange/provider/src/main/java/org/openecomp/sdnc/datachange/DataChangeProvider.java +++ /dev/null @@ -1,181 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * openECOMP : SDN-C - * ================================================================================ - * Copyright (C) 2017 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.openecomp.sdnc.datachange; - -import java.util.Properties; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; - -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.NotificationProviderService; -import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationInput; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationInputBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationOutput; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeNotificationOutputBuilder; -import org.opendaylight.yang.gen.v1.org.openecomp.sdnc.datachange.rev150519.DataChangeService; -import org.opendaylight.yangtools.yang.common.RpcResult; -import org.opendaylight.yangtools.yang.common.RpcResultBuilder; -import org.openecomp.sdnc.sli.provider.MdsalHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.util.concurrent.Futures; - -/** - * Defines a base implementation for your provider. This class extends from a helper class - * which provides storage for the most commonly used components of the MD-SAL. Additionally the - * base class provides some basic logging and initialization / clean up methods. - * - */ -public class DataChangeProvider implements AutoCloseable, DataChangeService{ - - private final Logger log = LoggerFactory.getLogger( DataChangeProvider.class ); - private final String appName = "DataChange"; - private final ExecutorService executor; - - protected DataBroker dataBroker; - protected NotificationProviderService notificationService; - protected RpcProviderRegistry rpcRegistry; - protected BindingAwareBroker.RpcRegistration rpcRegistration; - - - public DataChangeProvider(DataBroker dataBroker2, - NotificationProviderService notificationProviderService, - RpcProviderRegistry rpcProviderRegistry) { - this.log.info( "Creating provider for " + appName ); - executor = Executors.newFixedThreadPool(1); - dataBroker = dataBroker2; - notificationService = notificationProviderService; - rpcRegistry = rpcProviderRegistry; - initialize(); - } - - public void initialize(){ - log.info( "Initializing provider for " + appName ); - rpcRegistration = rpcRegistry.addRpcImplementation(DataChangeService.class, this); - log.info( "Initialization complete for " + appName ); - } - - protected void initializeChild() { - //Override if you have custom initialization intelligence - } - - @Override - public void close() throws Exception { - log.info( "Closing provider for " + appName ); - executor.shutdown(); - rpcRegistration.close(); - log.info( "Successfully closed provider for " + appName ); - } - - public void setDataBroker(DataBroker dataBroker) { - this.dataBroker = dataBroker; - if( log.isDebugEnabled() ){ - log.debug( "DataBroker set to " + (dataBroker==null?"null":"non-null") + "." ); - } - } - - public void setNotificationService( - NotificationProviderService notificationService) { - this.notificationService = notificationService; - if( log.isDebugEnabled() ){ - log.debug( "Notification Service set to " + (notificationService==null?"null":"non-null") + "." ); - } - } - - public void setRpcRegistry(RpcProviderRegistry rpcRegistry) { - this.rpcRegistry = rpcRegistry; - if( log.isDebugEnabled() ){ - log.debug( "RpcRegistry set to " + (rpcRegistry==null?"null":"non-null") + "." ); - } - } - - @Override - public Future> dataChangeNotification( - DataChangeNotificationInput input) { - final String SVC_OPERATION = "data-change-notification"; - - Properties parms = new Properties(); - DataChangeNotificationOutputBuilder serviceDataBuilder = new DataChangeNotificationOutputBuilder(); - - log.info( SVC_OPERATION +" called." ); - - if(input == null || input.getAaiEventId() == null) { - log.debug("exiting " +SVC_OPERATION+ " because of invalid input"); - serviceDataBuilder.setDataChangeResponseCode("403"); - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); - return Futures.immediateFuture(rpcResult); - } - - // add input to parms - log.info("Adding INPUT data for "+SVC_OPERATION+" input: " + input); - DataChangeNotificationInputBuilder inputBuilder = new DataChangeNotificationInputBuilder(input); - MdsalHelper.toProperties(parms, inputBuilder.build()); - - // Call SLI sync method - // Get SvcLogicService reference - - DataChangeClient svcLogicClient = new DataChangeClient(); - Properties respProps = null; - - try - { - if (svcLogicClient.hasGraph("DataChange", SVC_OPERATION , null, "sync")) - { - try - { - respProps = svcLogicClient.execute("DataChange", SVC_OPERATION, null, "sync", serviceDataBuilder, parms); - } - catch (Exception e) - { - log.error("Caught exception executing service logic for "+ SVC_OPERATION, e); - serviceDataBuilder.setDataChangeResponseCode("500"); - } - } else { - log.error("No service logic active for DataChange: '" + SVC_OPERATION + "'"); - serviceDataBuilder.setDataChangeResponseCode("503"); - } - } - catch (Exception e) - { - log.error("Caught exception looking for service logic", e); - serviceDataBuilder.setDataChangeResponseCode("500"); - } - - String errorCode = serviceDataBuilder.getDataChangeResponseCode(); - - if ( errorCode != null && errorCode.length() != 0 && !( errorCode.equals("0")|| errorCode.equals("200"))) { - log.error("Returned FAILED for "+SVC_OPERATION+" error code: '" + errorCode + "'"); - } else { - log.info("Returned SUCCESS for "+SVC_OPERATION+" "); - } - - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(serviceDataBuilder.build()).build(); - // return error - return Futures.immediateFuture(rpcResult); - } -} diff --git a/dataChange/provider/src/main/resources/initial/dataChange-provider.xml b/dataChange/provider/src/main/resources/initial/dataChange-provider.xml deleted file mode 100644 index 1024f704..00000000 --- a/dataChange/provider/src/main/resources/initial/dataChange-provider.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - prefix:DataChange-provider-impl - - DataChange-provider-impl - - - - binding:binding-rpc-registry - binding-rpc-broker - - - - binding:binding-async-data-broker - binding-data-broker - - - - - binding:binding-notification-service - - binding-notification-broker - - - - - - - - - - - org:openecomp:sdnc:datachange:provider:impl?module=DataChange-provider-impl&revision=2014-05-23 - - - diff --git a/dataChange/provider/src/main/yang/DataChange-provider-impl.yang b/dataChange/provider/src/main/yang/DataChange-provider-impl.yang deleted file mode 100755 index fe1dab23..00000000 --- a/dataChange/provider/src/main/yang/DataChange-provider-impl.yang +++ /dev/null @@ -1,61 +0,0 @@ -module DataChange-provider-impl { - - yang-version 1; - namespace "org:openecomp:sdnc:datachange:provider:impl"; - prefix "DataChange-provider-impl"; - - import config { prefix config; revision-date 2013-04-05; } - import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; } - - description - "This module contains the base YANG definitions for - DataChange-provider impl implementation."; - - revision "2014-05-23" { - description - "Initial revision."; - } - - // This is the definition of the service implementation as a module identity. - identity DataChange-provider-impl { - base config:module-type; - - // Specifies the prefix for generated java classes. - config:java-name-prefix DataChangeProvider; - } - - // Augments the 'configuration' choice node under modules/module. - // We consume the three main services, RPCs, DataStore, and Notifications - augment "/config:modules/config:module/config:configuration" { - case DataChange-provider-impl { - when "/config:modules/config:module/config:type = 'DataChange-provider-impl'"; - - container rpc-registry { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-rpc-registry; - } - } - } - - container notification-service { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-notification-service; - } - } - } - - container data-broker { - uses config:service-ref { - refine type { - mandatory false; - config:required-identity mdsal:binding-async-data-broker; - } - } - } - } - } -} -- cgit 1.2.3-korg