X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vnfapi%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fsdnc%2Fvnfapi%2FVnfApiProvider.java;h=c14db885ed0c7c57ae0c4e28fb2c74b2d31a2d49;hb=51048eee7c8684c7d16450d2bed32dc0d0aafd87;hp=1a05d2dbc99420f29d10e317b22fb0c9ddd77ef6;hpb=131f1fab6bea5eeb6467e8836ec00ef7c6bf5eac;p=sdnc%2Fnorthbound.git diff --git a/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VnfApiProvider.java b/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VnfApiProvider.java index 1a05d2db..c14db885 100644 --- a/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VnfApiProvider.java +++ b/vnfapi/provider/src/main/java/org/onap/sdnc/vnfapi/VnfApiProvider.java @@ -24,13 +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.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; @@ -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; /** @@ -153,7 +155,8 @@ import java.util.concurrent.Future; * 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; @@ -275,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, 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 checkedFuture = writeTransaction.submit(); - Futures.addCallback(checkedFuture, new FutureCallback() { - - @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 = - (ArrayList) 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 vnfInstanceList = - (ArrayList) 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 = - (ArrayList) 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 vnfInstanceList = - (ArrayList) 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 vnfList = - (ArrayList) 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 = (ArrayList) 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 { @@ -570,11 +413,10 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL .child(VnfList.class, new VnfListKey(siid)) .build(); - ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional 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); } @@ -612,11 +454,10 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL .child(VnfInstanceList.class, new VnfInstanceListKey(siid)) .build(); - ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional 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); } @@ -657,11 +498,10 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL .child(VfModuleList.class, new VfModuleListKey(siid)) .build(); - ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional 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); } @@ -701,19 +541,17 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL .child(VnfPreloadList.class, new VnfPreloadListKey(preloadName, preloadType)) .build(); - ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional 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 + PRELOAD_DATA + log.info(READ_MD_SAL_STR + type + DATA_FOR_STR + preloadName + "," + preloadType + PRELOAD_DATA + preloadData); preloadDataBuilder.setVnfTopologyInformation(preloadData.getVnfTopologyInformation()); preloadDataBuilder.setNetworkTopologyInformation(preloadData.getNetworkTopologyInformation()); @@ -743,13 +581,11 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL .child(VnfInstancePreloadList.class, new VnfInstancePreloadListKey(preloadName, preloadType)) .build(); - ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional 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()) { @@ -783,14 +619,11 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL .child(VfModulePreloadList.class, new VfModulePreloadListKey(preloadName, preloadType)) .build(); - ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction(); Optional 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()) { @@ -813,7 +646,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL // Each entry will be identifiable by a unique key, we have to create that identifier InstanceIdentifier path = InstanceIdentifier .builder(Vnfs.class) - .child(VnfList.class, entry.getKey()) + .child(VnfList.class, entry.key()) .build(); int optimisticLockTries = 2; @@ -834,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); } } @@ -850,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 path = InstanceIdentifier .builder(Vnfs.class) - .child(VnfList.class, entry.getKey()) + .child(VnfList.class, entry.key()) .build(); tryUpdateDataStore(entry, merge, storeType, path); @@ -861,7 +702,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL // Each entry will be identifiable by a unique key, we have to create that identifier InstanceIdentifier path = InstanceIdentifier .builder(VnfInstances.class) - .child(VnfInstanceList.class, entry.getKey()) + .child(VnfInstanceList.class, entry.key()) .build(); tryUpdateDataStore(entry, merge, storeType, path); @@ -872,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 path = InstanceIdentifier .builder(VfModules.class) - .child(VfModuleList.class, entry.getKey()) + .child(VfModuleList.class, entry.key()) .build(); tryUpdateDataStore(entry, merge, storeType, path); @@ -883,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 path = InstanceIdentifier .builder(PreloadVnfs.class) - .child(VnfPreloadList.class, entry.getKey()) + .child(VnfPreloadList.class, entry.key()) .build(); tryUpdateDataStore(entry, merge, storeType, path); @@ -896,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 path = InstanceIdentifier .builder(PreloadVnfInstances.class) - .child(VnfInstancePreloadList.class, entry.getKey()) + .child(VnfInstancePreloadList.class, entry.key()) .build(); tryUpdateDataStore(entry, merge, storeType, path); @@ -909,7 +750,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL // Each entry will be identifiable by a unique key, we have to create that identifier InstanceIdentifier path = InstanceIdentifier .builder(PreloadVfModules.class) - .child(VfModulePreloadList.class, entry.getKey()) + .child(VfModulePreloadList.class, entry.key()) .build(); tryUpdateDataStore(entry, merge, storeType, path); @@ -952,25 +793,25 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL private Boolean validateVnfInstanceTopologyOperationInput(VnfInstanceTopologyOperationInput input) { return input != null - && input.getVnfInstanceRequestInformation() != null - && input.getVnfInstanceRequestInformation().getVnfInstanceId() != null - && input.getVnfInstanceRequestInformation().getVnfInstanceId().length() != 0; + && input.getVnfInstanceRequestInformation() != null + && input.getVnfInstanceRequestInformation().getVnfInstanceId() != null + && input.getVnfInstanceRequestInformation().getVnfInstanceId().length() != 0; } - private Future> buildVnfInstanceTopologyOperationOutputWithtError( - String responseCode, String responseMessage, String ackFinalIndicator) { + private ListenableFuture> buildVnfInstanceTopologyOperationOutputWithtError( + String responseCode, String responseMessage, String ackFinalIndicator) { VnfInstanceTopologyOperationOutputBuilder responseBuilder = new VnfInstanceTopologyOperationOutputBuilder(); responseBuilder.setResponseCode(responseCode); responseBuilder.setResponseMessage(responseMessage); responseBuilder.setAckFinalIndicator(ackFinalIndicator); return Futures.immediateFuture(RpcResultBuilder - .status(true) - .withResult(responseBuilder.build()) - .build()); + .status(true) + .withResult(responseBuilder.build()) + .build()); } @Override - public Future> vnfInstanceTopologyOperation( + public ListenableFuture> vnfInstanceTopologyOperation( VnfInstanceTopologyOperationInput input) { final String svcOperation = "vnf-instance-topology-operation"; @@ -985,8 +826,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL if (!validateVnfInstanceTopologyOperationInput(input)) { log.debug(EXITING_STR + svcOperation + " because of " + INVALID_INPUT_VNF_INSTANCE_STR); return buildVnfInstanceTopologyOperationOutputWithtError("403", - INVALID_INPUT_VNF_INSTANCE_STR, - "Y" ); + INVALID_INPUT_VNF_INSTANCE_STR, + "Y"); } // Grab the service instance ID from the input buffer @@ -1054,7 +895,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL try { if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) { - respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", vnfInstanceServiceDataBuilder, parms); + respProps = svcLogicClient + .execute(VNF_API, svcOperation, null, "sync", vnfInstanceServiceDataBuilder, parms); } else { errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'"; errorCode = "503"; @@ -1156,7 +998,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL //1610 vf-module-topology-operation @Override - public Future> vfModuleTopologyOperation( + public ListenableFuture> vfModuleTopologyOperation( VfModuleTopologyOperationInput input) { final String svcOperation = "vf-module-topology-operation"; @@ -1290,7 +1132,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL try { if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) { - respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", vfModuleServiceDataBuilder, parms); + respProps = svcLogicClient + .execute(VNF_API, svcOperation, null, "sync", vfModuleServiceDataBuilder, parms); } else { errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'"; errorCode = "503"; @@ -1388,7 +1231,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL } @Override - public Future> vnfTopologyOperation(VnfTopologyOperationInput input) { + public ListenableFuture> vnfTopologyOperation( + VnfTopologyOperationInput input) { final String svcOperation = "vnf-topology-operation"; ServiceData serviceData; ServiceStatusBuilder serviceStatusBuilder = new ServiceStatusBuilder(); @@ -1580,7 +1424,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL } @Override - public Future> networkTopologyOperation( + public ListenableFuture> networkTopologyOperation( NetworkTopologyOperationInput input) { final String svcOperation = "network-topology-operation"; @@ -1651,7 +1495,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL try { if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) { - respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", preloadDataBuilder, parms); + respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", preloadDataBuilder, parms); } else { errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'"; errorCode = "503"; @@ -1722,7 +1566,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL } @Override - public Future> preloadVnfTopologyOperation( + public ListenableFuture> preloadVnfTopologyOperation( PreloadVnfTopologyOperationInput input) { final String svcOperation = "preload-vnf-topology-operation"; @@ -1812,7 +1656,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL try { if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) { - respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", preloadDataBuilder, parms); + respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", preloadDataBuilder, parms); } else { errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'"; errorCode = "503"; @@ -1909,7 +1753,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL //1610 preload-vnf-instance-topology-operation @Override - public Future> preloadVnfInstanceTopologyOperation( + public ListenableFuture> preloadVnfInstanceTopologyOperation( PreloadVnfInstanceTopologyOperationInput input) { final String svcOperation = "preload-vnf-instance-topology-operation"; @@ -1998,7 +1842,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL try { if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) { - respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", vnfInstancePreloadDataBuilder, parms); + respProps = svcLogicClient + .execute(VNF_API, svcOperation, null, "sync", vnfInstancePreloadDataBuilder, parms); } else { errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'"; errorCode = "503"; @@ -2098,7 +1943,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL //1610 preload-vf-module-topology-operation @Override - public Future> preloadVfModuleTopologyOperation( + public ListenableFuture> preloadVfModuleTopologyOperation( PreloadVfModuleTopologyOperationInput input) { final String svcOperation = "preload-vf-module-topology-operation"; @@ -2190,7 +2035,8 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL try { if (svcLogicClient.hasGraph(VNF_API, svcOperation, null, "sync")) { - respProps = svcLogicClient.execute(VNF_API, svcOperation, null, "sync", vfModulePreloadDataBuilder, parms); + respProps = svcLogicClient + .execute(VNF_API, svcOperation, null, "sync", vfModulePreloadDataBuilder, parms); } else { errorMessage = "No service logic active for VNF-API: '" + svcOperation + "'"; errorCode = "503"; @@ -2288,7 +2134,7 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL @Override - public Future> preloadNetworkTopologyOperation( + public ListenableFuture> preloadNetworkTopologyOperation( PreloadNetworkTopologyOperationInput input) { final String svcOperation = "preload-network-topology-operation"; @@ -2333,7 +2179,6 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL return Futures.immediateFuture(rpcResult); } - if (preloadType == null || preloadType.length() == 0) { log.debug(EXITING_STR + svcOperation + " because of invalid preload-type"); responseBuilder.setResponseCode("403"); @@ -2477,4 +2322,6 @@ public class VnfApiProvider implements AutoCloseable, VNFAPIService, DataChangeL .build(); return Futures.immediateFuture(rpcResult); } + + }