diff options
Diffstat (limited to 'generic-resource-api/provider/src')
2 files changed, 22 insertions, 42 deletions
diff --git a/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java b/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java index a747df6f..1e45ee79 100644 --- a/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java +++ b/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiProvider.java @@ -1615,7 +1615,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC } String siid = input.getServiceInformation().getServiceInstanceId(); - +/* // Get the service-instance service data from MD-SAL ServiceDataBuilder serviceDataBuilder = new ServiceDataBuilder(); getServiceData(siid, serviceDataBuilder); @@ -1634,7 +1634,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC RpcResult<TunnelxconnTopologyOperationOutput> rpcResult = RpcResultBuilder .<TunnelxconnTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build(); return Futures.immediateFuture(rpcResult); - } + }*/ log.info("Adding INPUT data for {} [{}] input: {}", SVC_OPERATION, siid, input); TunnelxconnTopologyOperationInputBuilder inputBuilder = new TunnelxconnTopologyOperationInputBuilder(input); @@ -1656,7 +1656,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC if (svcLogicClient.hasGraph(appName, SVC_OPERATION, null, "sync")) { try { - respProps = svcLogicClient.execute(appName, SVC_OPERATION, null, "sync", serviceDataBuilder, parms); + respProps = svcLogicClient.execute(appName, SVC_OPERATION, null, "sync", parms); } catch (Exception e) { log.error("Caught exception executing service logic for {}", SVC_OPERATION, e); errorMessage = e.getMessage(); @@ -1696,24 +1696,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC // Got success from SLI try { - serviceData = serviceDataBuilder.build(); - log.info("Updating MD-SAL for {} [{}] ServiceData: {}", SVC_OPERATION, siid, serviceData); - // service object - ServiceBuilder serviceBuilder = new ServiceBuilder(); - serviceBuilder.setServiceData(serviceData); - serviceBuilder.setServiceInstanceId(siid); - serviceBuilder.setServiceStatus(serviceStatusBuilder.build()); - saveService(serviceBuilder.build(), false, LogicalDatastoreType.CONFIGURATION); - - if (input.getSdncRequestHeader() != null && input.getSdncRequestHeader().getSvcAction() != null) { - // Only update operational tree on activate or delete - if (input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Unassign) - || input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Activate)) { - log.info("Updating OPERATIONAL tree."); - saveService(serviceBuilder.build(), false, LogicalDatastoreType.OPERATIONAL); - } - } TunnelxconnResponseInformationBuilder tunnelxconnResponseInformationBuilder = new TunnelxconnResponseInformationBuilder(); tunnelxconnResponseInformationBuilder.setInstanceId(allottedResourceId); @@ -1775,7 +1758,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC String siid = input.getServiceInformation().getServiceInstanceId(); - // Get the service-instance service data from MD-SAL +/* // Get the service-instance service data from MD-SAL ServiceDataBuilder serviceDataBuilder = new ServiceDataBuilder(); getServiceData(siid, serviceDataBuilder); @@ -1793,7 +1776,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC RpcResult<BrgTopologyOperationOutput> rpcResult = RpcResultBuilder.<BrgTopologyOperationOutput>status(true) .withResult(responseBuilder.build()).build(); return Futures.immediateFuture(rpcResult); - } + }*/ log.info("Adding INPUT data for {} [{}] input: {}", SVC_OPERATION, siid, input); BrgTopologyOperationInputBuilder inputBuilder = new BrgTopologyOperationInputBuilder(input); @@ -1815,7 +1798,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC if (svcLogicClient.hasGraph(appName, SVC_OPERATION, null, "sync")) { try { - respProps = svcLogicClient.execute(appName, SVC_OPERATION, null, "sync", serviceDataBuilder, parms); + respProps = svcLogicClient.execute(appName, SVC_OPERATION, null, "sync", parms); } catch (Exception e) { log.error("Caught exception executing service logic for {}", SVC_OPERATION, e); errorMessage = e.getMessage(); @@ -1855,24 +1838,6 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC // Got success from SLI try { - serviceData = serviceDataBuilder.build(); - log.info("Updating MD-SAL for {} [{}] ServiceData: {}", SVC_OPERATION, siid, serviceData); - - // service object - ServiceBuilder serviceBuilder = new ServiceBuilder(); - serviceBuilder.setServiceData(serviceData); - serviceBuilder.setServiceInstanceId(siid); - serviceBuilder.setServiceStatus(serviceStatusBuilder.build()); - saveService(serviceBuilder.build(), false, LogicalDatastoreType.CONFIGURATION); - - if (input.getSdncRequestHeader() != null && input.getSdncRequestHeader().getSvcAction() != null) { - // Only update operational tree on activate or delete - if (input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Unassign) - || input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Activate)) { - log.info("Updating OPERATIONAL tree."); - saveService(serviceBuilder.build(), false, LogicalDatastoreType.OPERATIONAL); - } - } BrgResponseInformationBuilder brgResponseInformationBuilder = new BrgResponseInformationBuilder(); brgResponseInformationBuilder.setInstanceId(allottedResourceId); diff --git a/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiSvcLogicServiceClient.java b/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiSvcLogicServiceClient.java index 8ba70dee..b000ed47 100644 --- a/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiSvcLogicServiceClient.java +++ b/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiSvcLogicServiceClient.java @@ -1,5 +1,5 @@ /*- - * ============LICENSE_START======================================================= +z * ============LICENSE_START======================================================= * openECOMP : SDN-C * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights @@ -106,6 +106,21 @@ public class GenericResourceApiSvcLogicServiceClient { return respProps; } + public Properties execute(String module, String rpc, String version, String mode, Properties properties) + throws SvcLogicException { + + printPropsDebugLogs(properties, "Parameters passed to SLI"); + + Properties respProps = svcLogic.execute(module, rpc, version, mode, properties); + printPropsDebugLogs(respProps, "Parameters returned by SLI"); + if (respProps == null || FAILURE_RESULT.equalsIgnoreCase(respProps.getProperty(SVC_LOGIC_STATUS_KEY))) { + return (respProps); + } + + return respProps; + } + + private void printPropsDebugLogs(Properties properties, String msg) { if (!LOG.isDebugEnabled()) { return; |