cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [2/2] git commit: updated refs/heads/master to f2ccee7
Date Tue, 18 Nov 2014 15:53:00 GMT
name convention adherence


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f2ccee7a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f2ccee7a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f2ccee7a

Branch: refs/heads/master
Commit: f2ccee7a030a9e69a3180c30806a35882a3a4293
Parents: 6bc0def
Author: Daan Hoogland <daan@onecht.net>
Authored: Tue Nov 18 16:52:46 2014 +0100
Committer: Daan Hoogland <daan@onecht.net>
Committed: Tue Nov 18 16:52:46 2014 +0100

----------------------------------------------------------------------
 .../configuration/ConfigurationManagerImpl.java     | 16 ++++++++--------
 utils/src/com/cloud/utils/net/NetUtils.java         | 14 +++++++-------
 2 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f2ccee7a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 2cb4203..57b50e6 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2777,17 +2777,17 @@ public class ConfigurationManagerImpl extends ManagerBase implements
Configurati
         });
     }
 
-    public NetUtils.supersetOrSubset checkIfSubsetOrSuperset(String newVlanGateway, String
newVlanNetmask, VlanVO vlan, String startIP, String endIP) {
+    public NetUtils.SupersetOrSubset checkIfSubsetOrSuperset(String newVlanGateway, String
newVlanNetmask, VlanVO vlan, String startIP, String endIP) {
         if (newVlanGateway == null && newVlanNetmask == null) {
             newVlanGateway = vlan.getVlanGateway();
             newVlanNetmask = vlan.getVlanNetmask();
             // this means he is trying to add to the existing subnet.
             if (NetUtils.sameSubnet(startIP, newVlanGateway, newVlanNetmask)) {
                 if (NetUtils.sameSubnet(endIP, newVlanGateway, newVlanNetmask)) {
-                    return NetUtils.supersetOrSubset.sameSubnet;
+                    return NetUtils.SupersetOrSubset.sameSubnet;
                 }
             }
-            return NetUtils.supersetOrSubset.neitherSubetNorSuperset;
+            return NetUtils.SupersetOrSubset.neitherSubetNorSuperset;
         } else if (newVlanGateway == null || newVlanNetmask == null) {
             throw new InvalidParameterValueException(
                     "either both netmask and gateway should be passed or both should me omited.");
@@ -2816,22 +2816,22 @@ public class ConfigurationManagerImpl extends ManagerBase implements
Configurati
                     vlanGateway = vlan.getVlanGateway();
                     vlanNetmask = vlan.getVlanNetmask();
                     // check if subset or super set or neither.
-                    NetUtils.supersetOrSubset val = checkIfSubsetOrSuperset(newVlanGateway,
newVlanNetmask, vlan, startIP, endIP);
-                    if (val == NetUtils.supersetOrSubset.isSuperset) {
+                    NetUtils.SupersetOrSubset val = checkIfSubsetOrSuperset(newVlanGateway,
newVlanNetmask, vlan, startIP, endIP);
+                    if (val == NetUtils.SupersetOrSubset.isSuperset) {
                         // this means that new cidr is a superset of the
                         // existing subnet.
                         throw new InvalidParameterValueException("The subnet you are trying
to add is a superset of the existing subnet having gateway" + vlan.getVlanGateway()
                                 + " and netmask  " + vlan.getVlanNetmask());
-                    } else if (val == NetUtils.supersetOrSubset.neitherSubetNorSuperset)
{
+                    } else if (val == NetUtils.SupersetOrSubset.neitherSubetNorSuperset)
{
                         // this implies the user is trying to add a new subnet
                         // which is not a superset or subset of this subnet.
                         // checking with the other subnets.
                         continue;
-                    } else if (val == NetUtils.supersetOrSubset.isSubset) {
+                    } else if (val == NetUtils.SupersetOrSubset.isSubset) {
                         // this means he is trying to add to the same subnet.
                         throw new InvalidParameterValueException("The subnet you are trying
to add is a subset of the existing subnet having gateway" + vlan.getVlanGateway()
                                 + " and netmask  " + vlan.getVlanNetmask());
-                    } else if (val == NetUtils.supersetOrSubset.sameSubnet) {
+                    } else if (val == NetUtils.SupersetOrSubset.sameSubnet) {
                         sameSubnet = true;
                         //check if the gateway provided by the user is same as that of the
subnet.
                         if (newVlanGateway != null && !newVlanGateway.equals(vlanGateway))
{

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f2ccee7a/utils/src/com/cloud/utils/net/NetUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/net/NetUtils.java b/utils/src/com/cloud/utils/net/NetUtils.java
index 3ce3697..1f41825 100755
--- a/utils/src/com/cloud/utils/net/NetUtils.java
+++ b/utils/src/com/cloud/utils/net/NetUtils.java
@@ -824,17 +824,17 @@ public class NetUtils {
         return new Pair<String, Integer>(tokens[0], Integer.parseInt(tokens[1]));
     }
 
-    public static enum supersetOrSubset {
+    public static enum SupersetOrSubset {
         isSuperset, isSubset, neitherSubetNorSuperset, sameSubnet, errorInCidrFormat
     }
 
-    public static supersetOrSubset isNetowrkASubsetOrSupersetOfNetworkB(String cidrA, String
cidrB) {
+    public static SupersetOrSubset isNetowrkASubsetOrSupersetOfNetworkB(String cidrA, String
cidrB) {
         Long[] cidrALong = cidrToLong(cidrA);
         Long[] cidrBLong = cidrToLong(cidrB);
         long shift = 0;
         if (cidrALong == null || cidrBLong == null) {
             //implies error in the cidr format
-            return supersetOrSubset.errorInCidrFormat;
+            return SupersetOrSubset.errorInCidrFormat;
         }
         if (cidrALong[1] >= cidrBLong[1]) {
             shift = 32 - cidrBLong[1];
@@ -845,16 +845,16 @@ public class NetUtils {
         if (result == 0) {
             if (cidrALong[1] < cidrBLong[1]) {
                 //this implies cidrA is super set of cidrB
-                return supersetOrSubset.isSuperset;
+                return SupersetOrSubset.isSuperset;
             } else if (cidrALong[1].equals(cidrBLong[1])) {
                 //this implies both the cidrs are equal
-                return supersetOrSubset.sameSubnet;
+                return SupersetOrSubset.sameSubnet;
             }
             // implies cidrA is subset of cidrB
-            return supersetOrSubset.isSubset;
+            return SupersetOrSubset.isSubset;
         }
         //this implies no overlap.
-        return supersetOrSubset.neitherSubetNorSuperset;
+        return SupersetOrSubset.neitherSubetNorSuperset;
     }
 
     public static boolean isNetworkAWithinNetworkB(String cidrA, String cidrB) {


Mime
View raw message