DaanHoogland commented on a change in pull request #2193: CLOUDSTACK-10007 
Isolation methods
URL: https://github.com/apache/cloudstack/pull/2193#discussion_r129068941
 
 

 ##########
 File path: api/src/com/cloud/network/PhysicalNetwork.java
 ##########
 @@ -32,8 +35,82 @@
         Disabled, Enabled;
     }
 
-    public enum IsolationMethod {
-        VLAN, L3, GRE, STT, BCF_SEGMENT, MIDO, SSP, VXLAN, ODL, L3VPN, VSP, 
VCS;
+    public class IsolationMethod {
+        protected static final String UNKNOWN_PROVIDER = "Unknown";
+        private static Set<IsolationMethod> registeredIsolationMethods = new 
HashSet<>();
+
+        /**
+         * gets a IsolationMethod object that defines this prefix and if any 
it returns the first one found that has a known provider. If none has a known 
provider
+         * it will return the one with the unknown provider. if none is found 
it return null.
+         *
+         * @param prfx
+         * @return
+         */
+        public static IsolationMethod getIsolationMethod(String prfx) {
+            IsolationMethod rc = null;
+            for (IsolationMethod method: registeredIsolationMethods) {
+                if (method.provider.equals(prfx)) {
 
 Review comment:
   good catch, should have passed any unit test :(
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to