Repository: stratos
Updated Branches:
  refs/heads/stratos-4.1.x bd15da630 -> 838c31f0d


Adding condition to check network partition properties availability


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

Branch: refs/heads/stratos-4.1.x
Commit: 838c31f0d64bada1c9321f679b6303d0a4d7e535
Parents: bd15da6
Author: Imesh Gunaratne <[email protected]>
Authored: Tue Oct 13 15:45:47 2015 +0530
Committer: Imesh Gunaratne <[email protected]>
Committed: Tue Oct 13 15:45:47 2015 +0530

----------------------------------------------------------------------
 .../impl/CloudControllerServiceImpl.java        | 24 ++++++++++++--------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/838c31f0/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
index d9449b2..0fe5e48 100644
--- 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
+++ 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
@@ -35,7 +35,7 @@ import 
org.apache.stratos.cloud.controller.messaging.topology.TopologyManager;
 import org.apache.stratos.cloud.controller.services.CloudControllerService;
 import org.apache.stratos.cloud.controller.util.CloudControllerConstants;
 import org.apache.stratos.cloud.controller.util.CloudControllerUtil;
-import org.apache.stratos.common.Property;
+import org.apache.stratos.common.*;
 import org.apache.stratos.common.domain.LoadBalancingIPType;
 import org.apache.stratos.common.threading.StratosThreadPool;
 import org.apache.stratos.messaging.domain.topology.*;
@@ -43,6 +43,7 @@ import 
org.wso2.carbon.registry.core.exceptions.RegistryException;
 
 import java.util.*;
 import java.util.Map.Entry;
+import java.util.Properties;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
@@ -1144,15 +1145,18 @@ public class CloudControllerServiceImpl implements 
CloudControllerService {
                         throw new 
CloudControllerException(String.format("Network partition not found: 
[application] %s " +
                                 "[network-partition] %s", applicationId, 
networkPartitionId));
                     }
-                    ipListProperty = networkPartition.getProperties().
-                            
getProperty(CloudControllerConstants.LOAD_BALANCER_IPS);
-                    if (ipListProperty != null) {
-                        log.debug(String.format("Load balancer IP list found 
in network partition: " +
-                                        "[application] %s [cluster] %s 
[load-balancer-ip-list] %s", applicationId,
-                                clusterId, ipListProperty.getValue()));
-                        String[] ipArray = 
ipListProperty.getValue().split(",");
-                        for(String ip : ipArray) {
-                            loadBalancerIps.add(ip);
+
+                    org.apache.stratos.common.Properties properties = 
networkPartition.getProperties();
+                    if(properties != null) {
+                        ipListProperty = 
properties.getProperty(CloudControllerConstants.LOAD_BALANCER_IPS);
+                        if (ipListProperty != null) {
+                            log.debug(String.format("Load balancer IP list 
found in network partition: " +
+                                            "[application] %s [cluster] %s 
[load-balancer-ip-list] %s", applicationId,
+                                    clusterId, ipListProperty.getValue()));
+                            String[] ipArray = 
ipListProperty.getValue().split(",");
+                            for (String ip : ipArray) {
+                                loadBalancerIps.add(ip);
+                            }
                         }
                     }
                 }

Reply via email to