diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-03 14:08:10 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-03 14:08:10 -0800 |
commit | 643ee33289bd2cb9e6afbfb09b4ed72d467ba1c2 (patch) | |
tree | c2c376a44a359544fe3d4c45eb0cc0e2ec4a7080 /framework/src/onos/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java | |
parent | 46eeb79b54345bdafb6055b8ee4bad4ce8b01274 (diff) |
This updates ONOS src tree to commit id
03fa5e571cabbd001ddb1598847e1150b11c7333
Change-Id: I13b554026d6f902933e35887d29bd5fdb669c0bd
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java')
-rw-r--r-- | framework/src/onos/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/framework/src/onos/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java b/framework/src/onos/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java index 5e82b7e8..e03b25e8 100644 --- a/framework/src/onos/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java +++ b/framework/src/onos/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java @@ -15,18 +15,9 @@ */ package org.onosproject.virtualbng; -import static com.google.common.base.Preconditions.checkNotNull; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import com.google.common.collect.Maps; - -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; - import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Deactivate; @@ -42,7 +33,6 @@ import org.onosproject.core.CoreService; import org.onosproject.net.ConnectPoint; import org.onosproject.net.DeviceId; import org.onosproject.net.Host; -import org.onosproject.net.PortNumber; import org.onosproject.net.flow.DefaultTrafficSelector; import org.onosproject.net.flow.DefaultTrafficTreatment; import org.onosproject.net.flow.TrafficSelector; @@ -56,6 +46,13 @@ import org.onosproject.net.intent.PointToPointIntent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; + +import static com.google.common.base.Preconditions.checkNotNull; + /** * This is a virtual Broadband Network Gateway (BNG) application. It mainly * has 3 functions: @@ -111,9 +108,8 @@ public class VbngManager implements VbngService { p2pIntentsToHost = new ConcurrentHashMap<>(); privateIpAddressMap = new ConcurrentHashMap<>(); - setupMap(); - nextHopIpAddress = vbngConfigurationService.getNextHopIpAddress(); + nodeToPort = vbngConfigurationService.getNodeToPort(); hostListener = new InternalHostListener(); hostService.addListener(hostListener); @@ -136,10 +132,16 @@ public class VbngManager implements VbngService { */ private void statusRecovery() { log.info("vBNG starts to recover from XOS record......"); - RestClient restClient = - new RestClient(vbngConfigurationService.getXosIpAddress(), - vbngConfigurationService.getXosRestPort()); - ObjectNode map = restClient.getRest(); + ObjectNode map; + try { + RestClient restClient = + new RestClient(vbngConfigurationService.getXosIpAddress(), + vbngConfigurationService.getXosRestPort()); + map = restClient.getRest(); + } catch (Exception e) { + log.error("Could not contact XOS", e); + return; + } if (map == null) { log.info("Stop to recover vBNG status due to the vBNG map " + "is null!"); @@ -168,21 +170,6 @@ public class VbngManager implements VbngService { } /** - * Sets up mapping from hostname to connect point. - */ - private void setupMap() { - nodeToPort = Maps.newHashMap(); - - nodeToPort.put("cordcompute01.onlab.us", - new ConnectPoint(FABRIC_DEVICE_ID, - PortNumber.portNumber(48))); - - nodeToPort.put("cordcompute02.onlab.us", - new ConnectPoint(FABRIC_DEVICE_ID, - PortNumber.portNumber(47))); - } - - /** * Creates a new vBNG. * * @param privateIpAddress a private IP address |