Fixed Blocker Bugs
[sdnc/northbound.git] / vnfapi / provider / src / main / java / org / onap / sdnc / vnfapi / VnfApiProvider.java
index f390eeb..c14db88 100644 (file)
@@ -24,14 +24,14 @@ package org.onap.sdnc.vnfapi;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.SettableFuture;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.base.Optional;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.OptimisticLockFailedException;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
@@ -131,6 +131,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.ModifiedNodeDoesNotExistException;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.MDC;
@@ -145,6 +146,7 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.concurrent.Future;
 
 /**
@@ -152,16 +154,27 @@ import java.util.concurrent.Future;
  * the most commonly used components of the MD-SAL. Additionally the base class provides some basic logging and
  * initialization / clean up methods.
  */
-public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeListener {
 
+public class VnfApiProvider implements AutoCloseable, VNFAPIService {
+
+    protected DataBroker dataBroker;
+    protected NotificationPublishService notificationService;
+    protected RpcProviderRegistry rpcRegistry;
+    protected BindingAwareBroker.RpcRegistration<VNFAPIService> rpcRegistration;
     private final Logger log = LoggerFactory.getLogger(VnfApiProvider.class);
     private final ExecutorService executor;
 
+    private static final String PRELOAD_DATA = "] PreloadData: ";
+    private static final String SENDING_SUCCESS_RPC = "Sending Success rpc result due to external error";
+    public static final String REASON = "', Reason: '";
+    public static final String ERROR_CODE = "] error code: '";
+    public static final String INVALID_INPUT_INVALID_PRELOAD_TYPE = "invalid input, invalid preload-type";
+    public static final String BECAUSE_OF_INVALID_PRELOAD_TYPE = " because of invalid preload-type";
+    public static final String INVALID_INPUT_NULL_OR_EMPTY_SERVICE_INSTANCE_ID = "invalid input, null or empty service-instance-id";
+    public static final String BECAUSE_OF_INVALID_INPUT_NULL_OR_EMPTY_SERVICE_INSTANCE_ID = " because of invalid input, null or empty service-instance-id";
     private static final String APP_NAME = "vnfapi";
     private static final String VNF_API = "VNF-API";
     private static final String OPERATIONAL_DATA = "operational-data";
-    private static final String SVC_OPERATION = "vf-module-topology-operation";
-
     private static final String READ_MD_SAL_STR = "Read MD-SAL (";
     private static final String DATA_FOR_STR = ") data for [";
     private static final String SERVICE_DATA_STR = "] ServiceData: ";
@@ -186,11 +199,6 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
 
     private VNFSDNSvcLogicServiceClient svcLogicClient;
 
-    protected DataBroker dataBroker;
-    protected NotificationPublishService notificationService;
-    protected RpcProviderRegistry rpcRegistry;
-    protected BindingAwareBroker.RpcRegistration<VNFAPIService> rpcRegistration;
-
     public VnfApiProvider(DataBroker dataBroker2, NotificationPublishService notificationPublishService,
         RpcProviderRegistry rpcProviderRegistry, VNFSDNSvcLogicServiceClient client) {
         log.info("Creating provider for " + APP_NAME);
@@ -270,166 +278,6 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         log.info("Successfully closed provider for " + APP_NAME);
     }
 
-    // On data change not used
-    @Override
-    public void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
-
-        log.info("   IN ON DATA CHANGE: ");
-
-        boolean changed = false;
-        WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
-        DataObject updatedSubTree = change.getUpdatedSubtree();
-
-        if (updatedSubTree != null) {
-            if (log.isDebugEnabled()) {
-                log.debug("updatedSubTree was non-null:" + updatedSubTree);
-            }
-            if (updatedSubTree instanceof Vnfs) {
-                changed = isChanged(changed, (Vnfs) updatedSubTree);
-            }
-            if (updatedSubTree instanceof PreloadVnfs) {
-                changed = isChanged(changed, (PreloadVnfs) updatedSubTree);
-            }
-            //1610
-            if (updatedSubTree instanceof PreloadVnfInstances) {
-                changed = isChanged(changed, (PreloadVnfInstances) updatedSubTree);
-            }
-            //1610
-            if (updatedSubTree instanceof VnfInstances) {
-                changed = isChanged(changed, (VnfInstances) updatedSubTree);
-            }
-            //1610
-            if (updatedSubTree instanceof PreloadVfModules) {
-                changed = isChanged(changed, (PreloadVfModules) updatedSubTree);
-            }
-            //1610
-            if (updatedSubTree instanceof VfModules) {
-                changed = isChanged(changed, (VfModules) updatedSubTree);
-            }
-        }
-
-        // Do the write transaction only if something changed.
-        if (changed) {
-            CheckedFuture<Void, TransactionCommitFailedException> checkedFuture = writeTransaction.submit();
-            Futures.addCallback(checkedFuture, new FutureCallback<Void>() {
-
-                @Override
-                public void onSuccess(Void arg0) {
-                    log.debug("Successfully updated Service Status");
-                }
-
-                @Override
-                public void onFailure(Throwable e) {
-                    log.debug("Failed updating Service Status", e);
-                }
-            }, executor);
-        }
-    }
-
-    private boolean isChanged(boolean changed, VfModules updatedSubTree) {
-        ArrayList<VfModuleList> vfModuleList =
-            (ArrayList<VfModuleList>) updatedSubTree.getVfModuleList();
-        if (vfModuleList != null) {
-            for (VfModuleList entry : vfModuleList) {
-                VfModuleServiceData vfModuleServiceData = entry.getVfModuleServiceData();
-                ServiceStatus serviceStatus = entry.getServiceStatus();
-                if (vfModuleServiceData != null && serviceStatus != null) {
-                    // VfModuleServiceData change detected, check the AckFinal indicator and request-status to
-                    // see if we need to proceed.
-                    return isChanged(changed, serviceStatus);
-                }
-            }
-        }
-        return changed;
-    }
-
-    private boolean isChanged(boolean changed, PreloadVfModules updatedSubTree) {
-        ArrayList<VfModulePreloadList> vnfInstanceList =
-            (ArrayList<VfModulePreloadList>) updatedSubTree.getVfModulePreloadList();
-        if (vnfInstanceList != null) {
-            for (VfModulePreloadList entry : vnfInstanceList) {
-                VfModulePreloadData vnfInstancePreloadData = entry.getVfModulePreloadData();
-                if (vnfInstancePreloadData != null) {
-                    return true;
-                }
-            }
-        }
-        return changed;
-    }
-
-    private boolean isChanged(boolean changed, VnfInstances updatedSubTree) {
-        ArrayList<VnfInstanceList> vnfInstanceList =
-            (ArrayList<VnfInstanceList>) updatedSubTree.getVnfInstanceList();
-        if (vnfInstanceList != null) {
-            for (VnfInstanceList entry : vnfInstanceList) {
-                VnfInstanceServiceData vnfInstanceServiceData = entry.getVnfInstanceServiceData();
-                ServiceStatus serviceStatus = entry.getServiceStatus();
-                if (vnfInstanceServiceData != null && serviceStatus != null) {
-                    // VnfInstanceServiceData change detected, check the AckFinal indicator and request-status
-                    // to see if we need to proceed.
-                    return isChanged(changed, serviceStatus);
-                }
-            }
-        }
-        return changed;
-    }
-
-    private boolean isChanged(boolean changed, PreloadVnfInstances updatedSubTree) {
-        ArrayList<VnfInstancePreloadList> vnfInstanceList =
-            (ArrayList<VnfInstancePreloadList>) updatedSubTree
-                .getVnfInstancePreloadList();
-        if (vnfInstanceList != null) {
-            for (VnfInstancePreloadList entry : vnfInstanceList) {
-                VnfInstancePreloadData vnfInstancePreloadData = entry.getVnfInstancePreloadData();
-                if (vnfInstancePreloadData != null) {
-                    return true;
-                }
-            }
-        }
-        return changed;
-    }
-
-    private boolean isChanged(boolean changed, PreloadVnfs updatedSubTree) {
-        ArrayList<VnfPreloadList> vnfList =
-            (ArrayList<VnfPreloadList>) updatedSubTree.getVnfPreloadList();
-        if (vnfList != null) {
-            for (VnfPreloadList entry : vnfList) {
-                PreloadData preloadData = entry.getPreloadData();
-                if (preloadData != null) {
-                    return true;
-                }
-            }
-        }
-        return changed;
-    }
-
-    private boolean isChanged(boolean changed, Vnfs updatedSubTree) {
-        ArrayList<VnfList> vnfList = (ArrayList<VnfList>) updatedSubTree.getVnfList();
-        if (vnfList != null) {
-            for (VnfList entry : vnfList) {
-                ServiceData serviceData = entry.getServiceData();
-                ServiceStatus serviceStatus = entry.getServiceStatus();
-                if (serviceData != null && serviceStatus != null) {
-                    //
-                    // ServiceData change detected, check the AckFinal indicator and request-status to see if we need to proceed.
-                    //
-                    return isChanged(changed, serviceStatus);
-                }
-            }
-        }
-        return changed;
-    }
-
-    private boolean isChanged(boolean changed, ServiceStatus serviceStatus) {
-        if ((!"Y".equals(serviceStatus.getFinalIndicator())) && (RequestStatus.Synccomplete
-            .equals(serviceStatus.getRequestStatus()))) {
-            if (log.isDebugEnabled()) {
-                log.debug("Final Indicator is not Y, calling handleServiceDataUpdated");
-            }
-            return true;
-        }
-        return changed;
-    }
 
     private static class Iso8601Util {
 
@@ -565,11 +413,10 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             .child(VnfList.class, new VnfListKey(siid))
             .build();
 
-        ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction();
         Optional<VnfList> data = Optional.absent();
-        try {
+        try (final ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) {
             data = readTx.read(type, serviceInstanceIdentifier).get();
-        } catch (InterruptedException | ExecutionException e) {
+        } catch (final InterruptedException | ExecutionException e) {
             log.error(EXCEPTION_READING_MD_SAL_STR + type + FOR_STR + siid + "] ", e);
         }
 
@@ -607,17 +454,15 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             .child(VnfInstanceList.class, new VnfInstanceListKey(siid))
             .build();
 
-        ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction();
         Optional<VnfInstanceList> data = Optional.absent();
-        try {
+        try (final ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) {
             data = readTx.read(type, vnfInstanceIdentifier).get();
-        } catch (InterruptedException | ExecutionException e) {
+        } catch (final InterruptedException | ExecutionException e) {
             log.error(EXCEPTION_READING_MD_SAL_STR + type + FOR_STR + siid + "] ", e);
         }
 
         if (data.isPresent()) {
-            VnfInstanceServiceData vnfInstanceServiceData =
-                (VnfInstanceServiceData) data.get().getVnfInstanceServiceData();
+            VnfInstanceServiceData vnfInstanceServiceData = data.get().getVnfInstanceServiceData();
             if (vnfInstanceServiceData != null) {
                 log.info(READ_MD_SAL_STR + type + DATA_FOR_STR + siid + "] VnfInstanceServiceData: "
                     + vnfInstanceServiceData);
@@ -653,11 +498,10 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             .child(VfModuleList.class, new VfModuleListKey(siid))
             .build();
 
-        ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction();
         Optional<VfModuleList> data = Optional.absent();
-        try {
+        try (final ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) {
             data = readTx.read(type, vfModuleIdentifier).get();
-        } catch (InterruptedException | ExecutionException e) {
+        } catch (final InterruptedException | ExecutionException e) {
             log.error(EXCEPTION_READING_MD_SAL_STR + type + FOR_STR + siid + "] ", e);
         }
 
@@ -697,19 +541,17 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             .child(VnfPreloadList.class, new VnfPreloadListKey(preloadName, preloadType))
             .build();
 
-        ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction();
         Optional<VnfPreloadList> data = Optional.absent();
-        try {
+        try (final ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) {
             data = readTx.read(type, preloadInstanceIdentifier).get();
-        } catch (InterruptedException | ExecutionException e) {
-            log.error(EXCEPTION_READING_MD_SAL_STR + type + FOR_STR + preloadName + "," + preloadType + "] ",
-                e);
+        } catch (final InterruptedException | ExecutionException e) {
+            log.error(EXCEPTION_READING_MD_SAL_STR + type + FOR_STR + preloadName + "," + preloadType + "] ", e);
         }
 
         if (data.isPresent()) {
             PreloadData preloadData = (PreloadData) data.get().getPreloadData();
             if (preloadData != null) {
-                log.info(READ_MD_SAL_STR + type + DATA_FOR_STR + preloadName + "," + preloadType + "] PreloadData: "
+                log.info(READ_MD_SAL_STR + type + DATA_FOR_STR + preloadName + "," + preloadType + PRELOAD_DATA
                     + preloadData);
                 preloadDataBuilder.setVnfTopologyInformation(preloadData.getVnfTopologyInformation());
                 preloadDataBuilder.setNetworkTopologyInformation(preloadData.getNetworkTopologyInformation());
@@ -739,13 +581,11 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             .child(VnfInstancePreloadList.class, new VnfInstancePreloadListKey(preloadName, preloadType))
             .build();
 
-        ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction();
         Optional<VnfInstancePreloadList> data = Optional.absent();
-        try {
+        try (final ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) {
             data = readTx.read(type, preloadInstanceIdentifier).get();
-        } catch (InterruptedException | ExecutionException e) {
-            log.error(EXCEPTION_READING_MD_SAL_STR + type + FOR_STR + preloadName + "," + preloadType + "] ",
-                e);
+        } catch (final InterruptedException | ExecutionException e) {
+            log.error(EXCEPTION_READING_MD_SAL_STR + type + FOR_STR + preloadName + "," + preloadType + "] ", e);
         }
 
         if (data.isPresent()) {
@@ -779,14 +619,11 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             .child(VfModulePreloadList.class, new VfModulePreloadListKey(preloadName, preloadType))
             .build();
 
-        ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction();
         Optional<VfModulePreloadList> data = Optional.absent();
-
-        try {
+        try (final ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) {
             data = readTx.read(type, preloadInstanceIdentifier).get();
-        } catch (InterruptedException | ExecutionException e) {
-            log.error(EXCEPTION_READING_MD_SAL_STR + type + FOR_STR + preloadName + "," + preloadType + "] ",
-                e);
+        } catch (final InterruptedException | ExecutionException e) {
+            log.error(EXCEPTION_READING_MD_SAL_STR + type + FOR_STR + preloadName + "," + preloadType + "] ", e);
         }
 
         if (data.isPresent()) {
@@ -809,10 +646,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Each entry will be identifiable by a unique key, we have to create that identifier
         InstanceIdentifier<VnfList> path = InstanceIdentifier
             .builder(Vnfs.class)
-            .child(VnfList.class, entry.getKey())
+            .child(VnfList.class, entry.key())
             .build();
 
-
         int optimisticLockTries = 2;
         boolean tryAgain = true;
         while (tryAgain) {
@@ -831,13 +667,21 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
                 tryAgain = true;
 
             } catch (final TransactionCommitFailedException e) {
+                Throwable eCause = e.getCause();
 
-                if (e.getCause() instanceof ModifiedNodeDoesNotExistException) {
-                    log.debug("Ignoring MpdifiedNodeDoesNotExistException");
+                if (eCause instanceof org.opendaylight.mdsal.common.api.TransactionCommitFailedException) {
+                    log.debug("Nested TransactionCommitFailed exception - getting next cause");
+                    eCause = eCause.getCause();
+                } else {
+                    log.debug("Got TransactionCommitFailedException, caused by {}", eCause.getClass().getName());
+                }
+
+                if (eCause instanceof ModifiedNodeDoesNotExistException) {
+                    log.debug("Ignoring ModifiedNodeDoesNotExistException");
                     break;
                 }
 
-                log.debug("Delete DataStore failed");
+                log.debug("Delete DataStore failed due to exception", eCause);
                 throw new IllegalStateException(e);
             }
         }
@@ -847,7 +691,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Each entry will be identifiable by a unique key, we have to create that identifier
         InstanceIdentifier<VnfList> path = InstanceIdentifier
             .builder(Vnfs.class)
-            .child(VnfList.class, entry.getKey())
+            .child(VnfList.class, entry.key())
             .build();
 
         tryUpdateDataStore(entry, merge, storeType, path);
@@ -858,10 +702,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Each entry will be identifiable by a unique key, we have to create that identifier
         InstanceIdentifier<VnfInstanceList> path = InstanceIdentifier
             .builder(VnfInstances.class)
-            .child(VnfInstanceList.class, entry.getKey())
+            .child(VnfInstanceList.class, entry.key())
             .build();
 
-
         tryUpdateDataStore(entry, merge, storeType, path);
     }
 
@@ -870,7 +713,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Each entry will be identifiable by a unique key, we have to create that identifier
         InstanceIdentifier<VfModuleList> path = InstanceIdentifier
             .builder(VfModules.class)
-            .child(VfModuleList.class, entry.getKey())
+            .child(VfModuleList.class, entry.key())
             .build();
 
         tryUpdateDataStore(entry, merge, storeType, path);
@@ -881,7 +724,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Each entry will be identifiable by a unique key, we have to create that identifier
         InstanceIdentifier<VnfPreloadList> path = InstanceIdentifier
             .builder(PreloadVnfs.class)
-            .child(VnfPreloadList.class, entry.getKey())
+            .child(VnfPreloadList.class, entry.key())
             .build();
 
         tryUpdateDataStore(entry, merge, storeType, path);
@@ -894,7 +737,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Each entry will be identifiable by a unique key, we have to create that identifier
         InstanceIdentifier<VnfInstancePreloadList> path = InstanceIdentifier
             .builder(PreloadVnfInstances.class)
-            .child(VnfInstancePreloadList.class, entry.getKey())
+            .child(VnfInstancePreloadList.class, entry.key())
             .build();
 
         tryUpdateDataStore(entry, merge, storeType, path);
@@ -907,13 +750,13 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Each entry will be identifiable by a unique key, we have to create that identifier
         InstanceIdentifier<VfModulePreloadList> path = InstanceIdentifier
             .builder(PreloadVfModules.class)
-            .child(VfModulePreloadList.class, entry.getKey())
+            .child(VfModulePreloadList.class, entry.key())
             .build();
 
         tryUpdateDataStore(entry, merge, storeType, path);
     }
 
-    private  <T extends DataObject> void tryUpdateDataStore(T entry, boolean merge, LogicalDatastoreType storeType,
+    private <T extends DataObject> void tryUpdateDataStore(T entry, boolean merge, LogicalDatastoreType storeType,
         InstanceIdentifier<T> path) {
 
         int tries = 2;
@@ -947,30 +790,44 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
     }
 
     //1610 vnf-instance-topology-operation
+
+    private Boolean validateVnfInstanceTopologyOperationInput(VnfInstanceTopologyOperationInput input) {
+        return input != null
+            && input.getVnfInstanceRequestInformation() != null
+            && input.getVnfInstanceRequestInformation().getVnfInstanceId() != null
+            && input.getVnfInstanceRequestInformation().getVnfInstanceId().length() != 0;
+    }
+
+    private ListenableFuture<RpcResult<VnfInstanceTopologyOperationOutput>> buildVnfInstanceTopologyOperationOutputWithtError(
+        String responseCode, String responseMessage, String ackFinalIndicator) {
+        VnfInstanceTopologyOperationOutputBuilder responseBuilder = new VnfInstanceTopologyOperationOutputBuilder();
+        responseBuilder.setResponseCode(responseCode);
+        responseBuilder.setResponseMessage(responseMessage);
+        responseBuilder.setAckFinalIndicator(ackFinalIndicator);
+        return Futures.immediateFuture(RpcResultBuilder
+            .<VnfInstanceTopologyOperationOutput>status(true)
+            .withResult(responseBuilder.build())
+            .build());
+    }
+
     @Override
-    public Future<RpcResult<VnfInstanceTopologyOperationOutput>> vnfInstanceTopologyOperation(
+    public ListenableFuture<RpcResult<VnfInstanceTopologyOperationOutput>> vnfInstanceTopologyOperation(
         VnfInstanceTopologyOperationInput input) {
 
+        final String svcOperation = "vnf-instance-topology-operation";
         VnfInstanceServiceData vnfInstanceServiceData;
         ServiceStatusBuilder serviceStatusBuilder = new ServiceStatusBuilder();
         Properties parms = new Properties();
 
-        log.info(SVC_OPERATION + CALLED_STR);
+        log.info(svcOperation + CALLED_STR);
         // create a new response object
         VnfInstanceTopologyOperationOutputBuilder responseBuilder = new VnfInstanceTopologyOperationOutputBuilder();
 
-        if (input == null || input.getVnfInstanceRequestInformation() == null
-            || input.getVnfInstanceRequestInformation().getVnfInstanceId() == null) {
-            log.debug(EXITING_STR + SVC_OPERATION + " because of " + INVALID_INPUT_VNF_INSTANCE_STR);
-            responseBuilder.setResponseCode("403");
-            responseBuilder.setResponseMessage(INVALID_INPUT_VNF_INSTANCE_STR);
-            responseBuilder.setAckFinalIndicator("Y");
-            RpcResult<VnfInstanceTopologyOperationOutput> rpcResult = RpcResultBuilder
-                .<VnfInstanceTopologyOperationOutput>status(true)
-                .withResult(responseBuilder.build())
-                .build();
-            // return error
-            return Futures.immediateFuture(rpcResult);
+        if (!validateVnfInstanceTopologyOperationInput(input)) {
+            log.debug(EXITING_STR + svcOperation + " because of " + INVALID_INPUT_VNF_INSTANCE_STR);
+            return buildVnfInstanceTopologyOperationOutputWithtError("403",
+                INVALID_INPUT_VNF_INSTANCE_STR,
+                "Y");
         }
 
         // Grab the service instance ID from the input buffer
@@ -978,20 +835,6 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String preloadName = input.getVnfInstanceRequestInformation().getVnfInstanceName();
         String preloadType = input.getVnfInstanceRequestInformation().getVnfModelId();
 
-        // Make sure we have a valid viid
-        if (viid == null || viid.length() == 0) {
-            log.debug(EXITING_STR + SVC_OPERATION + " because of invalid vnf-instance-id");
-            responseBuilder.setResponseCode("403");
-            responseBuilder.setResponseMessage(INVALID_INPUT_VNF_INSTANCE_STR);
-            responseBuilder.setAckFinalIndicator("Y");
-            RpcResult<VnfInstanceTopologyOperationOutput> rpcResult = RpcResultBuilder
-                .<VnfInstanceTopologyOperationOutput>status(true)
-                .withResult(responseBuilder.build())
-                .build();
-            // return error
-            return Futures.immediateFuture(rpcResult);
-        }
-
         if (input.getSdncRequestHeader() != null) {
             responseBuilder.setSvcRequestId(input.getSdncRequestHeader().getSvcRequestId());
             setRequestIdAsMDC(input.getSdncRequestHeader().getSvcRequestId());
@@ -1015,7 +858,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
 
         //
         // setup a service-data object builder
-        // ACTION vnf-topology-operation
+        // ACTION vnf-topology-operationa
         // INPUT:
         //  USES sdnc-request-header;
         //  USES request-information;
@@ -1030,16 +873,16 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         //   uses vnf-configuration-information;
         //   uses oper-status;
 
-        log.info(ADDING_INPUT_DATA_STR + SVC_OPERATION + " [" + viid + INPUT_STR + input);
+        log.info(ADDING_INPUT_DATA_STR + svcOperation + " [" + viid + INPUT_STR + input);
         VnfInstanceTopologyOperationInputBuilder inputBuilder = new VnfInstanceTopologyOperationInputBuilder(input);
         VnfSdnUtil.toProperties(parms, inputBuilder.build());
 
-        log.info(ADDING_OPERATIONAL_DATA_STR + SVC_OPERATION + " [" + viid + OPERATIONAL_DATA_STR + operDataBuilder
+        log.info(ADDING_OPERATIONAL_DATA_STR + svcOperation + " [" + viid + OPERATIONAL_DATA_STR + operDataBuilder
             .build());
         VnfSdnUtil.toProperties(parms, OPERATIONAL_DATA, operDataBuilder);
 
         log.info(
-            ADDING_CONFIG_DATA_STR + SVC_OPERATION + " [" + preloadName + "," + preloadType + "] preload-data: "
+            ADDING_CONFIG_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType + "] preload-data: "
                 + vnfInstancePreloadDataBuilder.build());
         VnfSdnUtil.toProperties(parms, "vnf-instance-preload-data", vnfInstancePreloadDataBuilder);
 
@@ -1051,20 +894,17 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String ackFinal = "Y";
 
         try {
-            if (svcLogicClient.hasGraph(VNF_API, SVC_OPERATION, null, "sync")) {
-
-                try {
-                    respProps = svcLogicClient
-                        .execute(VNF_API, SVC_OPERATION, null, "sync", vnfInstanceServiceDataBuilder, parms);
-                } catch (Exception e) {
-                    log.error("Caught exception executing service logic for " + SVC_OPERATION, e);
-                    errorMessage = e.getMessage();
-                    errorCode = "500";
-                }
+            if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) {
+                respProps = svcLogicClient
+                    .execute(VNF_API, svcOperation, null, "sync", vnfInstanceServiceDataBuilder, parms);
             } else {
-                errorMessage = "No service logic active for VNF-API: '" + SVC_OPERATION + "'";
+                errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'";
                 errorCode = "503";
             }
+        } catch (SvcLogicException e) {
+            log.error("Caught exception executing service logic for " + svcOperation, e);
+            errorMessage = e.getMessage();
+            errorCode = "500";
         } catch (Exception e) {
             errorCode = "500";
             errorMessage = e.getMessage();
@@ -1091,9 +931,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             try {
                 saveVnfInstanceList(vnfInstanceListBuilder.build(), true, LogicalDatastoreType.CONFIGURATION);
             } catch (Exception e) {
-                log.error(CAUGHT_EXCEPTION_STR + SVC_OPERATION + " [" + viid + "] \n", e);
+                log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + viid + "] \n", e);
             }
-            log.error(RETURNED_FAILED_STR + SVC_OPERATION + " [" + viid + "] " + responseBuilder.build());
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + viid + "] " + responseBuilder.build());
             RpcResult<VnfInstanceTopologyOperationOutput> rpcResult = RpcResultBuilder
                 .<VnfInstanceTopologyOperationOutput>status(true)
                 .withResult(responseBuilder.build())
@@ -1105,13 +945,12 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Got success from SLI
         try {
             vnfInstanceServiceData = vnfInstanceServiceDataBuilder.build();
-            log.info(UPDATING_MD_SAL_STR + SVC_OPERATION + " [" + viid + "] VnfInstanceServiceData: "
+            log.info(UPDATING_MD_SAL_STR + svcOperation + " [" + viid + "] VnfInstanceServiceData: "
                 + vnfInstanceServiceData);
             // svc-configuration-list
             VnfInstanceListBuilder vnfInstanceListBuilder = new VnfInstanceListBuilder();
             vnfInstanceListBuilder.setVnfInstanceServiceData(vnfInstanceServiceData);
             vnfInstanceListBuilder.setVnfInstanceId(vnfInstanceServiceData.getVnfInstanceId());
-            //siid = vnfInstanceServiceData.getVnfInstanceId();
             vnfInstanceListBuilder.setServiceStatus(serviceStatusBuilder.build());
             saveVnfInstanceList(vnfInstanceListBuilder.build(), false, LogicalDatastoreType.CONFIGURATION);
             if (input.getSdncRequestHeader() != null && input.getSdncRequestHeader().getSvcAction() != null) {
@@ -1127,11 +966,11 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             responseBuilder.setVnfInstanceInformation(vnfInstanceInformationBuilder.build());
             responseBuilder.setServiceInformation(vnfInstanceServiceData.getServiceInformation());
         } catch (Exception e) {
-            log.error(CAUGHT_EXCEPTION_STR + SVC_OPERATION + " [" + viid + "] \n", e);
+            log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + viid + "] \n", e);
             responseBuilder.setResponseCode("500");
             responseBuilder.setResponseMessage(e.toString());
             responseBuilder.setAckFinalIndicator("Y");
-            log.error(RETURNED_FAILED_STR + SVC_OPERATION + " [" + viid + "] " + responseBuilder.build());
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + viid + "] " + responseBuilder.build());
             RpcResult<VnfInstanceTopologyOperationOutput> rpcResult = RpcResultBuilder
                 .<VnfInstanceTopologyOperationOutput>status(true)
                 .withResult(responseBuilder.build())
@@ -1146,8 +985,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         if (errorMessage != null) {
             responseBuilder.setResponseMessage(errorMessage);
         }
-        log.info(UPDATED_MD_SAL_STR + SVC_OPERATION + " [" + viid + "] ");
-        log.info(RETURNED_SUCCESS_STR + SVC_OPERATION + " [" + viid + "] " + responseBuilder.build());
+        log.info(UPDATED_MD_SAL_STR + svcOperation + " [" + viid + "] ");
+        log.info(RETURNED_SUCCESS_STR + svcOperation + " [" + viid + "] " + responseBuilder.build());
 
         RpcResult<VnfInstanceTopologyOperationOutput> rpcResult = RpcResultBuilder
             .<VnfInstanceTopologyOperationOutput>status(true)
@@ -1159,21 +998,22 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
 
     //1610 vf-module-topology-operation
     @Override
-    public Future<RpcResult<VfModuleTopologyOperationOutput>> vfModuleTopologyOperation(
+    public ListenableFuture<RpcResult<VfModuleTopologyOperationOutput>> vfModuleTopologyOperation(
         VfModuleTopologyOperationInput input) {
 
+        final String svcOperation = "vf-module-topology-operation";
         VfModuleServiceData vfModuleServiceData;
         ServiceStatusBuilder serviceStatusBuilder = new ServiceStatusBuilder();
         Properties parms = new Properties();
 
-        log.info(SVC_OPERATION + CALLED_STR);
+        log.info(svcOperation + CALLED_STR);
         // create a new response object
         VfModuleTopologyOperationOutputBuilder responseBuilder = new VfModuleTopologyOperationOutputBuilder();
 
         // Validate vf-module-id from vf-module-request-information
         if (input == null || input.getVfModuleRequestInformation() == null
             || input.getVfModuleRequestInformation().getVfModuleId() == null) {
-            log.debug(EXITING_STR + SVC_OPERATION + " because of invalid input, null or empty vf-module-id");
+            log.debug(EXITING_STR + svcOperation + " because of invalid input, null or empty vf-module-id");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage(INVALID_INPUT_VF_MODULE_STR);
             responseBuilder.setAckFinalIndicator("Y");
@@ -1192,7 +1032,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
 
         // Make sure we have a valid siid
         if (vfid == null || vfid.length() == 0) {
-            log.debug(EXITING_STR + SVC_OPERATION + " because of invalid vf-module-id");
+            log.debug(EXITING_STR + svcOperation + " because of invalid vf-module-id");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage(INVALID_INPUT_VF_MODULE_STR);
             responseBuilder.setAckFinalIndicator("Y");
@@ -1208,7 +1048,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String viid = input.getVfModuleRequestInformation().getVnfInstanceId();
 
         if (viid == null || viid.length() == 0) {
-            log.debug(EXITING_STR + SVC_OPERATION + " because of invalid vnf-instance-id");
+            log.debug(EXITING_STR + svcOperation + " because of invalid vnf-instance-id");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage(INVALID_INPUT_VNF_INSTANCE_STR);
             responseBuilder.setAckFinalIndicator("Y");
@@ -1237,10 +1077,6 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         VfModuleServiceDataBuilder operDataBuilder = new VfModuleServiceDataBuilder();
         getVfModuleServiceData(vfid, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
 
-        // save service-data builder object for rollback
-        VfModuleServiceDataBuilder rb_vfModuleServiceDataBuilder = vfModuleServiceDataBuilder;
-        VfModuleServiceDataBuilder rb_operDataBuilder = operDataBuilder;
-
         // 1610 Need to pull vnf-instance-list.vf-module-relationship-list from MD-SAL
         VnfInstanceServiceDataBuilder vnfInstanceServiceDataBuilder = new VnfInstanceServiceDataBuilder();
         getVnfInstanceServiceData(viid, vnfInstanceServiceDataBuilder);
@@ -1249,10 +1085,6 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         VnfInstanceServiceDataBuilder vnfInstanceOperDataBuilder = new VnfInstanceServiceDataBuilder();
         getVnfInstanceServiceData(viid, vnfInstanceOperDataBuilder, LogicalDatastoreType.OPERATIONAL);
 
-        // save operational builder object for rollback
-        VnfInstanceServiceDataBuilder rb_vnfInstanceServiceDataBuilder = vnfInstanceServiceDataBuilder;
-        VnfInstanceServiceDataBuilder rb_vnfInstanceOperDataBuilder = vnfInstanceOperDataBuilder;
-
         // Set the serviceStatus based on input
         setServiceStatus(serviceStatusBuilder, input.getSdncRequestHeader());
         setServiceStatus(serviceStatusBuilder, input.getRequestInformation());
@@ -1261,36 +1093,32 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // setup a service-data object builder
         // ACTION vnf-topology-operation
         // INPUT:
-        //  USES sdnc-request-header;
         //  USES request-information;
         //  USES service-information;
         //  USES vnf-request-information
         // OUTPUT:
-        //  USES vnf-topology-response-body;
         //  USES vnf-information
         //  USES service-information
         //
         // container service-data
-        //   uses vnf-configuration-information;
-        //   uses oper-status;
 
-        log.info(ADDING_INPUT_DATA_STR + SVC_OPERATION + " [" + vfid + INPUT_STR + input);
+        log.info(ADDING_INPUT_DATA_STR + svcOperation + " [" + vfid + INPUT_STR + input);
         VfModuleTopologyOperationInputBuilder inputBuilder = new VfModuleTopologyOperationInputBuilder(input);
         VnfSdnUtil.toProperties(parms, inputBuilder.build());
 
-        log.info(ADDING_OPERATIONAL_DATA_STR + SVC_OPERATION + " [" + vfid + "] vf-module operational-data: "
+        log.info(ADDING_OPERATIONAL_DATA_STR + svcOperation + " [" + vfid + "] vf-module operational-data: "
             + operDataBuilder.build());
         VnfSdnUtil.toProperties(parms, OPERATIONAL_DATA, operDataBuilder);
 
-        log.info(ADDING_CONFIG_DATA_STR + SVC_OPERATION + " [" + preloadName + "," + preloadType
+        log.info(ADDING_CONFIG_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType
             + "] vf-module-preload-data: " + vfModulePreloadDataBuilder.build());
         VnfSdnUtil.toProperties(parms, "vf-module-preload-data", vfModulePreloadDataBuilder);
 
-        log.info("Adding vnf-instance CONFIG data for " + SVC_OPERATION + " [" + viid + "] vnf-instance-service-data: "
+        log.info("Adding vnf-instance CONFIG data for " + svcOperation + " [" + viid + "] vnf-instance-service-data: "
             + vnfInstanceServiceDataBuilder.build());
         VnfSdnUtil.toProperties(parms, "vnf-instance-service-data", vnfInstanceServiceDataBuilder);
 
-        log.info("Adding vnf-instance OPERATIONAL data for " + SVC_OPERATION + " [" + viid
+        log.info("Adding vnf-instance OPERATIONAL data for " + svcOperation + " [" + viid
             + "] vnf-instance operational-data: " + vnfInstanceOperDataBuilder.build());
         VnfSdnUtil.toProperties(parms, "vnf-instance-operational-data", vnfInstanceOperDataBuilder);
 
@@ -1303,21 +1131,17 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String ackFinal = "Y";
 
         try {
-            if (svcLogicClient.hasGraph(VNF_API, SVC_OPERATION, null, "sync")) {
-
-                try {
-                    respProps = svcLogicClient
-                        .execute(VNF_API, SVC_OPERATION, null, "sync", vfModuleServiceDataBuilder, parms);
-                } catch (Exception e) {
-                    log.error("Caught exception executing service logic on vf-module for " + SVC_OPERATION, e);
-                    errorMessage = e.getMessage();
-                    errorCode = "500";
-                }
-
+            if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) {
+                respProps = svcLogicClient
+                    .execute(VNF_API, svcOperation, null, "sync", vfModuleServiceDataBuilder, parms);
             } else {
-                errorMessage = "No service logic active for VNF-API: '" + SVC_OPERATION + "'";
+                errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'";
                 errorCode = "503";
             }
+        } catch (SvcLogicException e) {
+            log.error("Caught exception executing service logic for " + svcOperation, e);
+            errorMessage = e.getMessage();
+            errorCode = "500";
         } catch (Exception e) {
             errorCode = "500";
             errorMessage = e.getMessage();
@@ -1334,7 +1158,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         serviceStatusBuilder.setRequestStatus(RequestStatus.Synccomplete);
         serviceStatusBuilder.setRpcName(RpcName.VfModuleTopologyOperation);
 
-        if (errorCode != null && errorCode.length() != 0 && !(errorCode.equals("0") || errorCode.equals("200"))) {
+        if (errorCode != null && errorCode.length() != 0 && !("0".equals(errorCode) || "200".equals(errorCode))) {
             responseBuilder.setResponseCode(errorCode);
             responseBuilder.setResponseMessage(errorMessage);
             responseBuilder.setAckFinalIndicator(ackFinal);
@@ -1344,9 +1168,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             try {
                 saveVfModuleList(vfModuleListBuilder.build(), true, LogicalDatastoreType.CONFIGURATION);
             } catch (Exception e) {
-                log.error(CAUGHT_EXCEPTION_STR + SVC_OPERATION + " [" + vfid + "] \n", e);
+                log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + vfid + "] \n", e);
             }
-            log.error(RETURNED_FAILED_STR + SVC_OPERATION + " [" + vfid + "] " + responseBuilder.build());
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + vfid + "] " + responseBuilder.build());
             RpcResult<VfModuleTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<VfModuleTopologyOperationOutput>status(true).withResult(responseBuilder.build())
                     .build();
@@ -1359,12 +1183,11 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         try {
             vfModuleServiceData = vfModuleServiceDataBuilder.build();
             log.info(
-                UPDATING_MD_SAL_STR + SVC_OPERATION + " [" + vfid + "] VfModuleServiceData: " + vfModuleServiceData);
+                UPDATING_MD_SAL_STR + svcOperation + " [" + vfid + "] VfModuleServiceData: " + vfModuleServiceData);
             // vf-module-list
             VfModuleListBuilder vfModuleListBuilder = new VfModuleListBuilder();
             vfModuleListBuilder.setVfModuleServiceData(vfModuleServiceData);
             vfModuleListBuilder.setVfModuleId(vfModuleServiceData.getVfModuleId());
-            //vfid = vfModuleServiceData.getVfModuleId();
             vfModuleListBuilder.setServiceStatus(serviceStatusBuilder.build());
             saveVfModuleList(vfModuleListBuilder.build(), false, LogicalDatastoreType.CONFIGURATION);
             if (input.getSdncRequestHeader() != null && input.getSdncRequestHeader().getSvcAction() != null) {
@@ -1380,11 +1203,11 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             responseBuilder.setVfModuleInformation(vfModuleInformationBuilder.build());
             responseBuilder.setServiceInformation(vfModuleServiceData.getServiceInformation());
         } catch (Exception e) {
-            log.error(CAUGHT_EXCEPTION_STR + SVC_OPERATION + " [" + vfid + "] \n", e);
+            log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + vfid + "] \n", e);
             responseBuilder.setResponseCode("500");
             responseBuilder.setResponseMessage(e.toString());
             responseBuilder.setAckFinalIndicator("Y");
-            log.error(RETURNED_FAILED_STR + SVC_OPERATION + " [" + vfid + "] " + responseBuilder.build());
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + vfid + "] " + responseBuilder.build());
             RpcResult<VfModuleTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<VfModuleTopologyOperationOutput>status(true).withResult(responseBuilder.build())
                     .build();
@@ -1398,8 +1221,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         if (errorMessage != null) {
             responseBuilder.setResponseMessage(errorMessage);
         }
-        log.info("Updated vf-module in MD-SAL for " + SVC_OPERATION + " [" + vfid + "] ");
-        log.info(RETURNED_SUCCESS_STR + SVC_OPERATION + " [" + vfid + "] " + responseBuilder.build());
+        log.info("Updated vf-module in MD-SAL for " + svcOperation + " [" + vfid + "] ");
+        log.info(RETURNED_SUCCESS_STR + svcOperation + " [" + vfid + "] " + responseBuilder.build());
 
         RpcResult<VfModuleTopologyOperationOutput> rpcResult =
             RpcResultBuilder.<VfModuleTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
@@ -1408,22 +1231,23 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
     }
 
     @Override
-    public Future<RpcResult<VnfTopologyOperationOutput>> vnfTopologyOperation(VnfTopologyOperationInput input) {
-        final String SVC_OPERATION = "vnf-topology-operation";
-        ServiceData serviceData = null;
+    public ListenableFuture<RpcResult<VnfTopologyOperationOutput>> vnfTopologyOperation(
+        VnfTopologyOperationInput input) {
+        final String svcOperation = "vnf-topology-operation";
+        ServiceData serviceData;
         ServiceStatusBuilder serviceStatusBuilder = new ServiceStatusBuilder();
         Properties parms = new Properties();
 
-        log.info(SVC_OPERATION + " called.");
+        log.info(svcOperation + CALLED_STR);
         // create a new response object
         VnfTopologyOperationOutputBuilder responseBuilder = new VnfTopologyOperationOutputBuilder();
 
         if (input == null || input.getServiceInformation() == null
             || input.getServiceInformation().getServiceInstanceId() == null
             || input.getServiceInformation().getServiceInstanceId().length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid input, null or empty service-instance-id");
+            log.debug(EXITING_STR + svcOperation + " because of invalid input, null or empty service-instance-id");
             responseBuilder.setResponseCode("403");
-            responseBuilder.setResponseMessage("invalid input, null or empty service-instance-id");
+            responseBuilder.setResponseMessage(INVALID_INPUT_NULL_OR_EMPTY_SERVICE_INSTANCE_ID);
             responseBuilder.setAckFinalIndicator("Y");
             RpcResult<VnfTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<VnfTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
@@ -1433,7 +1257,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
 
         if (input.getVnfRequestInformation() == null || input.getVnfRequestInformation().getVnfId() == null
             || input.getVnfRequestInformation().getVnfId().length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid input, null or empty vf-module-id");
+            log.debug(EXITING_STR + svcOperation + " because of invalid input, null or empty vf-module-id");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("invalid input, null or empty vf-module-id");
             responseBuilder.setAckFinalIndicator("Y");
@@ -1445,8 +1269,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
 
         // Grab the service instance ID from the input buffer
         String siid = input.getVnfRequestInformation().getVnfId();
-        String preload_name = input.getVnfRequestInformation().getVnfName();
-        String preload_type = input.getVnfRequestInformation().getVnfType();
+        String preloadName = input.getVnfRequestInformation().getVnfName();
+        String preloadType = input.getVnfRequestInformation().getVnfType();
 
         if (input.getSdncRequestHeader() != null) {
             responseBuilder.setSvcRequestId(input.getSdncRequestHeader().getSvcRequestId());
@@ -1454,7 +1278,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         PreloadDataBuilder preloadDataBuilder = new PreloadDataBuilder();
-        getPreloadData(preload_name, preload_type, preloadDataBuilder);
+        getPreloadData(preloadName, preloadType, preloadDataBuilder);
 
         ServiceDataBuilder serviceDataBuilder = new ServiceDataBuilder();
         getServiceData(siid, serviceDataBuilder);
@@ -1470,29 +1294,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // setup a service-data object builder
         // ACTION vnf-topology-operation
         // INPUT:
-        //  USES sdnc-request-header;
         //  USES request-information;
-        //  USES service-information;
         //  USES vnf-request-information
         // OUTPUT:
-        //  USES vnf-topology-response-body;
         //  USES vnf-information
         //  USES service-information
         //
         // container service-data
-        //   uses vnf-configuration-information;
         //   uses oper-status;
 
-        log.info("Adding INPUT data for " + SVC_OPERATION + " [" + siid + "] input: " + input);
+        log.info(ADDING_INPUT_DATA_STR + svcOperation + " [" + siid + INPUT_STR + input);
         VnfTopologyOperationInputBuilder inputBuilder = new VnfTopologyOperationInputBuilder(input);
         VnfSdnUtil.toProperties(parms, inputBuilder.build());
 
-        log.info("Adding OPERATIONAL data for " + SVC_OPERATION + " [" + siid + "] operational-data: " + operDataBuilder
+        log.info(ADDING_OPERATIONAL_DATA_STR + svcOperation + " [" + siid + OPERATIONAL_DATA_STR + operDataBuilder
             .build());
-        VnfSdnUtil.toProperties(parms, "operational-data", operDataBuilder);
+        VnfSdnUtil.toProperties(parms, OPERATIONAL_DATA, operDataBuilder);
 
         log.info(
-            "Adding CONFIG data for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] preload-data: "
+            "Adding CONFIG data for " + svcOperation + " [" + preloadName + "," + preloadType + "] preload-data: "
                 + preloadDataBuilder.build());
         VnfSdnUtil.toProperties(parms, "preload-data", preloadDataBuilder);
 
@@ -1504,20 +1324,16 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String ackFinal = "Y";
 
         try {
-            if (svcLogicClient.hasGraph("VNF-API", SVC_OPERATION, null, "sync")) {
-
-                try {
-                    respProps =
-                        svcLogicClient.execute("VNF-API", SVC_OPERATION, null, "sync", serviceDataBuilder, parms);
-                } catch (Exception e) {
-                    log.error("Caught exception executing service logic for " + SVC_OPERATION, e);
-                    errorMessage = e.getMessage();
-                    errorCode = "500";
-                }
+            if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) {
+                respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", serviceDataBuilder, parms);
             } else {
-                errorMessage = "No service logic active for VNF-API: '" + SVC_OPERATION + "'";
+                errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'";
                 errorCode = "503";
             }
+        } catch (SvcLogicException e) {
+            log.error("Caught exception executing service logic for " + siid, e);
+            errorMessage = e.getMessage();
+            errorCode = "500";
         } catch (Exception e) {
             errorCode = "500";
             errorMessage = e.getMessage();
@@ -1534,7 +1350,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         serviceStatusBuilder.setRequestStatus(RequestStatus.Synccomplete);
         serviceStatusBuilder.setRpcName(RpcName.VnfTopologyOperation);
 
-        if (errorCode != null && errorCode.length() != 0 && !(errorCode.equals("0") || errorCode.equals("200"))) {
+        if (errorCode != null && errorCode.length() != 0 && !("0".equals(errorCode) || "200".equals(errorCode))) {
             responseBuilder.setResponseCode(errorCode);
             responseBuilder.setResponseMessage(errorMessage);
             responseBuilder.setAckFinalIndicator(ackFinal);
@@ -1544,9 +1360,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             try {
                 saveVnfList(vnfListBuilder.build(), true, LogicalDatastoreType.CONFIGURATION);
             } catch (Exception e) {
-                log.error("Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + siid + "] \n", e);
+                log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + siid + "] \n", e);
             }
-            log.error("Returned FAILED for " + SVC_OPERATION + " [" + siid + "] " + responseBuilder.build());
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + siid + "] " + responseBuilder.build());
             RpcResult<VnfTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<VnfTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
             // return error
@@ -1556,7 +1372,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         // Got success from SLI
         try {
             serviceData = serviceDataBuilder.build();
-            log.info("Updating MD-SAL for " + SVC_OPERATION + " [" + siid + "] ServiceData: " + serviceData);
+            log.info(UPDATING_MD_SAL_STR + svcOperation + " [" + siid + "] ServiceData: " + serviceData);
             // svc-configuration-list
             VnfListBuilder vnfListBuilder = new VnfListBuilder();
             vnfListBuilder.setServiceData(serviceData);
@@ -1567,7 +1383,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             if (input.getSdncRequestHeader() != null && input.getSdncRequestHeader().getSvcAction() != null) {
                 // Only update operational tree on Delete or Activate
                 if (input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Activate)) {
-                    log.info("Updating OPERATIONAL tree.");
+                    log.info(UPDATING_OPERATIONAL_TREE_STR);
                     saveVnfList(vnfListBuilder.build(), false, LogicalDatastoreType.OPERATIONAL);
                 } else if (input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Delete) || input
                     .getSdncRequestHeader().getSvcAction().equals(SvcAction.Rollback)) {
@@ -1581,11 +1397,11 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             responseBuilder.setVnfInformation(vnfInformationBuilder.build());
             responseBuilder.setServiceInformation(serviceData.getServiceInformation());
         } catch (Exception e) {
-            log.error("Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + siid + "] \n", e);
+            log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + siid + "] \n", e);
             responseBuilder.setResponseCode("500");
             responseBuilder.setResponseMessage(e.toString());
             responseBuilder.setAckFinalIndicator("Y");
-            log.error("Returned FAILED for " + SVC_OPERATION + " [" + siid + "] " + responseBuilder.build());
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + siid + "] " + responseBuilder.build());
             RpcResult<VnfTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<VnfTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
             // return error
@@ -1598,8 +1414,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         if (errorMessage != null) {
             responseBuilder.setResponseMessage(errorMessage);
         }
-        log.info("Updated MD-SAL for " + SVC_OPERATION + " [" + siid + "] ");
-        log.info("Returned SUCCESS for " + SVC_OPERATION + " [" + siid + "] " + responseBuilder.build());
+        log.info(UPDATED_MD_SAL_STR + svcOperation + " [" + siid + "] ");
+        log.info(RETURNED_SUCCESS_STR + svcOperation + " [" + siid + "] " + responseBuilder.build());
 
         RpcResult<VnfTopologyOperationOutput> rpcResult =
             RpcResultBuilder.<VnfTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
@@ -1607,24 +1423,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         return Futures.immediateFuture(rpcResult);
     }
 
-    @Override public Future<RpcResult<NetworkTopologyOperationOutput>> networkTopologyOperation(
+    @Override
+    public ListenableFuture<RpcResult<NetworkTopologyOperationOutput>> networkTopologyOperation(
         NetworkTopologyOperationInput input) {
 
-        final String SVC_OPERATION = "network-topology-operation";
-        ServiceData serviceData = null;
+        final String svcOperation = "network-topology-operation";
+        ServiceData serviceData;
         ServiceStatusBuilder serviceStatusBuilder = new ServiceStatusBuilder();
         Properties parms = new Properties();
 
-        log.info(SVC_OPERATION + " called.");
+        log.info(svcOperation + CALLED_STR);
         // create a new response object
         NetworkTopologyOperationOutputBuilder responseBuilder = new NetworkTopologyOperationOutputBuilder();
 
         if (input == null || input.getServiceInformation() == null
             || input.getServiceInformation().getServiceInstanceId() == null
             || input.getServiceInformation().getServiceInstanceId().length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid input, null or empty service-instance-id");
+            log.debug(EXITING_STR + svcOperation + " because of invalid input, null or empty service-instance-id");
             responseBuilder.setResponseCode("403");
-            responseBuilder.setResponseMessage("invalid input, null or empty service-instance-id");
+            responseBuilder.setResponseMessage(INVALID_INPUT_NULL_OR_EMPTY_SERVICE_INSTANCE_ID);
             responseBuilder.setAckFinalIndicator("Y");
             RpcResult<NetworkTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<NetworkTopologyOperationOutput>status(true).withResult(responseBuilder.build())
@@ -1635,9 +1452,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
 
         if (input.getNetworkRequestInformation() == null
             || input.getNetworkRequestInformation().getNetworkName() == null) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid input, null or empty service-instance-id");
+            log.debug(EXITING_STR + svcOperation + " because of invalid input, null or empty service-instance-id");
             responseBuilder.setResponseCode("403");
-            responseBuilder.setResponseMessage("invalid input, null or empty service-instance-id");
+            responseBuilder.setResponseMessage(INVALID_INPUT_NULL_OR_EMPTY_SERVICE_INSTANCE_ID);
             responseBuilder.setAckFinalIndicator("Y");
             RpcResult<NetworkTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<NetworkTopologyOperationOutput>status(true).withResult(responseBuilder.build())
@@ -1647,14 +1464,14 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         // Grab the service instance ID from the input buffer
-        String siid = null;
+        String siid;
         if (input.getSdncRequestHeader().getSvcAction().equals(SvcAction.Assign)) {
             siid = input.getNetworkRequestInformation().getNetworkName();
         } else {
             siid = input.getNetworkRequestInformation().getNetworkId();
         }
-        String preload_name = input.getNetworkRequestInformation().getNetworkName();
-        String preload_type = input.getNetworkRequestInformation().getNetworkType();
+        String preloadName = input.getNetworkRequestInformation().getNetworkName();
+        String preloadType = input.getNetworkRequestInformation().getNetworkType();
 
         if (input.getSdncRequestHeader() != null) {
             responseBuilder.setSvcRequestId(input.getSdncRequestHeader().getSvcRequestId());
@@ -1662,9 +1479,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         PreloadDataBuilder preloadDataBuilder = new PreloadDataBuilder();
-        getPreloadData(preload_name, preload_type, preloadDataBuilder);
+        getPreloadData(preloadName, preloadType, preloadDataBuilder);
 
-        log.info("Adding INPUT data for " + SVC_OPERATION + " [" + siid + "] input: " + input);
+        log.info(ADDING_INPUT_DATA_STR + svcOperation + " [" + siid + INPUT_STR + input);
         NetworkTopologyOperationInputBuilder inputBuilder = new NetworkTopologyOperationInputBuilder(input);
         VnfSdnUtil.toProperties(parms, inputBuilder.build());
 
@@ -1677,20 +1494,16 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String networkId = "error";
 
         try {
-            if (svcLogicClient.hasGraph("VNF-API", SVC_OPERATION, null, "sync")) {
-
-                try {
-                    respProps =
-                        svcLogicClient.execute("VNF-API", SVC_OPERATION, null, "sync", preloadDataBuilder, parms);
-                } catch (Exception e) {
-                    log.error("Caught exception executing service logic for " + SVC_OPERATION, e);
-                    errorMessage = e.getMessage();
-                    errorCode = "500";
-                }
+            if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) {
+                respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", preloadDataBuilder, parms);
             } else {
-                errorMessage = "No service logic active for VNF-API: '" + SVC_OPERATION + "'";
+                errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'";
                 errorCode = "503";
             }
+        } catch (SvcLogicException e) {
+            log.error("Caught exception executing service logic for " + svcOperation, e);
+            errorMessage = e.getMessage();
+            errorCode = "500";
         } catch (Exception e) {
             errorCode = "500";
             errorMessage = e.getMessage();
@@ -1704,12 +1517,12 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             networkId = respProps.getProperty("networkId", "0");
         }
 
-        if (errorCode != null && errorCode.length() != 0 && !(errorCode.equals("0") || errorCode.equals("200"))) {
+        if (errorCode != null && errorCode.length() != 0 && !("0".equals(errorCode) || "200".equals(errorCode))) {
             responseBuilder.setResponseCode(errorCode);
             responseBuilder.setResponseMessage(errorMessage);
             responseBuilder.setAckFinalIndicator(ackFinal);
 
-            log.error("Returned FAILED for " + SVC_OPERATION + " [" + siid + "] " + responseBuilder.build());
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + siid + "] " + responseBuilder.build());
 
             RpcResult<NetworkTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<NetworkTopologyOperationOutput>status(true).withResult(responseBuilder.build())
@@ -1725,11 +1538,11 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             responseBuilder.setNetworkInformation(networkInformationBuilder.build());
             responseBuilder.setServiceInformation(input.getServiceInformation());
         } catch (IllegalStateException e) {
-            log.error("Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + siid + "] \n", e);
+            log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + siid + "] \n", e);
             responseBuilder.setResponseCode("500");
             responseBuilder.setResponseMessage(e.toString());
             responseBuilder.setAckFinalIndicator("Y");
-            log.error("Returned FAILED for " + SVC_OPERATION + " [" + siid + "] " + responseBuilder.build());
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + siid + "] " + responseBuilder.build());
             RpcResult<NetworkTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<NetworkTopologyOperationOutput>status(true).withResult(responseBuilder.build())
                     .build();
@@ -1743,8 +1556,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         if (errorMessage != null) {
             responseBuilder.setResponseMessage(errorMessage);
         }
-        log.info("Updated MD-SAL for " + SVC_OPERATION + " [" + siid + "] ");
-        log.info("Returned SUCCESS for " + SVC_OPERATION + " [" + siid + "] " + responseBuilder.build());
+        log.info(UPDATED_MD_SAL_STR + svcOperation + " [" + siid + "] ");
+        log.info(RETURNED_SUCCESS_STR + svcOperation + " [" + siid + "] " + responseBuilder.build());
 
         RpcResult<NetworkTopologyOperationOutput> rpcResult =
             RpcResultBuilder.<NetworkTopologyOperationOutput>status(true).withResult(responseBuilder.build()).build();
@@ -1752,25 +1565,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         return Futures.immediateFuture(rpcResult);
     }
 
-    @Override public Future<RpcResult<PreloadVnfTopologyOperationOutput>> preloadVnfTopologyOperation(
+    @Override
+    public ListenableFuture<RpcResult<PreloadVnfTopologyOperationOutput>> preloadVnfTopologyOperation(
         PreloadVnfTopologyOperationInput input) {
 
-        final String SVC_OPERATION = "preload-vnf-topology-operation";
-        PreloadData preloadData = null;
+        final String svcOperation = "preload-vnf-topology-operation";
+        PreloadData preloadData;
         Properties parms = new Properties();
 
-        log.info(SVC_OPERATION + " called.");
+        log.info(svcOperation + CALLED_STR);
         // create a new response object
         PreloadVnfTopologyOperationOutputBuilder responseBuilder = new PreloadVnfTopologyOperationOutputBuilder();
 
         // Result from savePreloadData
-        final SettableFuture<RpcResult<Void>> futureResult = SettableFuture.create();
 
         if (input == null || input.getVnfTopologyInformation() == null
             || input.getVnfTopologyInformation().getVnfTopologyIdentifier() == null
             || input.getVnfTopologyInformation().getVnfTopologyIdentifier().getVnfName() == null
             || input.getVnfTopologyInformation().getVnfTopologyIdentifier().getVnfType() == null) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid input, null or empty vnf-name or vnf-type");
+            log.debug(EXITING_STR + svcOperation + " because of invalid input, null or empty vnf-name or vnf-type");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("invalid input, null or empty vnf-name or vnf-type");
             responseBuilder.setAckFinalIndicator("Y");
@@ -1781,24 +1594,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         // Grab the name and type from the input buffer
-        String preload_name = input.getVnfTopologyInformation().getVnfTopologyIdentifier().getVnfName();
-        String preload_type = input.getVnfTopologyInformation().getVnfTopologyIdentifier().getVnfType();
+        String preloadName = input.getVnfTopologyInformation().getVnfTopologyIdentifier().getVnfName();
+        String preloadType = input.getVnfTopologyInformation().getVnfTopologyIdentifier().getVnfType();
 
         // Make sure we have a preload_name and preload_type
-        if (preload_name == null || preload_name.length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid preload-name");
+        if (preloadName == null || preloadName.length() == 0) {
+            log.debug(EXITING_STR + svcOperation + " because of invalid preload-name");
             responseBuilder.setResponseCode("403");
-            responseBuilder.setResponseMessage("invalid input, invalid preload-name");
+            responseBuilder.setResponseMessage(INVALID_INPUT_INVALID_PRELOAD_TYPE);
             responseBuilder.setAckFinalIndicator("Y");
             RpcResult<PreloadVnfTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadVnfTopologyOperationOutput>status(true).withResult(responseBuilder.build())
                     .build();
             return Futures.immediateFuture(rpcResult);
         }
-        if (preload_type == null || preload_type.length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid preload-type");
+
+        if (preloadType == null || preloadType.length() == 0) {
+            log.debug(EXITING_STR + svcOperation + " because of invalid preload-type");
             responseBuilder.setResponseCode("403");
-            responseBuilder.setResponseMessage("invalid input, invalid preload-type");
+            responseBuilder.setResponseMessage(INVALID_INPUT_INVALID_PRELOAD_TYPE);
             responseBuilder.setAckFinalIndicator("Y");
             RpcResult<PreloadVnfTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadVnfTopologyOperationOutput>status(true).withResult(responseBuilder.build())
@@ -1812,31 +1626,26 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         PreloadDataBuilder preloadDataBuilder = new PreloadDataBuilder();
-        getPreloadData(preload_name, preload_type, preloadDataBuilder);
-        //preloadData = preloadDataBuilder.build();
-
+        getPreloadData(preloadName, preloadType, preloadDataBuilder);
         PreloadDataBuilder operDataBuilder = new PreloadDataBuilder();
-        getPreloadData(preload_name, preload_type, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
+        getPreloadData(preloadName, preloadType, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
 
         //
         // setup a preload-data object builder
         // ACTION vnf-topology-operation
         // INPUT:
-        //  USES sdnc-request-header;
         //  USES request-information;
         //  uses vnf-topology-information;
         // OUTPUT:
-        //  USES vnf-topology-response-body;
         //
         // container preload-data
-        //   uses vnf-configuration-information;
         log.info(
-            "Adding INPUT data for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] input: " + input);
+            ADDING_INPUT_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType + INPUT_STR + input);
         PreloadVnfTopologyOperationInputBuilder inputBuilder = new PreloadVnfTopologyOperationInputBuilder(input);
         VnfSdnUtil.toProperties(parms, inputBuilder.build());
-        log.info("Adding OPERATIONAL data for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
-            + "] operational-data: " + operDataBuilder.build());
-        VnfSdnUtil.toProperties(parms, "operational-data", operDataBuilder);
+        log.info(ADDING_OPERATIONAL_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType
+            + OPERATIONAL_DATA_STR + operDataBuilder.build());
+        VnfSdnUtil.toProperties(parms, OPERATIONAL_DATA, operDataBuilder);
 
         // Call SLI sync method
         // Get SvcLogicService reference
@@ -1846,20 +1655,16 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String ackFinal = "Y";
 
         try {
-            if (svcLogicClient.hasGraph("VNF-API", SVC_OPERATION, null, "sync")) {
-
-                try {
-                    respProps =
-                        svcLogicClient.execute("VNF-API", SVC_OPERATION, null, "sync", preloadDataBuilder, parms);
-                } catch (Exception e) {
-                    log.error("Caught exception executing service logic for " + SVC_OPERATION, e);
-                    errorMessage = e.getMessage();
-                    errorCode = "500";
-                }
+            if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) {
+                respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", preloadDataBuilder, parms);
             } else {
-                errorMessage = "No service logic active for VNF-API: '" + SVC_OPERATION + "'";
+                errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'";
                 errorCode = "503";
             }
+        } catch (SvcLogicException e) {
+            log.error("Caught exception executing service logic for " + svcOperation, e);
+            errorMessage = e.getMessage();
+            errorCode = "500";
         } catch (Exception e) {
             errorCode = "500";
             errorMessage = e.getMessage();
@@ -1870,30 +1675,29 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             errorCode = respProps.getProperty("error-code");
             errorMessage = respProps.getProperty("error-message");
             ackFinal = respProps.getProperty("ack-final", "Y");
-            // internalError = respProps.getProperty("internal-error", "false");
         }
 
-        if (errorCode != null && errorCode.length() != 0 && !(errorCode.equals("0") || errorCode.equals("200"))) {
+        if (errorCode != null && errorCode.length() != 0 && !("0".equals(errorCode) || "200".equals(errorCode))) {
 
             responseBuilder.setResponseCode(errorCode);
             responseBuilder.setResponseMessage(errorMessage);
             responseBuilder.setAckFinalIndicator(ackFinal);
 
             VnfPreloadListBuilder preloadVnfListBuilder = new VnfPreloadListBuilder();
-            preloadVnfListBuilder.setVnfName(preload_name);
-            preloadVnfListBuilder.setVnfType(preload_type);
+            preloadVnfListBuilder.setVnfName(preloadName);
+            preloadVnfListBuilder.setVnfType(preloadType);
             preloadVnfListBuilder.setPreloadData(preloadDataBuilder.build());
             log.error(
-                "Returned FAILED for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] error code: '"
+                RETURNED_FAILED_STR + svcOperation + " [" + preloadName + "," + preloadType + "] error code: '"
                     + errorCode + "', Reason: '" + errorMessage + "'");
             try {
                 savePreloadList(preloadVnfListBuilder.build(), true, LogicalDatastoreType.CONFIGURATION);
             } catch (Exception e) {
                 log.error(
-                    "Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
+                    CAUGHT_EXCEPTION_STR + svcOperation + " [" + preloadName + "," + preloadType
                         + "] \n", e);
             }
-            log.debug("Sending Success rpc result due to external error");
+            log.debug(SENDING_SUCCESS_RPC);
             RpcResult<PreloadVnfTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadVnfTopologyOperationOutput>status(true).withResult(responseBuilder.build())
                     .build();
@@ -1904,25 +1708,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         try {
             preloadData = preloadDataBuilder.build();
             log.info(
-                "Updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] preloadData: "
+                UPDATING_MD_SAL_STR + svcOperation + " [" + preloadName + "," + preloadType + "] preloadData: "
                     + preloadData);
             // svc-configuration-list
             VnfPreloadListBuilder preloadVnfListBuilder = new VnfPreloadListBuilder();
-            preloadVnfListBuilder.setVnfName(preload_name);
-            preloadVnfListBuilder.setVnfType(preload_type);
+            preloadVnfListBuilder.setVnfName(preloadName);
+            preloadVnfListBuilder.setVnfType(preloadType);
             preloadVnfListBuilder.setPreloadData(preloadData);
 
             // SDNGC-989 set merge flag to false
             savePreloadList(preloadVnfListBuilder.build(), false, LogicalDatastoreType.CONFIGURATION);
-            log.info("Updating OPERATIONAL tree.");
+            log.info(UPDATING_OPERATIONAL_TREE_STR);
             savePreloadList(preloadVnfListBuilder.build(), false, LogicalDatastoreType.OPERATIONAL);
         } catch (Exception e) {
-            log.error("Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
+            log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + preloadName + "," + preloadType
                 + "] \n", e);
             responseBuilder.setResponseCode("500");
             responseBuilder.setResponseMessage(e.toString());
             responseBuilder.setAckFinalIndicator("Y");
-            log.error("Returned FAILED for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] "
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + preloadName + "," + preloadType + "] "
                 + responseBuilder.build());
             RpcResult<PreloadVnfTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadVnfTopologyOperationOutput>status(false).withResult(responseBuilder.build())
@@ -1936,9 +1740,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         if (errorMessage != null) {
             responseBuilder.setResponseMessage(errorMessage);
         }
-        log.info("Updated MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] ");
+        log.info(UPDATED_MD_SAL_STR + svcOperation + " [" + preloadName + "," + preloadType + "] ");
         log.info(
-            "Returned SUCCESS for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] " + responseBuilder
+            RETURNED_SUCCESS_STR + svcOperation + " [" + preloadName + "," + preloadType + "] " + responseBuilder
                 .build());
 
         RpcResult<PreloadVnfTopologyOperationOutput> rpcResult =
@@ -1948,25 +1752,23 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
     }
 
     //1610 preload-vnf-instance-topology-operation
-    @Override public Future<RpcResult<PreloadVnfInstanceTopologyOperationOutput>> preloadVnfInstanceTopologyOperation(
+    @Override
+    public ListenableFuture<RpcResult<PreloadVnfInstanceTopologyOperationOutput>> preloadVnfInstanceTopologyOperation(
         PreloadVnfInstanceTopologyOperationInput input) {
 
-        final String SVC_OPERATION = "preload-vnf-instance-topology-operation";
-        VnfInstancePreloadData vnfInstancePreloadData = null;
+        final String svcOperation = "preload-vnf-instance-topology-operation";
+        VnfInstancePreloadData vnfInstancePreloadData;
         Properties parms = new Properties();
 
-        log.info(SVC_OPERATION + " called.");
+        log.info(svcOperation + CALLED_STR);
         // create a new response object
         PreloadVnfInstanceTopologyOperationOutputBuilder responseBuilder =
             new PreloadVnfInstanceTopologyOperationOutputBuilder();
 
-        // Result from savePreloadData
-        final SettableFuture<RpcResult<Void>> futureResult = SettableFuture.create();
-
         if (input == null || input.getVnfInstanceTopologyInformation() == null
             || input.getVnfInstanceTopologyInformation().getVnfInstanceIdentifiers().getVnfInstanceName() == null
             || input.getVnfInstanceTopologyInformation().getVnfInstanceIdentifiers().getVnfModelId() == null) {
-            log.debug("exiting " + SVC_OPERATION
+            log.debug(EXITING_STR + svcOperation
                 + " because of invalid input, null or empty vnf-instance-name or vnf-model-id");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("invalid input, null or empty vnf-instance-name or vnf-model-id");
@@ -1978,13 +1780,13 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         // Grab the name and type from the input buffer
-        String preload_name =
+        String preloadName =
             input.getVnfInstanceTopologyInformation().getVnfInstanceIdentifiers().getVnfInstanceName();
-        String preload_type = input.getVnfInstanceTopologyInformation().getVnfInstanceIdentifiers().getVnfModelId();
+        String preloadType = input.getVnfInstanceTopologyInformation().getVnfInstanceIdentifiers().getVnfModelId();
 
-        // Make sure we have a preload_name and preload_type
-        if (preload_name == null || preload_name.length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid preload-name");
+        // Make sure we have a preloadName and preloadType
+        if (preloadName == null || preloadName.length() == 0) {
+            log.debug(EXITING_STR + svcOperation + " because of invalid preload-name");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("invalid input, invalid preload-name");
             responseBuilder.setAckFinalIndicator("Y");
@@ -1993,8 +1795,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
                     .withResult(responseBuilder.build()).build();
             return Futures.immediateFuture(rpcResult);
         }
-        if (preload_type == null || preload_type.length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid preload-type");
+
+        if (preloadType == null || preloadType.length() == 0) {
+            log.debug(EXITING_STR + svcOperation + " because of invalid preload-type");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("invalid input, invalid preload-type");
             responseBuilder.setAckFinalIndicator("Y");
@@ -2010,32 +1813,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         VnfInstancePreloadDataBuilder vnfInstancePreloadDataBuilder = new VnfInstancePreloadDataBuilder();
-        getVnfInstancePreloadData(preload_name, preload_type, vnfInstancePreloadDataBuilder);
-        //preloadData = preloadDataBuilder.build();
-
+        getVnfInstancePreloadData(preloadName, preloadType, vnfInstancePreloadDataBuilder);
         VnfInstancePreloadDataBuilder operDataBuilder = new VnfInstancePreloadDataBuilder();
-        getVnfInstancePreloadData(preload_name, preload_type, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
+        getVnfInstancePreloadData(preloadName, preloadType, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
 
         //
         // setup a preload-data object builder
         // ACTION vnf-topology-operation
         // INPUT:
-        //  USES sdnc-request-header;
-        //  USES request-information;
         //  uses vnf-topology-information;
         // OUTPUT:
-        //  USES vnf-topology-response-body;
-        //
         // container preload-data
-        //   uses vnf-configuration-information;
         log.info(
-            "Adding INPUT data for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] input: " + input);
+            ADDING_CONFIG_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType + INPUT_STR + input);
         PreloadVnfInstanceTopologyOperationInputBuilder inputBuilder =
             new PreloadVnfInstanceTopologyOperationInputBuilder(input);
         VnfSdnUtil.toProperties(parms, inputBuilder.build());
-        log.info("Adding OPERATIONAL data for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
-            + "] operational-data: " + operDataBuilder.build());
-        VnfSdnUtil.toProperties(parms, "operational-data", operDataBuilder);
+        log.info(ADDING_OPERATIONAL_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType
+            + OPERATIONAL_DATA_STR + operDataBuilder.build());
+        VnfSdnUtil.toProperties(parms, OPERATIONAL_DATA, operDataBuilder);
 
         // Call SLI sync method
         // Get SvcLogicService reference
@@ -2045,20 +1841,17 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String ackFinal = "Y";
 
         try {
-            if (svcLogicClient.hasGraph("VNF-API", SVC_OPERATION, null, "sync")) {
-
-                try {
-                    respProps = svcLogicClient
-                        .execute("VNF-API", SVC_OPERATION, null, "sync", vnfInstancePreloadDataBuilder, parms);
-                } catch (Exception e) {
-                    log.error("Caught exception executing service logic for " + SVC_OPERATION, e);
-                    errorMessage = e.getMessage();
-                    errorCode = "500";
-                }
+            if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) {
+                respProps = svcLogicClient
+                    .execute(VNF_API, svcOperation, null, "sync", vnfInstancePreloadDataBuilder, parms);
             } else {
-                errorMessage = "No service logic active for VNF-API: '" + SVC_OPERATION + "'";
+                errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'";
                 errorCode = "503";
             }
+        } catch (SvcLogicException e) {
+            log.error("Caught exception executing service logic for " + svcOperation, e);
+            errorMessage = e.getMessage();
+            errorCode = "500";
         } catch (Exception e) {
             errorCode = "500";
             errorMessage = e.getMessage();
@@ -2069,31 +1862,30 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             errorCode = respProps.getProperty("error-code");
             errorMessage = respProps.getProperty("error-message");
             ackFinal = respProps.getProperty("ack-final", "Y");
-            // internalError = respProps.getProperty("internal-error", "false");
         }
 
-        if (errorCode != null && errorCode.length() != 0 && !(errorCode.equals("0") || errorCode.equals("200"))) {
+        if (errorCode != null && errorCode.length() != 0 && !("0".equals(errorCode) || "200".equals(errorCode))) {
 
             responseBuilder.setResponseCode(errorCode);
             responseBuilder.setResponseMessage(errorMessage);
             responseBuilder.setAckFinalIndicator(ackFinal);
 
             VnfInstancePreloadListBuilder vnfInstancePreloadListBuilder = new VnfInstancePreloadListBuilder();
-            vnfInstancePreloadListBuilder.setVnfInstanceName(preload_name);
-            vnfInstancePreloadListBuilder.setVnfModelId(preload_type);
+            vnfInstancePreloadListBuilder.setVnfInstanceName(preloadName);
+            vnfInstancePreloadListBuilder.setVnfModelId(preloadType);
             vnfInstancePreloadListBuilder.setVnfInstancePreloadData(vnfInstancePreloadDataBuilder.build());
             log.error(
-                "Returned FAILED for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] error code: '"
+                RETURNED_FAILED_STR + svcOperation + " [" + preloadName + "," + preloadType + "] error code: '"
                     + errorCode + "', Reason: '" + errorMessage + "'");
             try {
                 saveVnfInstancePreloadList(vnfInstancePreloadListBuilder.build(), true,
                     LogicalDatastoreType.CONFIGURATION);
             } catch (Exception e) {
                 log.error(
-                    "Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
+                    CAUGHT_EXCEPTION_STR + svcOperation + " [" + preloadName + "," + preloadType
                         + "] \n", e);
             }
-            log.debug("Sending Success rpc result due to external error");
+            log.debug(SENDING_SUCCESS_RPC);
             RpcResult<PreloadVnfInstanceTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadVnfInstanceTopologyOperationOutput>status(true)
                     .withResult(responseBuilder.build()).build();
@@ -2104,26 +1896,26 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         try {
             vnfInstancePreloadData = vnfInstancePreloadDataBuilder.build();
             log.info(
-                "Updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] preloadData: "
+                UPDATING_MD_SAL_STR + svcOperation + " [" + preloadName + "," + preloadType + "] preloadData: "
                     + vnfInstancePreloadData);
             // svc-configuration-list
             VnfInstancePreloadListBuilder vnfInstancePreloadListBuilder = new VnfInstancePreloadListBuilder();
-            vnfInstancePreloadListBuilder.setVnfInstanceName(preload_name);
-            vnfInstancePreloadListBuilder.setVnfModelId(preload_type);
+            vnfInstancePreloadListBuilder.setVnfInstanceName(preloadName);
+            vnfInstancePreloadListBuilder.setVnfModelId(preloadType);
             vnfInstancePreloadListBuilder.setVnfInstancePreloadData(vnfInstancePreloadData);
 
             // SDNGC-989 set merge flag to false
             saveVnfInstancePreloadList(vnfInstancePreloadListBuilder.build(), false,
                 LogicalDatastoreType.CONFIGURATION);
-            log.info("Updating OPERATIONAL tree.");
+            log.info(UPDATING_OPERATIONAL_TREE_STR);
             saveVnfInstancePreloadList(vnfInstancePreloadListBuilder.build(), false, LogicalDatastoreType.OPERATIONAL);
         } catch (Exception e) {
-            log.error("Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
+            log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + preloadName + "," + preloadType
                 + "] \n", e);
             responseBuilder.setResponseCode("500");
             responseBuilder.setResponseMessage(e.toString());
             responseBuilder.setAckFinalIndicator("Y");
-            log.error("Returned FAILED for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] "
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + preloadName + "," + preloadType + "] "
                 + responseBuilder.build());
             RpcResult<PreloadVnfInstanceTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadVnfInstanceTopologyOperationOutput>status(false)
@@ -2137,9 +1929,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         if (errorMessage != null) {
             responseBuilder.setResponseMessage(errorMessage);
         }
-        log.info("Updated MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] ");
+        log.info(UPDATED_MD_SAL_STR + svcOperation + " [" + preloadName + "," + preloadType + "] ");
         log.info(
-            "Returned SUCCESS for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] " + responseBuilder
+            RETURNED_SUCCESS_STR + svcOperation + " [" + preloadName + "," + preloadType + "] " + responseBuilder
                 .build());
 
         RpcResult<PreloadVnfInstanceTopologyOperationOutput> rpcResult =
@@ -2150,25 +1942,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
 
 
     //1610 preload-vf-module-topology-operation
-    @Override public Future<RpcResult<PreloadVfModuleTopologyOperationOutput>> preloadVfModuleTopologyOperation(
+    @Override
+    public ListenableFuture<RpcResult<PreloadVfModuleTopologyOperationOutput>> preloadVfModuleTopologyOperation(
         PreloadVfModuleTopologyOperationInput input) {
 
-        final String SVC_OPERATION = "preload-vf-module-topology-operation";
-        VfModulePreloadData vfModulePreloadData = null;
+        final String svcOperation = "preload-vf-module-topology-operation";
+        VfModulePreloadData vfModulePreloadData;
         Properties parms = new Properties();
 
-        log.info(SVC_OPERATION + " called.");
+        log.info(svcOperation + CALLED_STR);
         // create a new response object
         PreloadVfModuleTopologyOperationOutputBuilder responseBuilder =
             new PreloadVfModuleTopologyOperationOutputBuilder();
 
         // Result from savePreloadData
-        final SettableFuture<RpcResult<Void>> futureResult = SettableFuture.create();
 
         if (input == null || input.getVfModuleTopologyInformation() == null
             || input.getVfModuleTopologyInformation().getVfModuleIdentifiers().getVfModuleName() == null
             || input.getVfModuleTopologyInformation().getVfModuleIdentifiers().getVfModuleModelId() == null) {
-            log.debug("exiting " + SVC_OPERATION
+            log.debug(EXITING_STR + svcOperation
                 + " because of invalid input, null or empty vf-module-name or vf-module-model-id");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("invalid input, null or empty vf-module-name or vf-module-model-id");
@@ -2180,12 +1972,12 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         // Grab the name and type from the input buffer
-        String preload_name = input.getVfModuleTopologyInformation().getVfModuleIdentifiers().getVfModuleName();
-        String preload_type = input.getVfModuleTopologyInformation().getVfModuleIdentifiers().getVfModuleModelId();
+        String preloadName = input.getVfModuleTopologyInformation().getVfModuleIdentifiers().getVfModuleName();
+        String preloadType = input.getVfModuleTopologyInformation().getVfModuleIdentifiers().getVfModuleModelId();
 
-        // Make sure we have a preload_name and preload_type
-        if (preload_name == null || preload_name.length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid preload-name");
+        // Make sure we have a preloadName and preloadType
+        if (preloadName == null || preloadName.length() == 0) {
+            log.debug(EXITING_STR + svcOperation + " because of invalid preload-name");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("invalid input, invalid preload-name");
             responseBuilder.setAckFinalIndicator("Y");
@@ -2194,8 +1986,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
                     .withResult(responseBuilder.build()).build();
             return Futures.immediateFuture(rpcResult);
         }
-        if (preload_type == null || preload_type.length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid preload-type");
+        if (preloadType == null || preloadType.length() == 0) {
+            log.debug(EXITING_STR + svcOperation + " because of invalid preload-type");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("invalid input, invalid preload-type");
             responseBuilder.setAckFinalIndicator("Y");
@@ -2211,33 +2003,28 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         VfModulePreloadDataBuilder vfModulePreloadDataBuilder = new VfModulePreloadDataBuilder();
-        getVfModulePreloadData(preload_name, preload_type, vfModulePreloadDataBuilder);
-        //preloadData = preloadDataBuilder.build();
-
+        getVfModulePreloadData(preloadName, preloadType, vfModulePreloadDataBuilder);
         VfModulePreloadDataBuilder operDataBuilder = new VfModulePreloadDataBuilder();
-        getVfModulePreloadData(preload_name, preload_type, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
+        getVfModulePreloadData(preloadName, preloadType, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
 
         //
         // setup a preload-data object builder
         // ACTION vnf-topology-operation
         // INPUT:
-        //  USES sdnc-request-header;
         //  USES request-information;
         //  uses vnf-topology-information;
         // OUTPUT:
-        //  USES vnf-topology-response-body;
         //
         // container preload-data
-        //   uses vnf-configuration-information;
 
         log.info(
-            "Adding INPUT data for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] input: " + input);
+            ADDING_INPUT_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType + INPUT_STR + input);
         PreloadVfModuleTopologyOperationInputBuilder inputBuilder =
             new PreloadVfModuleTopologyOperationInputBuilder(input);
         VnfSdnUtil.toProperties(parms, inputBuilder.build());
-        log.info("Adding OPERATIONAL data for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
-            + "] operational-data: " + operDataBuilder.build());
-        VnfSdnUtil.toProperties(parms, "operational-data", operDataBuilder);
+        log.info(ADDING_OPERATIONAL_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType
+            + OPERATIONAL_DATA_STR + operDataBuilder.build());
+        VnfSdnUtil.toProperties(parms, OPERATIONAL_DATA, operDataBuilder);
 
         // Call SLI sync method
         // Get SvcLogicService reference
@@ -2247,19 +2034,18 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String ackFinal = "Y";
 
         try {
-            if (svcLogicClient.hasGraph("VNF-API", SVC_OPERATION, null, "sync")) {
-                try {
-                    respProps = svcLogicClient
-                        .execute("VNF-API", SVC_OPERATION, null, "sync", vfModulePreloadDataBuilder, parms);
-                } catch (Exception e) {
-                    log.error("Caught exception executing service logic for " + SVC_OPERATION, e);
-                    errorMessage = e.getMessage();
-                    errorCode = "500";
-                }
+            if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) {
+                respProps = svcLogicClient
+                    .execute(VNF_API, svcOperation, null, "sync", vfModulePreloadDataBuilder, parms);
             } else {
-                errorMessage = "No service logic active for VNF-API: '" + SVC_OPERATION + "'";
+                errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'";
                 errorCode = "503";
             }
+        } catch (SvcLogicException e) {
+            log.error("Caught exception executing service logic for " + svcOperation, e);
+            errorMessage = e.getMessage();
+            errorCode = "500";
+
         } catch (Exception e) {
             errorCode = "500";
             errorMessage = e.getMessage();
@@ -2270,30 +2056,29 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             errorCode = respProps.getProperty("error-code");
             errorMessage = respProps.getProperty("error-message");
             ackFinal = respProps.getProperty("ack-final", "Y");
-            // internalError = respProps.getProperty("internal-error", "false");
         }
 
-        if (errorCode != null && errorCode.length() != 0 && !(errorCode.equals("0") || errorCode.equals("200"))) {
+        if (errorCode != null && errorCode.length() != 0 && !("0".equals(errorCode) || "200".equals(errorCode))) {
 
             responseBuilder.setResponseCode(errorCode);
             responseBuilder.setResponseMessage(errorMessage);
             responseBuilder.setAckFinalIndicator(ackFinal);
 
             VfModulePreloadListBuilder vfModulePreloadListBuilder = new VfModulePreloadListBuilder();
-            vfModulePreloadListBuilder.setVfModuleName(preload_name);
-            vfModulePreloadListBuilder.setVfModuleModelId(preload_type);
+            vfModulePreloadListBuilder.setVfModuleName(preloadName);
+            vfModulePreloadListBuilder.setVfModuleModelId(preloadType);
             vfModulePreloadListBuilder.setVfModulePreloadData(vfModulePreloadDataBuilder.build());
             log.error(
-                "Returned FAILED for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] error code: '"
+                RETURNED_FAILED_STR + svcOperation + " [" + preloadName + "," + preloadType + "] error code: '"
                     + errorCode + "', Reason: '" + errorMessage + "'");
             try {
                 saveVfModulePreloadList(vfModulePreloadListBuilder.build(), true, LogicalDatastoreType.CONFIGURATION);
             } catch (Exception e) {
                 log.error(
-                    "Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
+                    CAUGHT_EXCEPTION_STR + svcOperation + " [" + preloadName + "," + preloadType
                         + "] \n", e);
             }
-            log.debug("Sending Success rpc result due to external error");
+            log.debug(SENDING_SUCCESS_RPC);
             RpcResult<PreloadVfModuleTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadVfModuleTopologyOperationOutput>status(true)
                     .withResult(responseBuilder.build()).build();
@@ -2304,25 +2089,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         try {
             vfModulePreloadData = vfModulePreloadDataBuilder.build();
             log.info(
-                "Updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] preloadData: "
+                UPDATING_MD_SAL_STR + svcOperation + " [" + preloadName + "," + preloadType + "] preloadData: "
                     + vfModulePreloadData);
             // svc-configuration-list
             VfModulePreloadListBuilder vfModulePreloadListBuilder = new VfModulePreloadListBuilder();
-            vfModulePreloadListBuilder.setVfModuleName(preload_name);
-            vfModulePreloadListBuilder.setVfModuleModelId(preload_type);
+            vfModulePreloadListBuilder.setVfModuleName(preloadName);
+            vfModulePreloadListBuilder.setVfModuleModelId(preloadType);
             vfModulePreloadListBuilder.setVfModulePreloadData(vfModulePreloadData);
 
             // SDNGC-989 set merge flag to false
             saveVfModulePreloadList(vfModulePreloadListBuilder.build(), false, LogicalDatastoreType.CONFIGURATION);
-            log.info("Updating OPERATIONAL tree.");
+            log.info(UPDATING_OPERATIONAL_TREE_STR);
             saveVfModulePreloadList(vfModulePreloadListBuilder.build(), false, LogicalDatastoreType.OPERATIONAL);
         } catch (Exception e) {
-            log.error("Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
+            log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + preloadName + "," + preloadType
                 + "] \n", e);
             responseBuilder.setResponseCode("500");
             responseBuilder.setResponseMessage(e.toString());
             responseBuilder.setAckFinalIndicator("Y");
-            log.error("Returned FAILED for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] "
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + preloadName + "," + preloadType + "] "
                 + responseBuilder.build());
             RpcResult<PreloadVfModuleTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadVfModuleTopologyOperationOutput>status(false)
@@ -2336,9 +2121,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         if (errorMessage != null) {
             responseBuilder.setResponseMessage(errorMessage);
         }
-        log.info("Updated MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] ");
+        log.info(UPDATED_MD_SAL_STR + svcOperation + " [" + preloadName + "," + preloadType + "] ");
         log.info(
-            "Returned SUCCESS for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] " + responseBuilder
+            RETURNED_SUCCESS_STR + svcOperation + " [" + preloadName + "," + preloadType + "] " + responseBuilder
                 .build());
 
         RpcResult<PreloadVfModuleTopologyOperationOutput> rpcResult =
@@ -2348,27 +2133,27 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
     }
 
 
-    @Override public Future<RpcResult<PreloadNetworkTopologyOperationOutput>> preloadNetworkTopologyOperation(
+    @Override
+    public ListenableFuture<RpcResult<PreloadNetworkTopologyOperationOutput>> preloadNetworkTopologyOperation(
         PreloadNetworkTopologyOperationInput input) {
 
-        final String SVC_OPERATION = "preload-network-topology-operation";
+        final String svcOperation = "preload-network-topology-operation";
         PreloadData preloadData = null;
         Properties parms = new Properties();
 
-        log.info(SVC_OPERATION + " called.");
+        log.info(svcOperation + CALLED_STR);
         // create a new response object
         PreloadNetworkTopologyOperationOutputBuilder responseBuilder =
             new PreloadNetworkTopologyOperationOutputBuilder();
 
         // Result from savePreloadData
-        final SettableFuture<RpcResult<Void>> futureResult = SettableFuture.create();
 
         if (input == null || input.getNetworkTopologyInformation() == null
             || input.getNetworkTopologyInformation().getNetworkTopologyIdentifier() == null
             || input.getNetworkTopologyInformation().getNetworkTopologyIdentifier().getNetworkName() == null
             || input.getNetworkTopologyInformation().getNetworkTopologyIdentifier().getNetworkType() == null) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid input, null or" +
-                    " empty network-name or network-type");
+            log.debug(EXITING_STR + svcOperation + " because of invalid input, null or" +
+                " empty network-name or network-type");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("input, null or empty network-name or network-type");
             responseBuilder.setAckFinalIndicator("Y");
@@ -2379,12 +2164,12 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         // Grab the name and type from the input buffer
-        String preload_name = input.getNetworkTopologyInformation().getNetworkTopologyIdentifier().getNetworkName();
-        String preload_type = input.getNetworkTopologyInformation().getNetworkTopologyIdentifier().getNetworkType();
+        String preloadName = input.getNetworkTopologyInformation().getNetworkTopologyIdentifier().getNetworkName();
+        String preloadType = input.getNetworkTopologyInformation().getNetworkTopologyIdentifier().getNetworkType();
 
-        // Make sure we have a preload_name and preload_type
-        if (preload_name == null || preload_name.length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid preload-name");
+        // Make sure we have a preloadName and preloadType
+        if (preloadName == null || preloadName.length() == 0) {
+            log.debug(EXITING_STR + svcOperation + " because of invalid preload-name");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("input, invalid preload-name");
             responseBuilder.setAckFinalIndicator("Y");
@@ -2394,8 +2179,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
             return Futures.immediateFuture(rpcResult);
         }
 
-        if (preload_type == null || preload_type.length() == 0) {
-            log.debug("exiting " + SVC_OPERATION + " because of invalid preload-type");
+        if (preloadType == null || preloadType.length() == 0) {
+            log.debug(EXITING_STR + svcOperation + " because of invalid preload-type");
             responseBuilder.setResponseCode("403");
             responseBuilder.setResponseMessage("input, invalid preload-type");
             responseBuilder.setAckFinalIndicator("Y");
@@ -2411,31 +2196,28 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         }
 
         PreloadDataBuilder preloadDataBuilder = new PreloadDataBuilder();
-        getPreloadData(preload_name, preload_type, preloadDataBuilder);
+        getPreloadData(preloadName, preloadType, preloadDataBuilder);
 
         PreloadDataBuilder operDataBuilder = new PreloadDataBuilder();
-        getPreloadData(preload_name, preload_type, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
+        getPreloadData(preloadName, preloadType, operDataBuilder, LogicalDatastoreType.OPERATIONAL);
 
         //
         // setup a preload-data object builder
         // ACTION vnf-topology-operation
         // INPUT:
-        //  USES sdnc-request-header;
         //  USES request-information;
         //  uses vnf-topology-information;
         // OUTPUT:
-        //  USES vnf-topology-response-body;
         //
         // container preload-data
-        //   uses vnf-configuration-information;
         log.info(
-            "Adding INPUT data for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] input: " + input);
+            ADDING_INPUT_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType + INPUT_STR + input);
         PreloadNetworkTopologyOperationInputBuilder inputBuilder =
             new PreloadNetworkTopologyOperationInputBuilder(input);
         VnfSdnUtil.toProperties(parms, inputBuilder.build());
-        log.info("Adding OPERATIONAL data for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
-            + "] operational-data: " + operDataBuilder.build());
-        VnfSdnUtil.toProperties(parms, "operational-data", operDataBuilder);
+        log.info(ADDING_OPERATIONAL_DATA_STR + svcOperation + " [" + preloadName + "," + preloadType
+            + OPERATIONAL_DATA_STR + operDataBuilder.build());
+        VnfSdnUtil.toProperties(parms, OPERATIONAL_DATA, operDataBuilder);
 
         // Call SLI sync method
         // Get SvcLogicService reference
@@ -2445,54 +2227,49 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         String ackFinal = "Y";
 
         try {
-            if (svcLogicClient.hasGraph("VNF-API", SVC_OPERATION, null, "sync")) {
-                try {
-                    respProps =
-                        svcLogicClient.execute("VNF-API", SVC_OPERATION, null, "sync", preloadDataBuilder, parms);
-                } catch (Exception e) {
-                    log.error("Caught exception executing service logic for " + SVC_OPERATION, e);
-                    errorMessage = e.getMessage();
-                    errorCode = "500";
-                }
+            if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) {
+                respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", preloadDataBuilder, parms);
             } else {
-                errorMessage = "No service logic active for VNF-API: '" + SVC_OPERATION + "'";
+                errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'";
                 errorCode = "503";
             }
+        } catch (SvcLogicException e) {
+            log.error("Caught exception executing service logic for " + svcOperation, e);
+            errorMessage = e.getMessage();
+            errorCode = "500";
         } catch (Exception e) {
             errorCode = "500";
             errorMessage = e.getMessage();
             log.error("Caught exception looking for service logic", e);
         }
 
-
         if (respProps != null) {
             errorCode = respProps.getProperty("error-code");
             errorMessage = respProps.getProperty("error-message");
             ackFinal = respProps.getProperty("ack-final", "Y");
-            // internalError = respProps.getProperty("internal-error", "false");
         }
 
-        if (errorCode != null && errorCode.length() != 0 && !(errorCode.equals("0") || errorCode.equals("200"))) {
+        if (errorCode != null && errorCode.length() != 0 && !("0".equals(errorCode) || "200".equals(errorCode))) {
             responseBuilder.setResponseCode(errorCode);
             responseBuilder.setResponseMessage(errorMessage);
             responseBuilder.setAckFinalIndicator(ackFinal);
 
             VnfPreloadListBuilder preloadVnfListBuilder = new VnfPreloadListBuilder();
-            preloadVnfListBuilder.setVnfName(preload_name);
-            preloadVnfListBuilder.setVnfType(preload_type);
+            preloadVnfListBuilder.setVnfName(preloadName);
+            preloadVnfListBuilder.setVnfType(preloadType);
             preloadVnfListBuilder.setPreloadData(preloadDataBuilder.build());
             log.error(
-                "Returned FAILED for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] error code: '"
+                RETURNED_FAILED_STR + svcOperation + " [" + preloadName + "," + preloadType + "] error code: '"
                     + errorCode + "', Reason: '" + errorMessage + "'");
             try {
                 savePreloadList(preloadVnfListBuilder.build(), true, LogicalDatastoreType.CONFIGURATION);
             } catch (Exception e) {
                 log.error(
-                    "Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
+                    CAUGHT_EXCEPTION_STR + svcOperation + " [" + preloadName + "," + preloadType
                         + "] \n", e);
 
             }
-            log.debug("Sending Success rpc result due to external error");
+            log.debug(SENDING_SUCCESS_RPC);
             RpcResult<PreloadNetworkTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadNetworkTopologyOperationOutput>status(true).withResult(responseBuilder.build())
                     .build();
@@ -2503,25 +2280,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         try {
             preloadData = preloadDataBuilder.build();
             log.info(
-                "Updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] preloadData: "
+                UPDATING_MD_SAL_STR + svcOperation + " [" + preloadName + "," + preloadType + "] preloadData: "
                     + preloadData);
             // svc-configuration-list
             VnfPreloadListBuilder preloadVnfListBuilder = new VnfPreloadListBuilder();
-            preloadVnfListBuilder.setVnfName(preload_name);
-            preloadVnfListBuilder.setVnfType(preload_type);
+            preloadVnfListBuilder.setVnfName(preloadName);
+            preloadVnfListBuilder.setVnfType(preloadType);
             preloadVnfListBuilder.setPreloadData(preloadData);
 
             // SDNGC-989 set merge flag to false
             savePreloadList(preloadVnfListBuilder.build(), false, LogicalDatastoreType.CONFIGURATION);
-            log.info("Updating OPERATIONAL tree.");
+            log.info(UPDATING_OPERATIONAL_TREE_STR);
             savePreloadList(preloadVnfListBuilder.build(), false, LogicalDatastoreType.OPERATIONAL);
         } catch (Exception e) {
-            log.error("Caught Exception updating MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type
+            log.error(CAUGHT_EXCEPTION_STR + svcOperation + " [" + preloadName + "," + preloadType
                 + "] \n", e);
             responseBuilder.setResponseCode("500");
             responseBuilder.setResponseMessage(e.toString());
             responseBuilder.setAckFinalIndicator("Y");
-            log.error("Returned FAILED for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] "
+            log.error(RETURNED_FAILED_STR + svcOperation + " [" + preloadName + "," + preloadType + "] "
                 + responseBuilder.build());
             RpcResult<PreloadNetworkTopologyOperationOutput> rpcResult =
                 RpcResultBuilder.<PreloadNetworkTopologyOperationOutput>status(false)
@@ -2535,9 +2312,9 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
         if (errorMessage != null) {
             responseBuilder.setResponseMessage(errorMessage);
         }
-        log.info("Updated MD-SAL for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] ");
+        log.info(UPDATED_MD_SAL_STR + svcOperation + " [" + preloadName + "," + preloadType + "] ");
         log.info(
-            "Returned SUCCESS for " + SVC_OPERATION + " [" + preload_name + "," + preload_type + "] " + responseBuilder
+            RETURNED_SUCCESS_STR + svcOperation + " [" + preloadName + "," + preloadType + "] " + responseBuilder
                 .build());
 
         RpcResult<PreloadNetworkTopologyOperationOutput> rpcResult =
@@ -2545,4 +2322,6 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL
                 .build();
         return Futures.immediateFuture(rpcResult);
     }
+
+
 }