diff options
author | Patrick Brady <pb071s@att.com> | 2018-09-07 11:38:32 -0700 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-09-10 15:18:59 +0000 |
commit | 58d1bddf8148b33e613931f4ec94dd5e591bc7cf (patch) | |
tree | f77c8fc69dbee7c63ec9ac9277e462e648d40ab7 /appc-provider/appc-provider-bundle/src/main | |
parent | 872f19c71c545950efb9fb65391f2ab7ee8af1a4 (diff) |
Fix for provider rpc error
Change over to using blueprint for rpc registration
Tests cases will need to be modified and uncommented
Change-Id: I6535c2d9d141406ac29dc8bb2b769fea3bdbf53f
Signed-off-by: Patrick Brady <pb071s@att.com>
Issue-ID: APPC-1185
Diffstat (limited to 'appc-provider/appc-provider-bundle/src/main')
14 files changed, 120 insertions, 615 deletions
diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProvider.java b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProvider.java index 62c8ef7cd..91d3a1953 100644 --- a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProvider.java +++ b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProvider.java @@ -27,27 +27,27 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.google.common.util.concurrent.Futures; 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.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.NotificationProviderService; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.AppcProviderService; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.EvacuateInput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.EvacuateOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.MigrateInput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.MigrateOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.ModifyConfigInput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.ModifyConfigOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RebuildInput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RebuildOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RestartInput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RestartOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.SnapshotInput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.SnapshotOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.VmstatuscheckInput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.VmstatuscheckOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.common.request.header.CommonRequestHeader; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.config.payload.ConfigPayload; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.vnf.resource.VnfResource; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.AppcProviderService; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.EvacuateInput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.EvacuateOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.MigrateInput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.MigrateOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.ModifyConfigInput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.ModifyConfigOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RebuildInput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RebuildOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RestartInput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RestartOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.SnapshotInput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.SnapshotOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.VmstatuscheckInput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.VmstatuscheckOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.common.request.header.CommonRequestHeader; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.config.payload.ConfigPayload; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.vnf.resource.VnfResource; import org.opendaylight.yangtools.yang.common.RpcResult; import org.onap.appc.Constants; import org.onap.appc.configuration.Configuration; @@ -106,7 +106,7 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { /** * ODL Notification Service that provides publish/subscribe capabilities for YANG modeled notifications. */ - protected NotificationProviderService notificationService; + protected NotificationPublishService notificationService; /** * Provides a registry for Remote Procedure Call (RPC) service implementations. The RPCs are defined in YANG models. @@ -122,6 +122,8 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { * The configuration */ private Configuration configuration = ConfigurationFactory.getConfiguration(); + + private AppcProviderClient appcProviderClient; /** * @param dataBroker2 @@ -131,8 +133,8 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { @SuppressWarnings({ "javadoc", "nls" }) - public AppcProvider(DataBroker dataBroker2, NotificationProviderService notificationProviderService, - RpcProviderRegistry rpcProviderRegistry) { + public AppcProvider(DataBroker dataBroker2, NotificationPublishService notificationProviderService, + RpcProviderRegistry rpcProviderRegistry, AppcProviderClient appcProviderClient) { String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME); logger.info(Msg.COMPONENT_INITIALIZING, appName, "provider"); @@ -141,10 +143,7 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { dataBroker = dataBroker2; notificationService = notificationProviderService; rpcRegistry = rpcProviderRegistry; - - if (rpcRegistry != null) { - rpcRegistration = rpcRegistry.addRpcImplementation(AppcProviderService.class, this); - } + this.appcProviderClient = appcProviderClient; logger.info(Msg.COMPONENT_INITIALIZED, appName, "provider"); } @@ -176,7 +175,7 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { /** * Rebuilds a specific VNF * - * @see org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.AppcProviderService#rebuild(org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RebuildInput) + * @see org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.AppcProviderService#rebuild(org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RebuildInput) */ @Override public Future<RpcResult<RebuildOutput>> rebuild(RebuildInput input) { @@ -191,7 +190,7 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { /** * Restarts a specific VNF * - * @see org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.AppcProviderService#restart(org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RestartInput) + * @see org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.AppcProviderService#restart(org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RestartInput) */ @Override public Future<RpcResult<RestartOutput>> restart(RestartInput input) { @@ -205,7 +204,7 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { /** * Migrates a specific VNF * - * @see org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.AppcProviderService#migrate(org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.MigrateInput) + * @see org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.AppcProviderService#migrate(org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.MigrateInput) */ @Override public Future<RpcResult<MigrateOutput>> migrate(MigrateInput input) { @@ -219,7 +218,7 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { /** * Evacuates a specific VNF * - * @see org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.AppcProviderService#evacuate(org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.EvacuateInput) + * @see org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.AppcProviderService#evacuate(org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.EvacuateInput) */ @Override public Future<RpcResult<EvacuateOutput>> evacuate(EvacuateInput input) { @@ -230,7 +229,7 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { /** * Evacuates a specific VNF * - * @see org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.AppcProviderService#evacuate(org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.EvacuateInput) + * @see org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.AppcProviderService#evacuate(org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.EvacuateInput) */ @Override public Future<RpcResult<SnapshotOutput>> snapshot(SnapshotInput input) { @@ -257,4 +256,8 @@ public class AppcProvider implements AutoCloseable, AppcProviderService { TopologyService getTopologyService() { return new TopologyService(this); } + + public AppcProviderClient getClient() { + return appcProviderClient; + } }
\ No newline at end of file diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderClient.java b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderClient.java index e7b3f1be3..ec8ce478b 100644 --- a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderClient.java +++ b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderClient.java @@ -48,24 +48,11 @@ public class AppcProviderClient { private final EELFLogger LOG = EELFManager.getInstance().getApplicationLogger(); private final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger(); - private SvcLogicService svcLogic = null; + private final SvcLogicService svcLogic; - public AppcProviderClient() { - BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext(); - // Handle BundleContext returning null - if (bctx == null){ - LOG.warn("Cannot find bundle context for " + SvcLogicService.NAME); - } else { - // 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 AppcProviderClient(final SvcLogicService svcLogicService) { + LOG.info("provider alert: appcprovider client init"); + this.svcLogic = svcLogicService; } public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException { diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderLcm.java b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderLcm.java index c3606df4f..410a9ea1c 100644 --- a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderLcm.java +++ b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/AppcProviderLcm.java @@ -48,8 +48,8 @@ import org.onap.appc.provider.lcm.util.ValidationService; import org.onap.appc.requesthandler.objects.RequestHandlerInput; import org.onap.appc.requesthandler.objects.RequestHandlerOutput; 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.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.NotificationProviderService; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.*; import org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.status.Status; @@ -76,7 +76,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, /** * ODL Notification Service that provides publish/subscribe capabilities for YANG modeled notifications. */ - protected NotificationProviderService notificationService; + protected NotificationPublishService notificationService; /** * Provides a registry for Remote Procedure Call (RPC) service implementations. The RPCs are defined in YANG models. @@ -95,7 +95,7 @@ public class AppcProviderLcm extends AbstractBaseUtils implements AutoCloseable, * @param rpcProviderRegistry */ @SuppressWarnings({"javadoc", "nls"}) - public AppcProviderLcm(DataBroker dataBroker, NotificationProviderService notificationProviderService, + public AppcProviderLcm(DataBroker dataBroker, NotificationPublishService notificationProviderService, RpcProviderRegistry rpcProviderRegistry) { String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME); diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/ResponseHeaderBuilder.java b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/ResponseHeaderBuilder.java index fa4097648..e579a2d62 100644 --- a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/ResponseHeaderBuilder.java +++ b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/ResponseHeaderBuilder.java @@ -23,9 +23,9 @@ package org.onap.appc.provider; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.TIMESTAMP; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.common.response.header.CommonResponseHeader; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.common.response.header.CommonResponseHeaderBuilder; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.TIMESTAMP; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.common.response.header.CommonResponseHeader; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.common.response.header.CommonResponseHeaderBuilder; import org.onap.appc.util.Time; import java.text.DateFormat; diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/topology/TopologyService.java b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/topology/TopologyService.java index a035900f2..74f3296d7 100644 --- a/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/topology/TopologyService.java +++ b/appc-provider/appc-provider-bundle/src/main/java/org/onap/appc/provider/topology/TopologyService.java @@ -52,22 +52,22 @@ import org.onap.appc.logging.LoggingUtils; import org.onap.appc.provider.AppcProvider; import org.onap.appc.provider.AppcProviderClient; import org.onap.appc.provider.ResponseHeaderBuilder; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.MigrateOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.MigrateOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.ModifyConfigOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.ModifyConfigOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RebuildOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RebuildOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RestartOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.RestartOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.SnapshotOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.SnapshotOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.UUID; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.VmstatuscheckOutput; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.VmstatuscheckOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.common.request.header.CommonRequestHeader; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.config.payload.ConfigPayload; -import org.opendaylight.yang.gen.v1.org.onap.appc.rev160104.vnf.resource.VnfResource; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.MigrateOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.MigrateOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.ModifyConfigOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.ModifyConfigOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RebuildOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RebuildOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RestartOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RestartOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.SnapshotOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.SnapshotOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.UUID; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.VmstatuscheckOutput; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.VmstatuscheckOutputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.common.request.header.CommonRequestHeader; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.config.payload.ConfigPayload; +import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.vnf.resource.VnfResource; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.MDC; @@ -625,7 +625,7 @@ public class TopologyService { boolean success; String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME); - AppcProviderClient svcLogicClient = new AppcProviderClient(); + AppcProviderClient svcLogicClient = provider.getClient(); try { if (svcLogicClient.hasGraph(module, method, version, mode)) { try { diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/impl/rev140523/AppcProviderModule.java b/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/impl/rev140523/AppcProviderModule.java deleted file mode 100644 index 0c5ef0113..000000000 --- a/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/impl/rev140523/AppcProviderModule.java +++ /dev/null @@ -1,87 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= - * 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.onap.appc.provider.impl.rev140523; - -import org.onap.appc.provider.AppcProvider; - -/** - * This was generated code. It was generated into the source tree because it has to be manually modified. - * - */ -public class AppcProviderModule extends - org.opendaylight.yang.gen.v1.org.onap.appc.provider.impl.rev140523.AbstractAppcProviderModule { - - /** - * @param identifier - * @param dependencyResolver - */ - @SuppressWarnings("javadoc") - public AppcProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, - org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - /** - * @param identifier - * @param dependencyResolver - * @param oldModule - * @param oldInstance - */ - @SuppressWarnings("javadoc") - public AppcProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, - org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, - org.opendaylight.yang.gen.v1.org.onap.appc.provider.impl.rev140523.AppcProviderModule oldModule, - java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - /** - * @see org.opendaylight.yang.gen.v1.org.onap.appc.provider.impl.rev140523.AbstractAppcProviderModule#customValidation() - */ - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - /** - * This method is manually updated to actually invoke the provider implementation - * - * @see org.opendaylight.yang.gen.v1.org.onap.appc.provider.impl.rev140523.AbstractAppcProviderModule#createInstance() - */ - @Override - public java.lang.AutoCloseable createInstance() { - - final AppcProvider provider = - new AppcProvider(getDataBrokerDependency(), getNotificationServiceDependency(), getRpcRegistryDependency()); - return new AutoCloseable() { - - @Override - public void close() throws Exception { - provider.close(); - } - }; - - } - -} diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/impl/rev140523/AppcProviderModuleFactory.java b/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/impl/rev140523/AppcProviderModuleFactory.java deleted file mode 100644 index 4a16e272b..000000000 --- a/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/impl/rev140523/AppcProviderModuleFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= - * 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: appc-provider-impl yang module local name: appc-provider-impl - * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator Generated at: Tue Sep 01 - * 13:56:34 CDT 2015 Do not modify this file unless it is present under src/main directory - */ -package org.opendaylight.yang.gen.v1.org.onap.appc.provider.impl.rev140523; - -/** - * Generated code - * - */ -public class AppcProviderModuleFactory extends - org.opendaylight.yang.gen.v1.org.onap.appc.provider.impl.rev140523.AbstractAppcProviderModuleFactory { - -} diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/lcm/impl/rev160108/AppcProviderLcmModule.java b/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/lcm/impl/rev160108/AppcProviderLcmModule.java deleted file mode 100644 index c733e493b..000000000 --- a/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/lcm/impl/rev160108/AppcProviderLcmModule.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= - * 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.onap.appc.provider.lcm.impl.rev160108; - -import org.onap.appc.provider.AppcProviderLcm; - -public class AppcProviderLcmModule extends org.opendaylight.yang.gen.v1.org.onap.appc.provider.lcm.impl.rev160108.AbstractAppcProviderLcmModule { - public AppcProviderLcmModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public AppcProviderLcmModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.org.onap.appc.provider.lcm.impl.rev160108.AppcProviderLcmModule 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 AppcProviderLcm provider = - new AppcProviderLcm(getDataBrokerDependency(), getNotificationServiceDependency(), getRpcRegistryDependency()); - return new AutoCloseable() { - - @Override - public void close() throws Exception { - provider.close(); - } - }; - } - -} diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/lcm/impl/rev160108/AppcProviderLcmModuleFactory.java b/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/lcm/impl/rev160108/AppcProviderLcmModuleFactory.java deleted file mode 100644 index 704336f57..000000000 --- a/appc-provider/appc-provider-bundle/src/main/java/org/opendaylight/yang/gen/v1/org/onap/appc/provider/lcm/impl/rev160108/AppcProviderLcmModuleFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= - * 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: appc-provider-lcm-impl yang module local name: appc-provider-lcm-impl -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Tue Aug 16 10:40:21 IDT 2016 -* -* Do not modify this file unless it is present under src/main directory -*/ -package org.opendaylight.yang.gen.v1.org.onap.appc.provider.lcm.impl.rev160108; -public class AppcProviderLcmModuleFactory extends org.opendaylight.yang.gen.v1.org.onap.appc.provider.lcm.impl.rev160108.AbstractAppcProviderLcmModuleFactory { - -} diff --git a/appc-provider/appc-provider-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/appc-provider/appc-provider-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml deleted file mode 100644 index c47bac7ae..000000000 --- a/appc-provider/appc-provider-bundle/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ============LICENSE_START======================================================= - ONAP : APPC - ================================================================================ - Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - ================================================================================ - Copyright (C) 2017 Amdocs - ============================================================================= - 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========================================================= - --> - -<!-- - Starter Blueprint Camel Definition appc-aai-adapter-blueprint ---> -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> -<!--<bean id="requestDispatcher" class="org.onap.appc.requesthandler.impl.RequestHandlerImpl" scope="singleton" > -</bean> - -<service id="requestDispatcherService" interface="org.onap.appc.requesthandler.RequestHandler" ref="requestDispatcher"/> - -<reference id="aaiAdapter" availability="mandatory" activation="eager" interface="org.onap.appc.adapter.aai.AAIAdapter"/>--> - -</blueprint> diff --git a/appc-provider/appc-provider-bundle/src/main/resources/initial/appc-provider.xml b/appc-provider/appc-provider-bundle/src/main/resources/initial/appc-provider.xml deleted file mode 100644 index b7de48c5a..000000000 --- a/appc-provider/appc-provider-bundle/src/main/resources/initial/appc-provider.xml +++ /dev/null @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ============LICENSE_START======================================================= - ONAP : APPC - ================================================================================ - Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - ================================================================================ - Copyright (C) 2017 Amdocs - ============================================================================= - 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========================================================= - --> - -<!-- vi: set et smarttab sw=4 tabstop=4: --> -<snapshot> - <configuration> - <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> - <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config"> - <module> - - <!-- This xmlns:prefix should match the namespace in the *-provider-impl.yang - file The prefix: inside type should match the prefix of the yang file. --> - <type xmlns:prefix="org:onap:appc:provider:impl"> - prefix:appc-provider-impl - </type> - <name>appc-provider-impl</name> - - <!-- The following sections contain bindings to services defined in - the *-provider-impl yang file. For example the rpc-registry is required because - we have a dependency (or augmentation) named "rpc-registry" and which binds - to the md-sa-binding-registry. If you remove those dependencies from the - yang file then you can remove them from here. --> - <rpc-registry> - <type - xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type> - <name>binding-rpc-broker</name> - </rpc-registry> - - <data-broker> - <type - xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type> - <name>binding-data-broker</name> - </data-broker> - - <notification-service> - <type - xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding"> - binding:binding-notification-service - </type> - <name>binding-notification-broker</name> - </notification-service> - </module> - - <module> - - <!-- This xmlns:prefix should match the namespace in the *-provider-impl.yang - file The prefix: inside type should match the prefix of the yang file. --> - <type xmlns:prefix="org:onap:appc:provider:lcm:impl"> - prefix:appc-provider-lcm-impl - </type> - <name>appc-provider-lcm-impl</name> - - <!-- The following sections contain bindings to services defined in - the *-provider-impl yang file. For example the rpc-registry is required because - we have a dependency (or augmentation) named "rpc-registry" and which binds - to the md-sa-binding-registry. If you remove those dependencies from the - yang file then you can remove them from here. --> - <rpc-registry> - <type - xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type> - <name>binding-rpc-broker</name> - </rpc-registry> - - <data-broker> - <type - xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type> - <name>binding-data-broker</name> - </data-broker> - - <notification-service> - <type - xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding"> - binding:binding-notification-service - </type> - <name>binding-notification-broker</name> - </notification-service> - </module> - - - </modules> - </data> - - </configuration> - - <!-- Required capabilities are basically a listing of all modules that need - to be imported before our service can be resolved. Capabilities for dependencies - defined above are implied which is why we do not have define a required capability - for the data broker, for example. --> - <!-- <required-capabilities> --> - <!-- <capability>appc:training:sample:provider:impl?module=sample-provider-impl&revision=2014-05-23</capability> --> - <!-- </required-capabilities> --> - <required-capabilities> - <capability>org:onap:appc:provider:impl?module=appc-provider-impl&revision=2014-05-23 - </capability> - <capability>org:onap:appc:provider:lcm:impl?module=appc-provider-lcm-impl&revision=2016-01-08 - </capability> - </required-capabilities> - -</snapshot> diff --git a/appc-provider/appc-provider-bundle/src/main/resources/org/opendaylight/blueprint/provider-blueprint.xml b/appc-provider/appc-provider-bundle/src/main/resources/org/opendaylight/blueprint/provider-blueprint.xml new file mode 100644 index 000000000..0c03369bd --- /dev/null +++ b/appc-provider/appc-provider-bundle/src/main/resources/org/opendaylight/blueprint/provider-blueprint.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ============LICENSE_START======================================================= + ONAP : APPC + ================================================================================ + Copyright (C) 2018 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========================================================= + --> +<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" + xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0" + odl:use-default-for-reference-types="true"> + + <reference id="svcLogicService" + interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService" /> + + <bean id="client" class="org.onap.appc.provider.AppcProviderClient"> + <argument ref="svcLogicService" /> + </bean> + + <reference id="dataBroker" + interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" + odl:type="default" /> + + <reference id="notificationService" + interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService" + odl:type="default" /> + + <reference id="rpcRegistry" + interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" + odl:type="default" /> + + <bean id="provider" class="org.onap.appc.provider.AppcProvider"> + <argument ref="dataBroker" /> + <argument ref="notificationService" /> + <argument ref="rpcRegistry" /> + <argument ref="client" /> + </bean> + <bean id="provider-lcm" class="org.onap.appc.provider.AppcProviderLcm"> + <argument ref="dataBroker" /> + <argument ref="notificationService" /> + <argument ref="rpcRegistry" /> + </bean> + + <odl:rpc-implementation ref="provider"/> + <odl:rpc-implementation ref="provider-lcm"/> + +</blueprint>
\ No newline at end of file diff --git a/appc-provider/appc-provider-bundle/src/main/yang/appc-provider-lcm.yang b/appc-provider/appc-provider-bundle/src/main/yang/appc-provider-lcm.yang deleted file mode 100644 index 56d2e70e0..000000000 --- a/appc-provider/appc-provider-bundle/src/main/yang/appc-provider-lcm.yang +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= - * 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. - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * ============LICENSE_END========================================================= - */ - -module appc-provider-lcm-impl { - - yang-version 1; - namespace "org:onap:appc:provider:lcm:impl"; - prefix "appc-provider-lcm-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 - appc-provider-lcm implementation."; - - revision "2016-01-08" { - description - "Initial revision."; - } - - // This is the definition of the service implementation as a module identity. - identity appc-provider-lcm-impl { - base config:module-type; - - // Specifies the prefix for generated java classes. - config:java-name-prefix AppcProviderLcm; - } - - // 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 appc-provider-lcm-impl { - when "/config:modules/config:module/config:type = 'appc-provider-lcm-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; - } - } - } - } - } -} diff --git a/appc-provider/appc-provider-bundle/src/main/yang/appc-provider.yang b/appc-provider/appc-provider-bundle/src/main/yang/appc-provider.yang deleted file mode 100644 index 83f6bfffa..000000000 --- a/appc-provider/appc-provider-bundle/src/main/yang/appc-provider.yang +++ /dev/null @@ -1,85 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP : APPC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= - * 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. - * - * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * ============LICENSE_END========================================================= - */ - -module appc-provider-impl { - - yang-version 1; - namespace "org:onap:appc:provider:impl"; - prefix "appc-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 - appc-provider implementation."; - - revision "2014-05-23" { - description - "Initial revision."; - } - - // This is the definition of the service implementation as a module identity. - identity appc-provider-impl { - base config:module-type; - - // Specifies the prefix for generated java classes. - config:java-name-prefix AppcProvider; - } - - // 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 appc-provider-impl { - when "/config:modules/config:module/config:type = 'appc-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; - } - } - } - } - } -} |