use of org.onap.so.adapters.vnfrest.VolumeGroupRollback in project so by onap.
the class PollService method determineCreateVolumeGroupStatus.
private Optional<String> determineCreateVolumeGroupStatus(CreateVolumeGroupRequest req, ExternalTask externalTask, MutableBoolean success, boolean isMulticloud) throws MsoException {
boolean pollRollbackStatus = externalTask.getVariable("PollRollbackStatus");
String stackId = externalTask.getVariable("stackId");
if (pollRollbackStatus) {
logger.debug("Executing External Task Poll Service for Rollback Volume Group");
if (!isMulticloud) {
pollDeleteResource(118, req.getCloudSiteId(), req.getTenantId(), stackId, success);
}
return Optional.empty();
} else {
logger.debug("Executing External Task Poll Service for Create Volume Group");
Map<String, String> outputs = new HashMap<String, String>();
if (!isMulticloud) {
int timeoutMinutes = msoHeatUtils.getVfHeatTimeoutValue(req.getModelCustomizationUuid(), true);
StackInfo stack = pollCreateResource(timeoutMinutes, req.getCloudSiteId(), req.getTenantId(), stackId, success);
outputs = vnfAdapterImpl.copyStringOutputs(stack.getOutputs());
}
VolumeGroupRollback rb = new VolumeGroupRollback(req.getVolumeGroupId(), stackId, true, req.getTenantId(), req.getCloudOwner(), req.getCloudSiteId(), req.getMsoRequest(), req.getMessageId());
CreateVolumeGroupResponse createResponse = new CreateVolumeGroupResponse(req.getVolumeGroupId(), stackId, true, outputs, rb, req.getMessageId());
return Optional.of(createResponse.toXmlString());
}
}
Aggregations