X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Fservice%2FCldsService.java;h=592a9457515edf8a6c18a5fa39aa727c1061b271;hb=3271165f71b5aee7bc9b5186ee2566c8dd2f2626;hp=1b760670581cc6cf59e9864962262d70ea19d236;hpb=96a55871dabf4fa374de16091e165f0dc77bd9f7;p=clamp.git diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java index 1b760670..592a9457 100644 --- a/src/main/java/org/onap/clamp/clds/service/CldsService.java +++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java @@ -849,17 +849,7 @@ public class CldsService extends SecureServiceBase { } String createNewDeploymentStatusUrl = dcaeDispatcherServices.createNewDeployment(deploymentId, model.getTypeId(), modelProp.getGlobal().getDeployParameters()); - String operationStatus = "processing"; - long waitingTime = System.nanoTime() + DCAE_DEPLOY_WAITING_TIME; - while ("processing".equalsIgnoreCase(operationStatus)) { - if (waitingTime < System.nanoTime()) { - logger.info("Waiting is over for DCAE deployment"); - break; - } - logger.info("Waiting 5s before sending query to DCAE"); - Thread.sleep(5000); - operationStatus = dcaeDispatcherServices.getOperationStatus(createNewDeploymentStatusUrl); - } + String operationStatus = dcaeDispatcherServices.getOperationStatusWithRetry(createNewDeploymentStatusUrl); if ("succeeded".equalsIgnoreCase(operationStatus)) { String artifactName = model.getControlName(); if (artifactName != null) { @@ -904,14 +894,7 @@ public class CldsService extends SecureServiceBase { try { String operationStatusUndeployUrl = dcaeDispatcherServices.deleteExistingDeployment(model.getDeploymentId(), model.getTypeId()); - String operationStatus = "processing"; - long waitingTime = System.nanoTime() + TimeUnit.MINUTES.toNanos(10); - while ("processing".equalsIgnoreCase(operationStatus)) { - if (waitingTime < System.nanoTime()) { - break; - } - operationStatus = dcaeDispatcherServices.getOperationStatus(operationStatusUndeployUrl); - } + String operationStatus = dcaeDispatcherServices.getOperationStatusWithRetry(operationStatusUndeployUrl); if ("succeeded".equalsIgnoreCase(operationStatus)) { String artifactName = model.getControlName(); if (artifactName != null) {