diff options
author | sebdet <sebastien.determe@intl.att.com> | 2018-11-09 18:27:20 +0100 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2018-11-12 06:49:01 +0100 |
commit | 5f0ef13aa4d83caadd1056d5115952adcb780514 (patch) | |
tree | 4c515051183ef8f01ebca1a36f35fbd42b818f80 | |
parent | 2579386298fc4862a87073f8c719986925d77424 (diff) |
Save DCAE url
Save DCAE url before the triggering otherwise, it may be very long
Issue-ID: CLAMP-246
Change-Id: Ide9431a7e8bbbf9b8a15ba9efec6eb5983811cb4
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
-rw-r--r-- | src/main/java/org/onap/clamp/clds/service/CldsService.java | 15 |
1 files changed, 9 insertions, 6 deletions
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 8e7785d6a..be19e31c0 100644 --- a/src/main/java/org/onap/clamp/clds/service/CldsService.java +++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java @@ -261,8 +261,8 @@ public class CldsService extends SecureServiceBase { && !CldsModel.STATUS_ACTIVE.equals(cldsModel.getStatus()) && cldsModel.getDeploymentId() != null && cldsModel.getDeploymentStatusUrl() != null) { checkDcaeDeploymentStatus(cldsModel, CldsEvent.ACTION_DEPLOY, false); - // refresh because new event may have been added - cldsModel = CldsModel.retrieve(cldsDao, modelName, false); + // Refresh the model object in any cases for new event + cldsModel = CldsModel.retrieve(cldsDao, cldsModel.getName(), false); } } catch (Exception e) { LoggingUtils.setErrorContext("900", "Set event inventory error"); @@ -737,10 +737,11 @@ public class CldsService extends SecureServiceBase { modelProp.getGlobal().getDeployParameters())); CldsEvent.insEvent(cldsDao, model.getControlName(), getUserId(), CldsEvent.ACTION_DEPLOY, CldsEvent.ACTION_STATE_INITIATED, null); + model.save(cldsDao, getUserId()); // This is a blocking call checkDcaeDeploymentStatus(model, CldsEvent.ACTION_DEPLOY, true); - - model.save(cldsDao, getUserId()); + // Refresh the model object in any cases for new event + model = CldsModel.retrieve(cldsDao, model.getName(), false); // audit log LoggingUtils.setTimeContext(startTime, new Date()); auditLogger.info("Deploy model completed"); @@ -772,11 +773,13 @@ public class CldsService extends SecureServiceBase { dcaeDispatcherServices.deleteExistingDeployment(model.getDeploymentId(), model.getTypeId())); CldsEvent.insEvent(cldsDao, model.getControlName(), getUserId(), CldsEvent.ACTION_UNDEPLOY, CldsEvent.ACTION_STATE_INITIATED, null); - // This is a blocking call - checkDcaeDeploymentStatus(model, CldsEvent.ACTION_UNDEPLOY, true); // clean the deployment ID model.setDeploymentId(null); model.save(cldsDao, getUserId()); + // This is a blocking call + checkDcaeDeploymentStatus(model, CldsEvent.ACTION_UNDEPLOY, true); + // Refresh the model object in any cases for new event + model = CldsModel.retrieve(cldsDao, model.getName(), false); // audit log LoggingUtils.setTimeContext(startTime, new Date()); auditLogger.info("Undeploy model completed"); |