aboutsummaryrefslogtreecommitdiffstats
path: root/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/check/AnyVrfPresentCheck.java
diff options
context:
space:
mode:
Diffstat (limited to 'resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/check/AnyVrfPresentCheck.java')
-rw-r--r--resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/check/AnyVrfPresentCheck.java62
1 files changed, 31 insertions, 31 deletions
diff --git a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/check/AnyVrfPresentCheck.java b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/check/AnyVrfPresentCheck.java
index aee761c7..fd9ca1e5 100644
--- a/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/check/AnyVrfPresentCheck.java
+++ b/resource-assignment/provider/src/main/java/org/openecomp/sdnc/ra/check/AnyVrfPresentCheck.java
@@ -3,7 +3,7 @@
* openECOMP : SDN-C
* ================================================================================
* Copyright (C) 2017 ONAP Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,41 +34,41 @@ import org.slf4j.LoggerFactory;
public class AnyVrfPresentCheck implements EquipmentCheck {
- private static final Logger log = LoggerFactory.getLogger(AnyVrfPresentCheck.class);
+ private static final Logger log = LoggerFactory.getLogger(AnyVrfPresentCheck.class);
- private ResourceManager resourceManager;
+ private ResourceManager resourceManager;
- @Override
- public boolean checkEquipment(
- String endPointPosition,
- ServiceData serviceData,
- EquipmentData equipData,
- Map<String, Object> equipmentConstraints) {
- String vrfNameListStr = (String) serviceData.data.get("vrf-name-list");
- if (vrfNameListStr == null)
- vrfNameListStr = (String) serviceData.data.get("vrf-name");
- if (vrfNameListStr == null)
- return true;
+ @Override
+ public boolean checkEquipment(
+ String endPointPosition,
+ ServiceData serviceData,
+ EquipmentData equipData,
+ Map<String, Object> equipmentConstraints) {
+ String vrfNameListStr = (String) serviceData.data.get("vrf-name-list");
+ if (vrfNameListStr == null)
+ vrfNameListStr = (String) serviceData.data.get("vrf-name");
+ if (vrfNameListStr == null)
+ return true;
- String vrfRequiredStr = (String) equipmentConstraints.get("vrf-required");
- if (vrfRequiredStr == null || !vrfRequiredStr.equalsIgnoreCase("true"))
- return true;
+ String vrfRequiredStr = (String) equipmentConstraints.get("vrf-required");
+ if (vrfRequiredStr == null || !vrfRequiredStr.equalsIgnoreCase("true"))
+ return true;
- String[] vrfNameList = vrfNameListStr.split(",");
+ String[] vrfNameList = vrfNameListStr.split(",");
- Resource r = resourceManager.getResource("VRF", equipData.equipmentId);
- if (r != null && r.allocationItems != null)
- for (AllocationItem ai : r.allocationItems)
- for (String vrfName : vrfNameList)
- if (ai.resourceShareGroupList.contains(vrfName))
- return true;
+ Resource r = resourceManager.getResource("VRF", equipData.equipmentId);
+ if (r != null && r.allocationItems != null)
+ for (AllocationItem ai : r.allocationItems)
+ for (String vrfName : vrfNameList)
+ if (ai.resourceShareGroupList.contains(vrfName))
+ return true;
- log.info("Skipping VPE " + equipData.equipmentId +
- ": Existing VRF is required, but there is no existing VRF on the VPE for any of the requested VPNs.");
- return false;
- }
+ log.info("Skipping VPE " + equipData.equipmentId +
+ ": Existing VRF is required, but there is no existing VRF on the VPE for any of the requested VPNs.");
+ return false;
+ }
- public void setResourceManager(ResourceManager resourceManager) {
- this.resourceManager = resourceManager;
- }
+ public void setResourceManager(ResourceManager resourceManager) {
+ this.resourceManager = resourceManager;
+ }
}