aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/floatingip
diff options
context:
space:
mode:
authorAshlee Young <ashlee@wildernessvoice.com>2015-12-06 07:15:03 -0800
committerAshlee Young <ashlee@wildernessvoice.com>2015-12-08 10:55:21 -0800
commit76dc892491948adae5e5e62cf94448967e8d865b (patch)
tree7a33ef05cc583946db21edad627060f280a53549 /framework/src/onos/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/floatingip
parentd333c63fdec8b064184b0a26f8d777f267577fde (diff)
Fixes bad POM file with ONOS commit 8c68536972f63069c263635c9d9f4f31d7f3e9a2
Change-Id: I7adb5a2d3738d53dbc41db7577768b0e7ced5450 Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/floatingip')
-rw-r--r--framework/src/onos/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/floatingip/impl/FloatingIpManager.java59
1 files changed, 27 insertions, 32 deletions
diff --git a/framework/src/onos/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/floatingip/impl/FloatingIpManager.java b/framework/src/onos/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/floatingip/impl/FloatingIpManager.java
index 9f944da1..ce9bb21f 100644
--- a/framework/src/onos/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/floatingip/impl/FloatingIpManager.java
+++ b/framework/src/onos/apps/vtn/vtnrsc/src/main/java/org/onosproject/vtnrsc/floatingip/impl/FloatingIpManager.java
@@ -202,27 +202,24 @@ public class FloatingIpManager implements FloatingIpService {
public boolean updateFloatingIps(Collection<FloatingIp> floatingIps) {
checkNotNull(floatingIps, FLOATINGIP_NOT_NULL);
boolean result = true;
- if (floatingIps != null) {
- for (FloatingIp floatingIp : floatingIps) {
- verifyFloatingIpData(floatingIp);
- if (floatingIp.portId() != null) {
- floatingIpStore.put(floatingIp.id(), floatingIp);
- if (!floatingIpStore.containsKey(floatingIp.id())) {
+ for (FloatingIp floatingIp : floatingIps) {
+ verifyFloatingIpData(floatingIp);
+ if (floatingIp.portId() != null) {
+ floatingIpStore.put(floatingIp.id(), floatingIp);
+ if (!floatingIpStore.containsKey(floatingIp.id())) {
+ log.debug("The floating Ip is updated failed whose identifier is {}",
+ floatingIp.id().toString());
+ result = false;
+ }
+ } else {
+ FloatingIp oldFloatingIp = floatingIpStore.get(floatingIp.id());
+ if (oldFloatingIp != null) {
+ floatingIpStore.remove(floatingIp.id(), oldFloatingIp);
+ if (floatingIpStore.containsKey(floatingIp.id())) {
log.debug("The floating Ip is updated failed whose identifier is {}",
floatingIp.id().toString());
result = false;
}
- } else {
- FloatingIp oldFloatingIp = floatingIpStore.get(floatingIp
- .id());
- if (oldFloatingIp != null) {
- floatingIpStore.remove(floatingIp.id(), oldFloatingIp);
- if (floatingIpStore.containsKey(floatingIp.id())) {
- log.debug("The floating Ip is updated failed whose identifier is {}",
- floatingIp.id().toString());
- result = false;
- }
- }
}
}
}
@@ -233,21 +230,19 @@ public class FloatingIpManager implements FloatingIpService {
public boolean removeFloatingIps(Collection<FloatingIpId> floatingIpIds) {
checkNotNull(floatingIpIds, FLOATINGIP_ID_NOT_NULL);
boolean result = true;
- if (floatingIpIds != null) {
- for (FloatingIpId floatingIpId : floatingIpIds) {
- if (!floatingIpStore.containsKey(floatingIpId)) {
- log.debug("The floatingIp is not exist whose identifier is {}",
- floatingIpId.toString());
- throw new IllegalArgumentException(
- "FloatingIP ID doesn't exist");
- }
- FloatingIp floatingIp = floatingIpStore.get(floatingIpId);
- floatingIpStore.remove(floatingIpId, floatingIp);
- if (floatingIpStore.containsKey(floatingIpId)) {
- log.debug("The floating Ip is deleted failed whose identifier is {}",
- floatingIpId.toString());
- result = false;
- }
+ for (FloatingIpId floatingIpId : floatingIpIds) {
+ if (!floatingIpStore.containsKey(floatingIpId)) {
+ log.debug("The floatingIp is not exist whose identifier is {}",
+ floatingIpId.toString());
+ throw new IllegalArgumentException(
+ "FloatingIP ID doesn't exist");
+ }
+ FloatingIp floatingIp = floatingIpStore.get(floatingIpId);
+ floatingIpStore.remove(floatingIpId, floatingIp);
+ if (floatingIpStore.containsKey(floatingIpId)) {
+ log.debug("The floating Ip is deleted failed whose identifier is {}",
+ floatingIpId.toString());
+ result = false;
}
}
return result;