diff options
Diffstat (limited to 'nokiav2/driver/src/main')
9 files changed, 195 insertions, 171 deletions
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/api/INotificationSender.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/api/INotificationSender.java index c601f5ac..55e9cca2 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/api/INotificationSender.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/api/INotificationSender.java @@ -19,6 +19,8 @@ import com.nokia.cbam.lcm.v32.model.OperationExecution; import com.nokia.cbam.lcm.v32.model.VnfLifecycleChangeNotification; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification.ReportedAffectedConnectionPoints; +import java.util.Optional; + /** * Responsible for processing the preprocessed notification from CBAM and making the changes * based on the notification in various ONAP sub systems. @@ -33,5 +35,5 @@ public interface INotificationSender { * @param affectedConnectionPoints the affected connection points during the operation * @param vimId the identifier of the VIM in ONAP */ - void processNotification(VnfLifecycleChangeNotification receivedNotification, OperationExecution operationExecution, ReportedAffectedConnectionPoints affectedConnectionPoints, String vimId); + void processNotification(VnfLifecycleChangeNotification receivedNotification, OperationExecution operationExecution, Optional<ReportedAffectedConnectionPoints> affectedConnectionPoints, String vimId); } diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcGrantManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcGrantManager.java index f283672e..1d9ef8dc 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcGrantManager.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcGrantManager.java @@ -26,7 +26,6 @@ import com.nokia.cbam.lcm.v32.model.VnfInfo; import com.nokia.cbam.lcm.v32.model.VnfcResourceInfo; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.api.IGrantManager; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring.Conditions; -import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.CatalogManager; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.CbamRestApiProvider; import org.onap.vnfmdriver.model.*; @@ -40,6 +39,7 @@ import java.util.*; import static com.nokia.cbam.lcm.v32.model.InstantiationState.INSTANTIATED; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.buildFatalFailure; +import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.child; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.CbamRestApiProvider.NOKIA_LCM_API_VERSION; import static org.onap.vnfmdriver.model.OperationType.TERMINAL; import static org.slf4j.LoggerFactory.getLogger; @@ -103,7 +103,7 @@ public class VfcGrantManager implements IGrantManager { try { grantRequest = buildGrantRequest(vnfmId, vimId, onapVnfdId, jobId, TERMINAL); grantRequest.setVnfInstanceId(vnfId); - addVnfsToGrant(vnf, grantRequest); + addVnfcsToGrant(vnf, grantRequest); } catch (Exception e) { throw buildFatalFailure(logger, "Unable to prepare grant request for termination", e); } @@ -111,7 +111,8 @@ public class VfcGrantManager implements IGrantManager { } } - private void addVnfsToGrant(VnfInfo vnf, GrantVNFRequest grantRequest) { + private void addVnfcsToGrant(VnfInfo vnf, GrantVNFRequest grantRequest) { + //VNF is instantiated but has no VNFC if (vnf.getInstantiatedVnfInfo().getVnfcResourceInfo() != null) { for (VnfcResourceInfo vnfc : vnf.getInstantiatedVnfInfo().getVnfcResourceInfo()) { ResourceChange resourceChange = new ResourceChange(); @@ -164,11 +165,11 @@ public class VfcGrantManager implements IGrantManager { private Set<ResourceChange> calculateResourceChangeDuringInstantiate(String vnfdContent, String instantiationLevelId) { JsonObject root = new Gson().toJsonTree(new Yaml().load(vnfdContent)).getAsJsonObject(); - JsonObject capabilities = CbamUtils.child(CbamUtils.child(CbamUtils.child(root, "topology_template"), "substitution_mappings"), "capabilities"); - JsonObject deploymentFlavorProperties = CbamUtils.child(CbamUtils.child(capabilities, "deployment_flavour"), "properties"); - JsonObject instantiationLevels = CbamUtils.child(deploymentFlavorProperties, "instantiation_levels"); + JsonObject capabilities = child(child(child(root, "topology_template"), "substitution_mappings"), "capabilities"); + JsonObject deploymentFlavorProperties = child(child(capabilities, "deployment_flavour"), "properties"); + JsonObject instantiationLevels = child(deploymentFlavorProperties, "instantiation_levels"); Set<ResourceChange> resourceChanges = new HashSet<>(); - for (Map.Entry<String, JsonElement> vdu_level : CbamUtils.child(CbamUtils.child(instantiationLevels, instantiationLevelId), ("vdu_levels")).entrySet()) { + for (Map.Entry<String, JsonElement> vdu_level : child(child(instantiationLevels, instantiationLevelId), ("vdu_levels")).entrySet()) { JsonElement numberOfInstances = vdu_level.getValue().getAsJsonObject().get("number_of_instances"); for (int i = 0; i < numberOfInstances.getAsLong(); i++) { ResourceChange resourceChange = new ResourceChange(); @@ -184,11 +185,11 @@ public class VfcGrantManager implements IGrantManager { private Set<ResourceChange> calculateResourceChangeDuringScaling(String vnfdContent, String aspectId, int steps) { JsonObject root = new Gson().toJsonTree(new Yaml().load(vnfdContent)).getAsJsonObject(); Set<ResourceChange> resourceChanges = new HashSet<>(); - JsonArray policies = CbamUtils.child(root, "topology_template").getAsJsonObject().get("policies").getAsJsonArray(); + JsonArray policies = child(root, "topology_template").getAsJsonObject().get("policies").getAsJsonArray(); for (JsonElement policy : policies) { if ("heat_mapping".equals(policy.getAsJsonObject().entrySet().iterator().next().getKey())) { JsonObject aspects = policy.getAsJsonObject().entrySet().iterator().next().getValue().getAsJsonObject().get("properties").getAsJsonObject().get("aspects").getAsJsonObject(); - JsonObject aspect = aspects.get(aspectId).getAsJsonObject(); + JsonObject aspect = child(aspects, aspectId); if (aspect.has("vdus")) { addChangesForAspect(steps, resourceChanges, aspect); } diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcNotificationSender.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcNotificationSender.java index 32c3f909..50f6221b 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcNotificationSender.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/VfcNotificationSender.java @@ -15,7 +15,6 @@ */ package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.vfc; -import com.google.common.base.Optional; import com.google.gson.Gson; import com.nokia.cbam.lcm.v32.model.OperationExecution; import com.nokia.cbam.lcm.v32.model.ScaleVnfRequest; @@ -23,6 +22,7 @@ import com.nokia.cbam.lcm.v32.model.VnfLifecycleChangeNotification; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.api.INotificationSender; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.spring.Conditions; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.DriverProperties; +import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification.LifecycleChangeNotificationManager; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification.ReportedAffectedConnectionPoints; import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification.ReportedAffectedCp; import org.onap.vnfmdriver.model.*; @@ -32,10 +32,11 @@ import org.springframework.context.annotation.Conditional; import org.springframework.stereotype.Component; import java.util.ArrayList; +import java.util.Optional; -import static com.google.common.base.Optional.of; import static com.google.common.collect.Iterables.tryFind; import static com.nokia.cbam.lcm.v32.model.ScaleDirection.IN; +import static java.util.Optional.of; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.SEPARATOR; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.buildFatalFailure; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.JobManager.extractOnapJobId; @@ -58,22 +59,18 @@ public class VfcNotificationSender implements INotificationSender { } @Override - public void processNotification(VnfLifecycleChangeNotification recievedNotification, OperationExecution operationExecution, ReportedAffectedConnectionPoints affectedCps, String vimId) { + public void processNotification(VnfLifecycleChangeNotification recievedNotification, OperationExecution operationExecution, Optional<ReportedAffectedConnectionPoints> affectedCps, String vimId) { VNFLCMNotification notificationToSend = new VNFLCMNotification(); notificationToSend.setJobId(extractOnapJobId(operationExecution.getOperationParams())); notificationToSend.setOperation(getOperation(operationExecution, recievedNotification.getOperation())); notificationToSend.setVnfInstanceId(recievedNotification.getVnfInstanceId()); - switch (recievedNotification.getStatus()) { - case FINISHED: - case FAILED: - notificationToSend.setStatus(VnfLcmNotificationStatus.RESULT); - addAffectedVirtualLinks(recievedNotification, notificationToSend); - addAffectedVnfcs(vimId, recievedNotification.getVnfInstanceId(), notificationToSend, recievedNotification); - addAffectedCps(vimId, notificationToSend, affectedCps); - break; - default: - notificationToSend.setStatus(VnfLcmNotificationStatus.START); - break; + if (LifecycleChangeNotificationManager.isTerminal(recievedNotification.getStatus())) { + notificationToSend.setStatus(VnfLcmNotificationStatus.RESULT); + addAffectedVirtualLinks(recievedNotification, notificationToSend); + addAffectedVnfcs(vimId, recievedNotification.getVnfInstanceId(), notificationToSend, recievedNotification); + addAffectedCps(vimId, notificationToSend, affectedCps); + } else { + notificationToSend.setStatus(VnfLcmNotificationStatus.START); } sendNotification(notificationToSend); } @@ -81,7 +78,7 @@ public class VfcNotificationSender implements INotificationSender { private void sendNotification(VNFLCMNotification notification) { try { if (logger.isInfoEnabled()) { - logger.info("Sending LCN: " + new Gson().toJson(notification)); + logger.info("Sending LCN: {}", new Gson().toJson(notification)); } vfcRestApiProvider.getNsLcmApi().vNFLCMNotification(driverProperties.getVnfmId(), notification.getVnfInstanceId(), notification); } catch (Exception e) { @@ -143,28 +140,31 @@ public class VfcNotificationSender implements INotificationSender { } private Optional<VnfCpNotificationType> getChangeType(ReportedAffectedConnectionPoints affectedCps, ReportedAffectedCp affectedCp) { - Optional<ReportedAffectedCp> cpBeforeOperation = tryFind(affectedCps.getPre(), pre -> affectedCp.getCpId().equals(pre.getCpId())); - Optional<ReportedAffectedCp> cpAfterOperation = tryFind(affectedCps.getPost(), post -> affectedCp.getCpId().equals(post.getCpId())); + com.google.common.base.Optional<ReportedAffectedCp> cpBeforeOperation = tryFind(affectedCps.getPre(), pre -> affectedCp.getCpId().equals(pre.getCpId())); + com.google.common.base.Optional<ReportedAffectedCp> cpAfterOperation = tryFind(affectedCps.getPost(), post -> affectedCp.getCpId().equals(post.getCpId())); if (cpBeforeOperation.isPresent() && cpAfterOperation.isPresent()) { - return cpAfterOperation.get().equals(cpBeforeOperation.get()) ? Optional.absent() : of(VnfCpNotificationType.CHANGED); + return cpAfterOperation.get().equals(cpBeforeOperation.get()) ? Optional.empty() : of(VnfCpNotificationType.CHANGED); } else { //the affected CP must be present in the pre or post return of((cpAfterOperation.isPresent() ? VnfCpNotificationType.ADDED : VnfCpNotificationType.REMOVED)); } } - private void addAffectedCps(String vimId, VNFLCMNotification notificationToSend, ReportedAffectedConnectionPoints affectedCps) { - if (affectedCps != null) { + private void addAffectedCps(String vimId, VNFLCMNotification notificationToSend, Optional<ReportedAffectedConnectionPoints> affectedCps) { + if (affectedCps.isPresent()) { notificationToSend.setAffectedCp(new ArrayList<>()); - for (ReportedAffectedCp pre : affectedCps.getPre()) { - Optional<VnfCpNotificationType> changeType = getChangeType(affectedCps, pre); + for (ReportedAffectedCp pre : affectedCps.get().getPre()) { + Optional<VnfCpNotificationType> changeType = getChangeType(affectedCps.get(), pre); if (of(VnfCpNotificationType.REMOVED).equals(changeType)) { addModifiedCp(vimId, notificationToSend, pre, changeType); } } - for (ReportedAffectedCp post : affectedCps.getPost()) { - Optional<VnfCpNotificationType> changeType = getChangeType(affectedCps, post); - if (of(VnfCpNotificationType.ADDED).equals(changeType) || of(VnfCpNotificationType.CHANGED).equals(changeType)) { + for (ReportedAffectedCp post : affectedCps.get().getPost()) { + Optional<VnfCpNotificationType> changeType = getChangeType(affectedCps.get(), post); + if (of(VnfCpNotificationType.ADDED).equals(changeType)) { + addModifiedCp(vimId, notificationToSend, post, changeType); + } + if (of(VnfCpNotificationType.CHANGED).equals(changeType)) { addModifiedCp(vimId, notificationToSend, post, changeType); } } @@ -185,19 +185,18 @@ public class VfcNotificationSender implements INotificationSender { } private org.onap.vnfmdriver.model.OperationType getOperation(OperationExecution operationExecution, com.nokia.cbam.lcm.v32.model.OperationType type) { - switch (type) { - case TERMINATE: - return org.onap.vnfmdriver.model.OperationType.TERMINAL; - case INSTANTIATE: - return org.onap.vnfmdriver.model.OperationType.INSTANTIATE; - case SCALE: - if (IN == new Gson().fromJson(new Gson().toJson(operationExecution.getOperationParams()), ScaleVnfRequest.class).getType()) { - return OperationType.SCALEIN; - } else { - return OperationType.SCALEOUT; - } - default: - return org.onap.vnfmdriver.model.OperationType.HEAL; + if (type == com.nokia.cbam.lcm.v32.model.OperationType.TERMINATE) { + return OperationType.TERMINAL; + } else if (type == com.nokia.cbam.lcm.v32.model.OperationType.INSTANTIATE) { + return OperationType.INSTANTIATE; + } else if (type == com.nokia.cbam.lcm.v32.model.OperationType.SCALE) { + if (IN == new Gson().fromJson(new Gson().toJson(operationExecution.getOperationParams()), ScaleVnfRequest.class).getType()) { + return OperationType.SCALEIN; + } else { + return OperationType.SCALEOUT; + } + } else { + return OperationType.HEAL; } } @@ -206,13 +205,12 @@ public class VfcNotificationSender implements INotificationSender { } private org.onap.vnfmdriver.model.VnfNotificationType getChangeType(com.nokia.cbam.lcm.v32.model.ChangeType changeType) { - switch (changeType) { - case ADDED: - return org.onap.vnfmdriver.model.VnfNotificationType.ADDED; - case REMOVED: - return org.onap.vnfmdriver.model.VnfNotificationType.REMOVED; - default: //case MODIFIED: - return org.onap.vnfmdriver.model.VnfNotificationType.MODIFIED; + if (changeType == com.nokia.cbam.lcm.v32.model.ChangeType.ADDED) { + return VnfNotificationType.ADDED; + } else if (changeType == com.nokia.cbam.lcm.v32.model.ChangeType.REMOVED) { + return VnfNotificationType.REMOVED; + } else { + return VnfNotificationType.MODIFIED; } } diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfdBuilder.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfdBuilder.java index 03c27a83..e628458d 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfdBuilder.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/packagetransformer/OnapVnfdBuilder.java @@ -21,7 +21,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import org.jetbrains.annotations.Nullable; +import org.slf4j.Logger; import org.yaml.snakeyaml.Yaml; import java.util.Map; @@ -31,15 +31,16 @@ import java.util.regex.Pattern; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.child; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.childElement; +import static org.slf4j.LoggerFactory.getLogger; /** * Transforms a CBAM package into an ONAP package */ public class OnapVnfdBuilder { - public static final String DESCRIPTION = "description"; public static final String PROPERTIES = "properties"; public static final String REQUIREMENTS = "requirements"; + private static Logger logger = getLogger(OnapVnfdBuilder.class); @VisibleForTesting static String indent(String content, int prefixSize) { @@ -157,28 +158,36 @@ public class OnapVnfdBuilder { if (ecp.getAsJsonObject().has(REQUIREMENTS)) { String icpName = getIcpName(ecp.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray()); if (icpName != null) { - return buildIcp(name, icpName, nodes); + return buildEcpInternal(name, icpName, nodes); + } else { + logger.warn("The {} ecp does not have an internal connection point", name); } + } else { + logger.warn("The {} ecp does not have an requirements section", name); } return ""; } - private String buildIcp(String name, String icpName, Set<Map.Entry<String, JsonElement>> nodes) { + private String buildEcpInternal(String ecpName, String icpName, Set<Map.Entry<String, JsonElement>> nodes) { JsonObject icpNode = get(icpName, nodes).getAsJsonObject(); if (icpNode.has(REQUIREMENTS)) { - String vdu = getVdu(icpNode.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray()); + String vdu = getVduOfIcp(icpNode.getAsJsonObject().get(REQUIREMENTS).getAsJsonArray()); + //internal connection point is bound to VDU if (vdu != null) { - return buildVduCpd(name, vdu, child(icpNode, PROPERTIES)); + return buildVduCpd(ecpName, vdu, child(icpNode, PROPERTIES)); + } else { + logger.warn("The {} internal connection point of the {} ecp does not have a VDU", icpName, ecpName); } + } else { + logger.warn("The {} internal connection point of the {} ecp does not have a requirements section", icpName, ecpName); } return ""; } - @Nullable - private String getVdu(JsonArray requirements) { + private String getVduOfIcp(JsonArray icpRequirements) { String vdu = null; - for (int i = 0; i < requirements.size(); i++) { - JsonElement requirement = requirements.get(i); + for (int i = 0; i < icpRequirements.size(); i++) { + JsonElement requirement = icpRequirements.get(i); Map.Entry<String, JsonElement> next = requirement.getAsJsonObject().entrySet().iterator().next(); String s = next.getKey(); if ("virtual_binding".equals(s)) { @@ -188,7 +197,6 @@ public class OnapVnfdBuilder { return vdu; } - @Nullable private String getIcpName(JsonArray requirements) { String icpName = null; for (int i = 0; i < requirements.size(); i++) { @@ -202,18 +210,6 @@ public class OnapVnfdBuilder { return icpName; } - private String buildVduCpd(String name, String vdu, JsonObject properties) { - return indent(name + ":\n" + - " type: tosca.nodes.nfv.VduCpd\n" + - " " + PROPERTIES + ":\n" + - " layer_protocol: " + childElement(properties, "layer_protocol").getAsString() + "\n" + - " role: leaf\n" + - (properties.has(DESCRIPTION) ? - " description: " + childElement(properties, DESCRIPTION).getAsString() + "\n" : "") + - " requirements:\n" + - " - virtual_binding: " + vdu + "\n", 2); - } - private String buildIcp(String name, JsonObject icp) { if (icp.has(REQUIREMENTS)) { JsonArray requirements = icp.get(REQUIREMENTS).getAsJsonArray(); @@ -225,42 +221,59 @@ public class OnapVnfdBuilder { String s = next.getKey(); if ("virtual_binding".equals(s)) { vdu = next.getValue().getAsString(); - } else if ("virtual_link".equals(s)) { vl = next.getValue().getAsString(); } } - if (vdu != null && vl != null) { + if (vdu == null) { + logger.warn("The {} internal connection point does not have a VDU", name); + } else if (vl == null) { + logger.warn("The {} internal connection point does not have a VL", name); + } else { JsonObject properties = child(icp, PROPERTIES); - return " " + name + ":\n" + - " type: tosca.nodes.nfv.VduCpd\n" + - " " + PROPERTIES + ":\n" + - " layer_protocol: " + childElement(properties, "layer_protocol").getAsString() + "\n" + - " role: leaf\n" + (properties.has(DESCRIPTION) ? - " description: " + childElement(properties, DESCRIPTION).getAsString() + "\n" : "") + - " requirements:\n" + - " - virtual_binding: " + vdu + "\n" + - " - virtual_link: " + vl + "\n"; + return indent(name + ":\n" + + " type: tosca.nodes.nfv.VduCpd\n" + + " " + PROPERTIES + ":\n" + + " layer_protocol: " + childElement(properties, "layer_protocol").getAsString() + "\n" + + " role: leaf\n" + (properties.has(DESCRIPTION) ? + " description: " + childElement(properties, DESCRIPTION).getAsString() + "\n" : "") + + " requirements:\n" + + " - virtual_binding: " + vdu + "\n" + + " - virtual_link: " + vl + "\n", 2); } + } else { + logger.warn("The {} internal connection point does not have a requirements section", name); } return ""; } + private String buildVduCpd(String name, String vdu, JsonObject properties) { + return indent(name + ":\n" + + " type: tosca.nodes.nfv.VduCpd\n" + + " " + PROPERTIES + ":\n" + + " layer_protocol: " + childElement(properties, "layer_protocol").getAsString() + "\n" + + " role: leaf\n" + + (properties.has(DESCRIPTION) ? + " description: " + childElement(properties, DESCRIPTION).getAsString() + "\n" : "") + + " requirements:\n" + + " - virtual_binding: " + vdu + "\n", 2); + } + private String buildVolume(String nodeName, JsonObject volume) { - return " " + nodeName + ":\n" + - " type: tosca.nodes.nfv.VDU.VirtualStorage\n" + - " properties:\n" + - " id: " + nodeName + "\n" + - " type_of_storage: volume\n" + - " size_of_storage: " + childElement(child(volume, PROPERTIES), "size_of_storage").getAsString() + "\n"; + return indent(nodeName + ":\n" + + " type: tosca.nodes.nfv.VDU.VirtualStorage\n" + + " properties:\n" + + " id: " + nodeName + "\n" + + " type_of_storage: volume\n" + + " size_of_storage: " + childElement(child(volume, PROPERTIES), "size_of_storage").getAsString() + "\n", 2); } private String buildVl(String name) { - return " " + name + ":\n" + - " type: tosca.nodes.nfv.VnfVirtualLinkDesc\n" + - " properties:\n" + - " vl_flavours:\n" + - " flavours:\n" + - " flavourId: notUsed\n"; + return indent(name + ":\n" + + " type: tosca.nodes.nfv.VnfVirtualLinkDesc\n" + + " properties:\n" + + " vl_flavours:\n" + + " flavours:\n" + + " flavourId: notUsed\n", 2); } } diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/ConverterApi.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/ConverterApi.java index 8eb2007b..790ac054 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/ConverterApi.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/ConverterApi.java @@ -68,7 +68,7 @@ public class ConverterApi { byte[] convertedPackage; try { convertedPackage = vnfPackageConverter.covert(new ByteArrayInputStream(content)); - } catch (IOException e) { + } catch (Exception e) { throw buildFatalFailure(logger, "Unable to convert VNF package", e); } httpResponse.addHeader(CONTENT_TYPE, APPLICATION_OCTET_STREAM.getMimeType()); diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/SystemFunctions.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/SystemFunctions.java index b8c50b1a..0bb63039 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/SystemFunctions.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/SystemFunctions.java @@ -161,4 +161,5 @@ public class SystemFunctions { public CloseableHttpClient getHttpClient() { return HttpClients.createDefault(); } -} + +}
\ No newline at end of file diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java index 2aba46b3..94cb404c 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/JobManager.java @@ -41,6 +41,8 @@ import static com.google.common.base.Splitter.on; import static com.google.common.collect.Iterables.find; import static com.google.common.collect.Iterables.tryFind; import static com.google.common.collect.Lists.newArrayList; +import static com.nokia.cbam.lcm.v32.model.OperationStatus.FAILED; +import static com.nokia.cbam.lcm.v32.model.OperationStatus.STARTED; import static java.util.Optional.empty; import static java.util.Optional.of; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.SEPARATOR; @@ -201,15 +203,12 @@ public class JobManager { } private JobDetailInfo getJobDetailInfo(String vnfmId, String jobId, String vnfId, OperationExecution operation) { - switch (operation.getStatus()) { - case STARTED: - return reportOngoing(jobId); - case FINISHED: - case OTHER: - return getJobForTerminalOperationState(vnfmId, jobId, vnfId, operation); - case FAILED: - default: //all cases handled - return reportFailed(jobId, operation.getError().getTitle() + ": " + operation.getError().getDetail()); + if (operation.getStatus() == STARTED) { + return reportOngoing(jobId); + } else if (operation.getStatus() == FAILED) { + return reportFailed(jobId, operation.getError().getTitle() + ": " + operation.getError().getDetail()); + } else { + return getJobForTerminalOperationState(vnfmId, jobId, vnfId, operation); } } diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java index cbf5341d..b78c13a0 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/LifecycleManager.java @@ -43,7 +43,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import static com.google.common.base.Splitter.on; -import static com.google.common.base.Strings.isNullOrEmpty; import static com.google.common.collect.Iterables.find; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Sets.newHashSet; @@ -71,6 +70,7 @@ public class LifecycleManager { * The key of the CBAM VNF extension for the identifier of the VNFM in ONAP */ public static final String EXTERNAL_VNFM_ID = "externalVnfmId"; + public static final String SCALE_OPERATION_NAME = "scale"; private static Logger logger = getLogger(LifecycleManager.class); private final CatalogManager catalogManager; private final IGrantManager grantManager; @@ -135,7 +135,7 @@ public class LifecycleManager { * @return the VNF creation result */ public VnfCreationResult create(String vnfmId, String csarId, String vnfName, String description, AdditionalParameters addtionalParams) { - logOperationInput("not yet specified", "create", addtionalParams); + logOperationInput("not yet specified", "creation", addtionalParams); validateVimType(addtionalParams.getVimType()); try { CatalogAdapterVnfpackage cbamPackage = catalogManager.preparePackageInCbam(vnfmId, csarId); @@ -151,8 +151,8 @@ public class LifecycleManager { } } - private void logOperationInput(String vnfId, String operationName, Object payload){ - if(logger.isInfoEnabled()){ + private void logOperationInput(String vnfId, String operationName, Object payload) { + if (logger.isInfoEnabled()) { logger.info("Starting {} operation on VNF with {} identifier with {} parameter", operationName, vnfId, new Gson().toJson(payload)); } } @@ -169,7 +169,7 @@ public class LifecycleManager { * @return the instantiation response */ public VnfInstantiateResponse instantiate(String vnfmId, VnfInstantiateRequest request, HttpServletResponse httpResponse, AdditionalParameters additionalParameters, String vnfId, String vnfdId) { - logOperationInput(vnfId, "instantiate", request); + logOperationInput(vnfId, "instantiation", request); validateVimType(additionalParameters.getVimType()); VnfInstantiateResponse response = new VnfInstantiateResponse(); response.setVnfInstanceId(vnfId); @@ -219,7 +219,7 @@ public class LifecycleManager { VimInfo vimInfo = vimInfoProvider.getVimInfo(vim.getVimId()); InstantiateVnfRequest instantiationRequest = new InstantiateVnfRequest(); addExternalLinksToRequest(request.getExtVirtualLink(), additionalParameters, instantiationRequest, vimId); - instantiationRequest.getVims().add(addVim(additionalParameters, vimId, vim, vimInfo, instantiationRequest)); + instantiationRequest.getVims().add(addVim(additionalParameters, vimId, vim, vimInfo)); instantiationRequest.setFlavourId(getFlavorId(vnfdContent)); instantiationRequest.setComputeResourceFlavours(additionalParameters.getComputeResourceFlavours()); instantiationRequest.setGrantlessMode(true); @@ -231,17 +231,19 @@ public class LifecycleManager { instantiationRequest.addExtVirtualLinksItem(extVirtualLinkData); } JsonObject root = new Gson().toJsonTree(jobInfo).getAsJsonObject(); - if (additionalParameters.getAdditionalParams() != null && !isNullOrEmpty(additionalParameters.getAdditionalParams().toString())) { + if (additionalParameters.getAdditionalParams() != null) { for (Map.Entry<String, JsonElement> item : new Gson().toJsonTree(additionalParameters.getAdditionalParams()).getAsJsonObject().entrySet()) { root.add(item.getKey(), item.getValue()); } + } else { + logger.warn("No additional parameters were specified for the operation"); } instantiationRequest.setAdditionalParams(root); OperationExecution operationExecution = cbamRestApiProvider.getCbamLcmApi(vnfmId).vnfsVnfInstanceIdInstantiatePost(vnfId, instantiationRequest, NOKIA_LCM_API_VERSION); waitForOperationToFinish(vnfmId, vnfId, operationExecution.getId()); } - private com.nokia.cbam.lcm.v32.model.VimInfo addVim(AdditionalParameters additionalParameters, String vimId, GrantVNFResponseVim vim, VimInfo vimInfo, InstantiateVnfRequest instantiationRequest) { + private com.nokia.cbam.lcm.v32.model.VimInfo addVim(AdditionalParameters additionalParameters, String vimId, GrantVNFResponseVim vim, VimInfo vimInfo) { if (additionalParameters.getVimType() == OPENSTACK_V2_INFO) { return buildOpenStackV2INFO(vimId, vim, vimInfo); @@ -255,7 +257,7 @@ public class LifecycleManager { } private void validateVimType(com.nokia.cbam.lcm.v32.model.VimInfo.VimInfoTypeEnum vimType) { - if(com.nokia.cbam.lcm.v32.model.VimInfo.VimInfoTypeEnum.OTHER_VIM_INFO.equals(vimType)){ + if (com.nokia.cbam.lcm.v32.model.VimInfo.VimInfoTypeEnum.OTHER_VIM_INFO.equals(vimType)) { throw buildFatalFailure(logger, "Only " + OPENSTACK_V2_INFO + ", " + OPENSTACK_V3_INFO + " and " + VMWARE_VCLOUD_INFO + " is the supported VIM types"); } } @@ -517,8 +519,8 @@ public class LifecycleManager { * @return the job for tracking the scale */ public JobInfo scaleVnf(String vnfmId, String vnfId, VnfScaleRequest request, HttpServletResponse httpResponse) { - logOperationInput(vnfId, "scale", request); - return scheduleExecution(vnfId, httpResponse, "scale", jobInfo -> { + logOperationInput(vnfId, SCALE_OPERATION_NAME, request); + return scheduleExecution(vnfId, httpResponse, SCALE_OPERATION_NAME, jobInfo -> { ScaleVnfRequest cbamRequest = new ScaleVnfRequest(); cbamRequest.setAspectId(request.getAspectId()); cbamRequest.setNumberOfSteps(Integer.valueOf(request.getNumberOfSteps())); @@ -527,7 +529,7 @@ public class LifecycleManager { JsonObject root = new Gson().toJsonTree(jobInfo).getAsJsonObject(); com.nokia.cbam.lcm.v32.model.VnfInfo cbamVnfInfo = cbamRestApiProvider.getCbamLcmApi(vnfmId).vnfsVnfInstanceIdGet(vnfId, NOKIA_LCM_API_VERSION); String vnfdContent = catalogManager.getCbamVnfdContent(vnfmId, cbamVnfInfo.getVnfdId()); - Set<String> acceptableOperationParameters = getAcceptableOperationParameters(vnfdContent, "Basic", "scale"); + Set<String> acceptableOperationParameters = getAcceptableOperationParameters(vnfdContent, "Basic", SCALE_OPERATION_NAME); buildAdditionalParameters(request, root, acceptableOperationParameters); cbamRequest.setAdditionalParams(root); grantManager.requestGrantForScale(vnfmId, vnfId, getVimIdFromInstantiationRequest(vnfmId, vnf), getVnfdIdFromModifyableAttributes(vnf), request, jobInfo.getJobId()); diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/notification/LifecycleChangeNotificationManager.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/notification/LifecycleChangeNotificationManager.java index 9ee8cbda..6a31e833 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/notification/LifecycleChangeNotificationManager.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/notification/LifecycleChangeNotificationManager.java @@ -16,9 +16,7 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification; import com.google.common.annotations.VisibleForTesting; -import com.google.common.collect.Iterables; import com.google.common.collect.Ordering; -import com.google.common.collect.Sets; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -37,13 +35,16 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; -import java.util.NoSuchElementException; +import java.util.Optional; import java.util.Set; -import static com.google.common.collect.Iterables.filter; +import static com.google.common.collect.Iterables.find; import static com.google.common.collect.Iterables.tryFind; import static com.google.common.collect.Sets.newConcurrentHashSet; +import static com.google.common.collect.Sets.newHashSet; import static com.nokia.cbam.lcm.v32.model.OperationType.INSTANTIATE; +import static java.util.Optional.empty; +import static java.util.Optional.of; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.buildFatalFailure; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.CbamUtils.childElement; import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.CbamRestApiProvider.NOKIA_LCM_API_VERSION; @@ -80,7 +81,7 @@ public class LifecycleChangeNotificationManager implements ILifecycleChangeNotif /** * < Separates the VNF id and the resource id within a VNF */ - private static final Set<OperationStatus> terminalStatus = Sets.newHashSet(OperationStatus.FINISHED, OperationStatus.FAILED); + private static final Set<OperationStatus> terminalStatus = newHashSet(OperationStatus.FINISHED, OperationStatus.FAILED); private static Logger logger = getLogger(LifecycleChangeNotificationManager.class); private final CbamRestApiProvider restApiProvider; @@ -95,35 +96,37 @@ public class LifecycleChangeNotificationManager implements ILifecycleChangeNotif this.restApiProvider = restApiProvider; } + /** + * @param status the status of the operation + * @return has the operation finished + */ + public static boolean isTerminal(OperationStatus status) { + return terminalStatus.contains(status); + } + @VisibleForTesting static OperationExecution findLastInstantiationBefore(List<OperationExecution> operationExecutions, OperationExecution currentOperation) { - for (OperationExecution opExs : filter(NEWEST_OPERATIONS_FIRST.sortedCopy(operationExecutions), (OperationExecution opex2) -> !opex2.getStartTime().isAfter(currentOperation.getStartTime()))) { - if (INSTANTIATE.equals(opExs.getOperationType()) && - (opExs.getStartTime().toLocalDate().isBefore(currentOperation.getStartTime().toLocalDate()) || - opExs.getStartTime().toLocalDate().isEqual(currentOperation.getStartTime().toLocalDate()) - )) { - return opExs; - } - } - throw new NoSuchElementException(); + return find(NEWEST_OPERATIONS_FIRST.sortedCopy(operationExecutions), (OperationExecution opex2) -> + !opex2.getStartTime().isAfter(currentOperation.getStartTime()) + && INSTANTIATE.equals(opex2.getOperationType())); } @Override - public void handleLcn(VnfLifecycleChangeNotification recievedNotification) { + public void handleLcn(VnfLifecycleChangeNotification receivedNotification) { if (logger.isInfoEnabled()) { - logger.info("Received LCN: " + new Gson().toJson(recievedNotification)); + logger.info("Received LCN: {}", new Gson().toJson(receivedNotification)); } VnfsApi cbamLcmApi = restApiProvider.getCbamLcmApi(driverProperties.getVnfmId()); try { List<VnfInfo> vnfs = cbamLcmApi.vnfsGet(NOKIA_LCM_API_VERSION); - com.google.common.base.Optional<VnfInfo> currentVnf = tryFind(vnfs, vnf -> vnf.getId().equals(recievedNotification.getVnfInstanceId())); - String vnfHeader = "The VNF with " + recievedNotification.getVnfInstanceId() + " identifier"; + com.google.common.base.Optional<VnfInfo> currentVnf = tryFind(vnfs, vnf -> vnf.getId().equals(receivedNotification.getVnfInstanceId())); + String vnfHeader = "The VNF with " + receivedNotification.getVnfInstanceId() + " identifier"; if (!currentVnf.isPresent()) { logger.warn(vnfHeader + " disappeared before being able to process the LCN"); //swallow LCN return; } else { - VnfInfo vnf = cbamLcmApi.vnfsVnfInstanceIdGet(recievedNotification.getVnfInstanceId(), NOKIA_LCN_API_VERSION); + VnfInfo vnf = cbamLcmApi.vnfsVnfInstanceIdGet(receivedNotification.getVnfInstanceId(), NOKIA_LCN_API_VERSION); com.google.common.base.Optional<VnfProperty> externalVnfmId = tryFind(vnf.getExtensions(), prop -> prop.getName().equals(LifecycleManager.EXTERNAL_VNFM_ID)); if (!externalVnfmId.isPresent()) { logger.warn(vnfHeader + " is not a managed VNF"); @@ -139,19 +142,24 @@ public class LifecycleChangeNotificationManager implements ILifecycleChangeNotif } OperationExecutionsApi cbamOperationExecutionApi = restApiProvider.getCbamOperationExecutionApi(driverProperties.getVnfmId()); try { - List<OperationExecution> operationExecutions = cbamLcmApi.vnfsVnfInstanceIdOperationExecutionsGet(recievedNotification.getVnfInstanceId(), NOKIA_LCM_API_VERSION); - OperationExecution operationExecution = cbamOperationExecutionApi.operationExecutionsOperationExecutionIdGet(recievedNotification.getLifecycleOperationOccurrenceId(), NOKIA_LCM_API_VERSION); + List<OperationExecution> operationExecutions = cbamLcmApi.vnfsVnfInstanceIdOperationExecutionsGet(receivedNotification.getVnfInstanceId(), NOKIA_LCM_API_VERSION); + OperationExecution operationExecution = cbamOperationExecutionApi.operationExecutionsOperationExecutionIdGet(receivedNotification.getLifecycleOperationOccurrenceId(), NOKIA_LCM_API_VERSION); OperationExecution closestInstantiationToOperation = findLastInstantiationBefore(operationExecutions, operationExecution); String vimId = getVimId(cbamOperationExecutionApi, closestInstantiationToOperation); - notificationSender.processNotification(recievedNotification, operationExecution, buildAffectedCps(operationExecution), vimId); - if (OperationType.TERMINATE.equals(recievedNotification.getOperation()) && terminalStatus.contains(recievedNotification.getStatus())) { - processedNotifications.add(new ProcessedNotification(recievedNotification.getLifecycleOperationOccurrenceId(), recievedNotification.getStatus())); + notificationSender.processNotification(receivedNotification, operationExecution, buildAffectedCps(operationExecution), vimId); + if (isTerminationFinished(receivedNotification)) { + //signal LifecycleManager to continue the deletion of the VNF + processedNotifications.add(new ProcessedNotification(receivedNotification.getLifecycleOperationOccurrenceId(), receivedNotification.getStatus())); } } catch (ApiException e) { - throw buildFatalFailure(logger, "Unable to retrieve the current VNF " + recievedNotification.getVnfInstanceId(), e); + throw buildFatalFailure(logger, "Unable to retrieve the current VNF " + receivedNotification.getVnfInstanceId(), e); } } + private boolean isTerminationFinished(VnfLifecycleChangeNotification receivedNotification) { + return OperationType.TERMINATE.equals(receivedNotification.getOperation()) && terminalStatus.contains(receivedNotification.getStatus()); + } + private String getVimId(OperationExecutionsApi cbamOperationExecutionApi, OperationExecution closestInstantiationToOperation) { try { Object operationParams = cbamOperationExecutionApi.operationExecutionsOperationExecutionIdOperationParamsGet(closestInstantiationToOperation.getId(), NOKIA_LCM_API_VERSION); @@ -164,7 +172,7 @@ public class LifecycleChangeNotificationManager implements ILifecycleChangeNotif @Override public void waitForTerminationToBeProcessed(String operationExecutionId) { while (true) { - com.google.common.base.Optional<ProcessedNotification> notification = Iterables.tryFind(processedNotifications, processedNotification -> processedNotification.getOperationExecutionId().equals(operationExecutionId)); + com.google.common.base.Optional<ProcessedNotification> notification = tryFind(processedNotifications, processedNotification -> processedNotification.getOperationExecutionId().equals(operationExecutionId)); if (notification.isPresent()) { processedNotifications.remove(notification.get()); return; @@ -178,47 +186,47 @@ public class LifecycleChangeNotificationManager implements ILifecycleChangeNotif return request.getVims().get(0).getId(); } - private ReportedAffectedConnectionPoints buildAffectedCps(OperationExecution operationExecution) { + private Optional<ReportedAffectedConnectionPoints> buildAffectedCps(OperationExecution operationExecution) { if (operationExecution.getOperationType() == OperationType.TERMINATE) { String terminationType = childElement(new Gson().toJsonTree(operationExecution.getOperationParams()).getAsJsonObject(), "terminationType").getAsString(); if (TerminationType.FORCEFUL.name().equals(terminationType)) { //in case of force full termination the Ansible is not executed, so the connection points can not be //calculated from operation execution result logger.warn("Unable to send information related to affected connection points during forceful termination"); - return null; + return empty(); } } try { JsonElement root = new Gson().toJsonTree(operationExecution.getAdditionalData()); if (root.getAsJsonObject().has("operationResult")) { JsonObject operationResult = root.getAsJsonObject().get("operationResult").getAsJsonObject(); - if (!isPresent(operationResult, "cbam_pre") || !isPresent(operationResult, "cbam_post")) { - handleFailure(operationExecution, null); + if (isAbsent(operationResult, "cbam_pre") || + isAbsent(operationResult, "cbam_post")) { + return handleFailure(operationExecution, null); + } else { + return of(new Gson().fromJson(operationResult, ReportedAffectedConnectionPoints.class)); } - return new Gson().fromJson(operationResult, ReportedAffectedConnectionPoints.class); + } else { + return handleFailure(operationExecution, null); } } catch (Exception e) { - handleFailure(operationExecution, e); + return handleFailure(operationExecution, e); } - return new ReportedAffectedConnectionPoints(); } - private boolean isPresent(JsonObject operationResult, String key) { - return operationResult.has(key) && operationResult.get(key).isJsonArray(); + private boolean isAbsent(JsonObject operationResult, String key) { + return !operationResult.has(key) || !operationResult.get(key).isJsonArray(); } - private void handleFailure(OperationExecution operationExecution, Exception e) { - switch (operationExecution.getStatus()) { - case FAILED: - case OTHER: - logger.warn("The operation failed and the affected connection points were not reported"); - break; - case STARTED: //can not happen (the changed resources are only executed for terminal state - case FINISHED: - if (e != null) { - throw buildFatalFailure(logger, PROBLEM, e); - } - throw buildFatalFailure(logger, PROBLEM); + private Optional<ReportedAffectedConnectionPoints> handleFailure(OperationExecution operationExecution, Exception e) { + if (operationExecution.getStatus() == OperationStatus.FAILED) { + logger.warn("The operation failed and the affected connection points were not reported"); + return empty(); + } else { + if (e != null) { + throw buildFatalFailure(logger, PROBLEM, e); + } + throw buildFatalFailure(logger, PROBLEM); } } } |