Dublin yang model update
[sdnc/northbound.git] / generic-resource-api / provider / src / main / java / org / onap / sdnc / northbound / GenericResourceApiProvider.java
index 8609b60..2a71e6d 100644 (file)
@@ -3,6 +3,8 @@ package org.onap.sdnc.northbound;
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -37,6 +39,7 @@ import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.re
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GENERICRESOURCEAPIService;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationNotificationInput;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationNotificationInputBuilder;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationNotificationOutput;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationTopologyOperationInput;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationTopologyOperationInputBuilder;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationTopologyOperationOutput;
@@ -93,6 +96,10 @@ import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.re
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.VnfTopologyOperationInputBuilder;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.VnfTopologyOperationOutput;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.VnfTopologyOperationOutputBuilder;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PnfTopologyOperationInput;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PnfTopologyOperationInputBuilder;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PnfTopologyOperationOutput;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PnfTopologyOperationOutputBuilder;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.brg.response.information.BrgResponseInformationBuilder;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.connection.attachment.response.information.ConnectionAttachmentResponseInformationBuilder;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.contrail.route.response.information.ContrailRouteResponseInformationBuilder;
@@ -120,6 +127,7 @@ import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.re
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.tunnelxconn.response.information.TunnelxconnResponseInformationBuilder;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.vf.module.response.information.VfModuleResponseInformationBuilder;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.vnf.response.information.VnfResponseInformationBuilder;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.pnf.response.information.PnfResponseInformationBuilder;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -181,6 +189,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     private static final String SERVICE_OBJECT_PATH_PARAM = "service-object-path";
     private static final String NETWORK_OBJECT_PATH_PARAM = "network-object-path";
     private static final String VNF_OBJECT_PATH_PARAM = "vnf-object-path";
+    private static final String PNF_OBJECT_PATH_PARAM = "pnf-object-path";
     private static final String VF_MODULE_OBJECT_PATH_PARAM = "vf-module-object-path";
     private static final String UPDATING_MDSAL_ERROR_MESSAGE = "Caught Exception updating MD-SAL for {} [{}] \n";
     private static final String UPDATING_MDSAL_ERROR_MESSAGE_2 = "Caught Exception updating MD-SAL for {} [{},{}] \n";
@@ -400,7 +409,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
         // Each entry will be identifiable by a unique key, we have to create that
         // identifier
         InstanceIdentifier<Service> path = InstanceIdentifier.builder(Services.class)
-                .child(Service.class, entry.getKey()).build();
+                .child(Service.class, entry.key()).build();
 
         trySaveEntry(entry, merge, storeType, path);
     }
@@ -441,7 +450,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
         // Each entry will be identifiable by a unique key, we have to create
         // that identifier
         InstanceIdentifier<Service> path = InstanceIdentifier.builder(Services.class)
-                .child(Service.class, entry.getKey()).build();
+                .child(Service.class, entry.key()).build();
 
         tryDeleteEntry(storeType, path);
     }
@@ -516,7 +525,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
         // Each entry will be identifiable by a unique key, we have to create that
         // identifier
         InstanceIdentifier.InstanceIdentifierBuilder<PreloadList> preloadListBuilder = InstanceIdentifier
-                .<PreloadInformation>builder(PreloadInformation.class).child(PreloadList.class, entry.getKey());
+                .<PreloadInformation>builder(PreloadInformation.class).child(PreloadList.class, entry.key());
         InstanceIdentifier<PreloadList> path = preloadListBuilder.build();
         int tries = 2;
         while (true) {
@@ -549,7 +558,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
         // Each entry will be identifiable by a unique key, we have to create
         // that identifier
         InstanceIdentifier<PreloadList> path = InstanceIdentifier.builder(PreloadInformation.class)
-                .child(PreloadList.class, entry.getKey()).build();
+                .child(PreloadList.class, entry.key()).build();
 
         tryDeletePreloadListEntry(storeType, path);
     }
@@ -582,7 +591,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<ServiceTopologyOperationOutput>> serviceTopologyOperation(
+    public ListenableFuture<RpcResult<ServiceTopologyOperationOutput>> serviceTopologyOperation(
             ServiceTopologyOperationInput input) {
 
         final String svcOperation = "service-topology-operation";
@@ -779,8 +788,226 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
         return input.getSdncRequestHeader() != null && input.getSdncRequestHeader().getSvcAction() != null;
     }
 
+
     @Override
-    public Future<RpcResult<VnfTopologyOperationOutput>> vnfTopologyOperation(VnfTopologyOperationInput input) {
+    public ListenableFuture<RpcResult<PnfTopologyOperationOutput>> pnfTopologyOperation(PnfTopologyOperationInput input) {
+
+        final String svcOperation = "pnf-topology-operation";
+        ServiceData serviceData;
+        ServiceStatusBuilder serviceStatusBuilder = new ServiceStatusBuilder();
+        Properties properties = new Properties();
+
+        log.info(CALLED_STR, svcOperation);
+        // create a new response object
+        PnfTopologyOperationOutputBuilder responseBuilder = new PnfTopologyOperationOutputBuilder();
+
+        if (hasInvalidServiceId(input)) {
+            log.debug(NULL_OR_EMPTY_ERROR_MESSAGE, svcOperation);
+            responseBuilder.setResponseCode("404");
+            responseBuilder.setResponseMessage(NULL_OR_EMPTY_ERROR_PARAM);
+            responseBuilder.setAckFinalIndicator("Y");
+            RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+                    .withResult(responseBuilder.build()).build();
+            // return error
+            return Futures.immediateFuture(rpcResult);
+        }
+
+        // Grab the service instance ID from the input buffer
+        String siid = input.getServiceInformation().getServiceInstanceId();
+
+        trySetSvcRequestId(input, responseBuilder);
+
+        /* Comment out mandatory check for pnf id for scenario wherein for assign/create request pnf-id is generated by
+        SDNC itself.
+        if (hasInvalidPnfId(input)) {
+            log.debug("exiting {} because of null or empty pnf-id", svcOperation);
+            responseBuilder.setResponseCode("404");
+            responseBuilder.setResponseMessage("invalid input, null or empty pnf-id");
+            responseBuilder.setAckFinalIndicator("Y");
+
+            RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+                    .withResult(responseBuilder.build()).build();
+
+            return Futures.immediateFuture(rpcResult);
+        }
+        */
+
+        String pnfId = input.getPnfDetails().getPnfId();
+        ServiceDataBuilder serviceDataBuilder = new ServiceDataBuilder();
+        getServiceData(siid, serviceDataBuilder);
+
+        ServiceDataBuilder operDataBuilder = new ServiceDataBuilder();
+        getServiceData(siid, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
+
+        // Set the serviceStatus based on input
+        setServiceStatus(serviceStatusBuilder, input.getSdncRequestHeader());
+        setServiceStatus(serviceStatusBuilder, input.getRequestInformation());
+
+        //
+        // setup a service-data object builder
+        // ACTION pnf-topology-operation
+        // INPUT:
+        // USES sdnc-request-header;
+        // USES request-information;
+        // USES service-information;
+        // USES pnf-details
+        // OUTPUT:
+        // USES pnf-topology-response-body;
+        // USES pnf-details
+        // USES service-information
+        //
+        // uses oper-status;
+
+        log.info(ADDING_INPUT_DATA_LOG, svcOperation, siid, input);
+        PnfTopologyOperationInputBuilder inputBuilder = new PnfTopologyOperationInputBuilder(input);
+        GenericResourceApiUtil.toProperties(properties, inputBuilder.build());
+
+        log.info(ADDING_OPERATIONAL_DATA_LOG, svcOperation, siid, operDataBuilder.build());
+        GenericResourceApiUtil.toProperties(properties, OPERATIONAL_DATA_PARAM, operDataBuilder);
+
+        // Call SLI sync method
+
+        ResponseObject responseObject = new ResponseObject("200", "");
+        String ackFinal = "Y";
+        String serviceObjectPath = null;
+        String pnfObjectPath = null;
+        Properties respProps = tryGetProperties(svcOperation, properties, serviceDataBuilder, responseObject);
+
+        if (respProps != null) {
+            responseObject.setMessage(respProps.getProperty(ERROR_MESSAGE_PARAM));
+            responseObject.setStatusCode(respProps.getProperty(ERROR_CODE_PARAM));
+            ackFinal = respProps.getProperty(ACK_FINAL_PARAM, "Y");
+            if (pnfId == null) {
+                pnfId = respProps.getProperty("pnfId");
+            }
+            serviceObjectPath = respProps.getProperty(SERVICE_OBJECT_PATH_PARAM);
+            pnfObjectPath = respProps.getProperty(PNF_OBJECT_PATH_PARAM);
+        }
+
+        setServiceStatus(serviceStatusBuilder, responseObject.getStatusCode(), responseObject.getMessage(), ackFinal);
+        serviceStatusBuilder.setRequestStatus(RequestStatus.Synccomplete);
+        serviceStatusBuilder.setRpcName(svcOperation);
+
+        if (failed(responseObject)) {
+            responseBuilder.setResponseCode(responseObject.getStatusCode());
+            responseBuilder.setResponseMessage(responseObject.getMessage());
+            responseBuilder.setAckFinalIndicator(ackFinal);
+
+            ServiceBuilder serviceBuilder = new ServiceBuilder();
+            serviceBuilder.setServiceInstanceId(siid);
+            serviceBuilder.setServiceStatus(serviceStatusBuilder.build());
+            try {
+                saveService(serviceBuilder.build(), true, LogicalDatastoreType.CONFIGURATION);
+                trySaveService(input, serviceBuilder);
+            } catch (Exception e) {
+                log.error(UPDATING_MDSAL_ERROR_MESSAGE, svcOperation, siid, e);
+            }
+            log.error(RETURNED_FAILED_MESSAGE, svcOperation, siid, responseBuilder.build());
+
+            RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+                    .withResult(responseBuilder.build()).build();
+
+            // return error
+            return Futures.immediateFuture(rpcResult);
+        }
+
+        // Got success from SLI
+        try {
+            serviceData = serviceDataBuilder.build();
+            log.info(UPDATING_MDSAL_INFO_MESSAGE, svcOperation, 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 (isValidRequest(input) && input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Activate)) {
+                // Only update operational tree on Assign
+                log.info(UPDATING_TREE_INFO_MESSAGE);
+                saveService(serviceBuilder.build(), false, LogicalDatastoreType.OPERATIONAL);
+            }
+
+            ServiceResponseInformationBuilder serviceResponseInformationBuilder = new ServiceResponseInformationBuilder();
+            serviceResponseInformationBuilder.setInstanceId(siid);
+            serviceResponseInformationBuilder.setObjectPath(serviceObjectPath);
+            responseBuilder.setServiceResponseInformation(serviceResponseInformationBuilder.build());
+
+            PnfResponseInformationBuilder pnfResponseInformationBuilder = new PnfResponseInformationBuilder();
+            pnfResponseInformationBuilder.setInstanceId(pnfId);
+            pnfResponseInformationBuilder.setObjectPath(pnfObjectPath);
+            responseBuilder.setPnfResponseInformation(pnfResponseInformationBuilder.build());
+
+        } catch (Exception e) {
+            log.error(UPDATING_MDSAL_ERROR_MESSAGE, svcOperation, siid, e);
+            responseBuilder.setResponseCode("500");
+            responseBuilder.setResponseMessage(e.getMessage());
+            responseBuilder.setAckFinalIndicator("Y");
+            log.error(RETURNED_FAILED_MESSAGE, svcOperation, siid, responseBuilder.build());
+
+            RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+                    .withResult(responseBuilder.build()).build();
+
+            return Futures.immediateFuture(rpcResult);
+        }
+
+        // Update succeeded
+        responseBuilder.setResponseCode(responseObject.getStatusCode());
+        responseBuilder.setAckFinalIndicator(ackFinal);
+        trySetResponseMessage(responseBuilder, responseObject);
+        log.info(UPDATED_MDSAL_INFO_MESSAGE, svcOperation, siid);
+        log.info(RETURNED_SUCCESS_MESSAGE, svcOperation, siid, responseBuilder.build());
+
+        RpcResult<PnfTopologyOperationOutput> rpcResult = RpcResultBuilder.<PnfTopologyOperationOutput>status(true)
+                .withResult(responseBuilder.build()).build();
+
+        // return success
+        return Futures.immediateFuture(rpcResult);
+    }
+
+    private void trySetResponseMessage(PnfTopologyOperationOutputBuilder responseBuilder,
+            ResponseObject responseObject) {
+        if (responseObject.getMessage() != null) {
+            responseBuilder.setResponseMessage(responseObject.getMessage());
+        }
+    }
+
+    private void trySaveService(PnfTopologyOperationInput input, ServiceBuilder serviceBuilder) {
+        if (isValidRequest(input) && (input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Delete)
+                || input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Activate))) {
+
+            // Only update operational tree on activate or delete
+            log.info(UPDATING_TREE_INFO_MESSAGE);
+            saveService(serviceBuilder.build(), false, LogicalDatastoreType.OPERATIONAL);
+        }
+    }
+
+    private boolean hasInvalidPnfId(PnfTopologyOperationInput input) {
+        return input.getPnfDetails() == null || input.getPnfDetails().getPnfId() == null
+                || input.getPnfDetails().getPnfId().length() == 0;
+    }
+
+    private boolean hasInvalidServiceId(PnfTopologyOperationInput input) {
+        return input == null || input.getServiceInformation() == null
+                || input.getServiceInformation().getServiceInstanceId() == null
+                || input.getServiceInformation().getServiceInstanceId().length() == 0;
+    }
+
+    private void trySetSvcRequestId(PnfTopologyOperationInput input,
+            PnfTopologyOperationOutputBuilder responseBuilder) {
+        if (input.getSdncRequestHeader() != null) {
+            responseBuilder.setSvcRequestId(input.getSdncRequestHeader().getSvcRequestId());
+        }
+    }
+
+    private boolean isValidRequest(PnfTopologyOperationInput input) {
+        return input.getSdncRequestHeader() != null && input.getSdncRequestHeader().getSvcAction() != null;
+    }
+
+
+    @Override
+    public ListenableFuture<RpcResult<VnfTopologyOperationOutput>> vnfTopologyOperation(VnfTopologyOperationInput input) {
 
         final String svcOperation = "vnf-topology-operation";
         ServiceData serviceData;
@@ -869,6 +1096,9 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
             responseObject.setMessage(respProps.getProperty(ERROR_MESSAGE_PARAM));
             responseObject.setStatusCode(respProps.getProperty(ERROR_CODE_PARAM));
             ackFinal = respProps.getProperty(ACK_FINAL_PARAM, "Y");
+            if (vnfId == null) {
+                vnfId = respProps.getProperty("vnfId");
+            }
             serviceObjectPath = respProps.getProperty(SERVICE_OBJECT_PATH_PARAM);
             vnfObjectPath = respProps.getProperty(VNF_OBJECT_PATH_PARAM);
         }
@@ -995,7 +1225,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<VfModuleTopologyOperationOutput>> vfModuleTopologyOperation(
+    public ListenableFuture<RpcResult<VfModuleTopologyOperationOutput>> vfModuleTopologyOperation(
             VfModuleTopologyOperationInput input) {
 
         final String svcOperation = "vf-module-topology-operation";
@@ -1228,7 +1458,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<NetworkTopologyOperationOutput>> networkTopologyOperation(
+    public ListenableFuture<RpcResult<NetworkTopologyOperationOutput>> networkTopologyOperation(
             NetworkTopologyOperationInput input) {
 
         final String svcOperation = "network-topology-operation";
@@ -1374,7 +1604,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
                 || input.getServiceInformation().getServiceInstanceId().length() == 0;
     }
 
-    private Future<RpcResult<NetworkTopologyOperationOutput>> buildRpcResultFuture(
+    private ListenableFuture<RpcResult<NetworkTopologyOperationOutput>> buildRpcResultFuture(
             NetworkTopologyOperationOutputBuilder responseBuilder, String responseMessage) {
 
         responseBuilder.setResponseCode("404");
@@ -1392,7 +1622,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<ContrailRouteTopologyOperationOutput>> contrailRouteTopologyOperation(
+    public ListenableFuture<RpcResult<ContrailRouteTopologyOperationOutput>> contrailRouteTopologyOperation(
             ContrailRouteTopologyOperationInput input) {
 
         final String svcOperation = "contrail-route-topology-operation";
@@ -1536,7 +1766,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
                 || input.getServiceInformation().getServiceInstanceId().length() == 0;
     }
 
-    private Future<RpcResult<ContrailRouteTopologyOperationOutput>> buildRpcResultFuture(
+    private ListenableFuture<RpcResult<ContrailRouteTopologyOperationOutput>> buildRpcResultFuture(
             ContrailRouteTopologyOperationOutputBuilder responseBuilder, String responseMessage) {
         responseBuilder.setResponseCode("404");
         responseBuilder.setResponseMessage(responseMessage);
@@ -1553,7 +1783,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<SecurityZoneTopologyOperationOutput>> securityZoneTopologyOperation(
+    public ListenableFuture<RpcResult<SecurityZoneTopologyOperationOutput>> securityZoneTopologyOperation(
             SecurityZoneTopologyOperationInput input) {
 
         final String svcOperation = "security-zone-topology-operation";
@@ -1722,7 +1952,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
                 || input.getServiceInformation().getServiceInstanceId().length() == 0;
     }
 
-    private Future<RpcResult<SecurityZoneTopologyOperationOutput>> buildRpcResultFuture(
+    private ListenableFuture<RpcResult<SecurityZoneTopologyOperationOutput>> buildRpcResultFuture(
             SecurityZoneTopologyOperationOutputBuilder responseBuilder, String responseMessage) {
 
         responseBuilder.setResponseCode("404");
@@ -1760,7 +1990,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
         }
     }
 
-    private Future<RpcResult<ConnectionAttachmentTopologyOperationOutput>>
+    private ListenableFuture<RpcResult<ConnectionAttachmentTopologyOperationOutput>>
     buildRpcResultFuture(ConnectionAttachmentTopologyOperationOutputBuilder responseBuilder, String responseMessage) {
 
         responseBuilder.setResponseCode("404");
@@ -1790,7 +2020,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<ConnectionAttachmentTopologyOperationOutput>> connectionAttachmentTopologyOperation(ConnectionAttachmentTopologyOperationInput input) {
+    public ListenableFuture<RpcResult<ConnectionAttachmentTopologyOperationOutput>> connectionAttachmentTopologyOperation(ConnectionAttachmentTopologyOperationInput input) {
         final String svcOperation = "connection-attachment-topology-operation";
         Properties parms = new Properties();
         log.info(CALLED_STR, svcOperation);
@@ -1922,7 +2152,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<TunnelxconnTopologyOperationOutput>> tunnelxconnTopologyOperation(
+    public ListenableFuture<RpcResult<TunnelxconnTopologyOperationOutput>> tunnelxconnTopologyOperation(
             TunnelxconnTopologyOperationInput input) {
 
         final String svcOperation = "tunnelxconn-topology-operation";
@@ -2053,7 +2283,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<BrgTopologyOperationOutput>> brgTopologyOperation(BrgTopologyOperationInput input) {
+    public ListenableFuture<RpcResult<BrgTopologyOperationOutput>> brgTopologyOperation(BrgTopologyOperationInput input) {
         final String svcOperation = "brg-topology-operation";
         Properties parms = new Properties();
 
@@ -2172,7 +2402,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<PreloadNetworkTopologyOperationOutput>> preloadNetworkTopologyOperation(
+    public ListenableFuture<RpcResult<PreloadNetworkTopologyOperationOutput>> preloadNetworkTopologyOperation(
             PreloadNetworkTopologyOperationInput input) {
 
         final String svcOperation = "preload-network-topology-operation";
@@ -2273,7 +2503,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
             responseBuilder.setAckFinalIndicator("Y");
             log.error(RETURNED_FAILED_MESSAGE, svcOperation, preloadId, responseBuilder.build());
             RpcResult<PreloadNetworkTopologyOperationOutput> rpcResult = RpcResultBuilder
-                    .<PreloadNetworkTopologyOperationOutput>status(false).withResult(responseBuilder.build()).build();
+                    .<PreloadNetworkTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
             return Futures.immediateFuture(rpcResult);
         }
 
@@ -2347,7 +2577,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<PreloadVfModuleTopologyOperationOutput>> preloadVfModuleTopologyOperation(
+    public ListenableFuture<RpcResult<PreloadVfModuleTopologyOperationOutput>> preloadVfModuleTopologyOperation(
             PreloadVfModuleTopologyOperationInput input) {
 
         final String svcOperation = "preload-vf-module-topology-operation";
@@ -2452,7 +2682,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
             responseBuilder.setAckFinalIndicator("Y");
             log.error(RETURNED_FAILED_MESSAGE, svcOperation, preloadId, responseBuilder.build());
             RpcResult<PreloadVfModuleTopologyOperationOutput> rpcResult = RpcResultBuilder
-                    .<PreloadVfModuleTopologyOperationOutput>status(false).withResult(responseBuilder.build()).build();
+                    .<PreloadVfModuleTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
             return Futures.immediateFuture(rpcResult);
         }
 
@@ -2502,7 +2732,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<GenericConfigurationTopologyOperationOutput>> genericConfigurationTopologyOperation(
+    public ListenableFuture<RpcResult<GenericConfigurationTopologyOperationOutput>> genericConfigurationTopologyOperation(
             GenericConfigurationTopologyOperationInput input) {
 
         final String svcOperation = "generic-configuration-topology-operation";
@@ -2677,7 +2907,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<Void>> genericConfigurationNotification(GenericConfigurationNotificationInput input) {
+    public ListenableFuture<RpcResult<GenericConfigurationNotificationOutput>> genericConfigurationNotification(GenericConfigurationNotificationInput input) {
 
         final String svcOperation = "generic-configuration-notification";
         ServiceData serviceData;
@@ -2732,8 +2962,11 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
             } catch (Exception e) {
                 log.error(UPDATING_MDSAL_ERROR_MESSAGE, svcOperation, siid, e);
             }
+            
+            
+            
 
-            RpcResult<Void> rpcResult = RpcResultBuilder.<Void>status(true).build();
+            RpcResult<GenericConfigurationNotificationOutput> rpcResult = RpcResultBuilder.<GenericConfigurationNotificationOutput>status(true).build();
 
             return Futures.immediateFuture(rpcResult);
         }
@@ -2754,7 +2987,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
 
         } catch (Exception e) {
             log.error(UPDATING_MDSAL_ERROR_MESSAGE, svcOperation, siid, e);
-            RpcResult<Void> rpcResult = RpcResultBuilder.<Void>status(true).build();
+            RpcResult<GenericConfigurationNotificationOutput> rpcResult = RpcResultBuilder.<GenericConfigurationNotificationOutput>status(true).build();
 
             return Futures.immediateFuture(rpcResult);
         }
@@ -2762,13 +2995,13 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
         // Update succeeded
         log.info(UPDATED_MDSAL_INFO_MESSAGE, svcOperation, siid);
 
-        RpcResult<Void> rpcResult = RpcResultBuilder.<Void>status(true).build();
+        RpcResult<GenericConfigurationNotificationOutput> rpcResult = RpcResultBuilder.<GenericConfigurationNotificationOutput>status(true).build();
 
         return Futures.immediateFuture(rpcResult);
     }
 
     @Override
-    public Future<RpcResult<GetpathsegmentTopologyOperationOutput>> getpathsegmentTopologyOperation(
+    public ListenableFuture<RpcResult<GetpathsegmentTopologyOperationOutput>> getpathsegmentTopologyOperation(
             GetpathsegmentTopologyOperationInput input) {
 
         final String svcOperation = "getpathsegment-topology-operation";
@@ -2933,7 +3166,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<PolicyUpdateNotifyOperationOutput>> policyUpdateNotifyOperation(
+    public ListenableFuture<RpcResult<PolicyUpdateNotifyOperationOutput>> policyUpdateNotifyOperation(
             PolicyUpdateNotifyOperationInput input) {
 
         final String svcOperation = "policy-update-notify-operation";
@@ -2999,7 +3232,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<PortMirrorTopologyOperationOutput>> portMirrorTopologyOperation(
+    public ListenableFuture<RpcResult<PortMirrorTopologyOperationOutput>> portMirrorTopologyOperation(
             final PortMirrorTopologyOperationInput input) {
 
         final String svcOperation = "port-mirror-topology-operation";
@@ -3288,7 +3521,7 @@ public class GenericResourceApiProvider implements AutoCloseable, GENERICRESOURC
     }
 
     @Override
-    public Future<RpcResult<VnfGetResourceRequestOutput>> vnfGetResourceRequest(VnfGetResourceRequestInput input) {
+    public ListenableFuture<RpcResult<VnfGetResourceRequestOutput>> vnfGetResourceRequest(VnfGetResourceRequestInput input) {
 
         final String svcOperation = "vnf-get-resource-request";
         ServiceData serviceData;