cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [47/48] git commit: updated refs/heads/4.9-bountycastle-daan to 98bf0ca
Date Tue, 24 May 2016 09:49:52 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98bf0ca1/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
index 461b267..15fbdeb 100644
--- a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
+++ b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java
@@ -175,7 +175,7 @@ public class NetscalerResource implements ServerResource {
     }
 
     @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
+    public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
         try {
             _name = (String)params.get("name");
             if (_name == null) {
@@ -231,7 +231,7 @@ public class NetscalerResource implements ServerResource {
 
             _isSdx = _deviceName.equalsIgnoreCase("NetscalerSDXLoadBalancer");
 
-            if (((String)params.get("cloudmanaged")) != null) {
+            if ((String)params.get("cloudmanaged") != null) {
                 _cloudManaged = Boolean.parseBoolean((String)params.get("cloudmanaged"));
             }
 
@@ -259,7 +259,7 @@ public class NetscalerResource implements ServerResource {
             }
 
             return true;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new ConfigurationException(e.getMessage());
         }
     }
@@ -275,7 +275,7 @@ public class NetscalerResource implements ServerResource {
                     _netscalerSdxService.logout();
                 }
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             // Ignore logout exceptions
         }
     }
@@ -297,15 +297,15 @@ public class NetscalerResource implements ServerResource {
             } else {
                 _netscalerSdxService = new com.citrix.sdx.nitro.service.nitro_service(_ip, "https");
                 _netscalerSdxService.set_credential(_username, _password);
-                com.citrix.sdx.nitro.resource.base.login login = _netscalerSdxService.login();
+                final com.citrix.sdx.nitro.resource.base.login login = _netscalerSdxService.login();
                 if (login == null) {
                     throw new ExecutionException("Failed to log in to Netscaler SDX device at " + _ip + " due to error " + apiCallResult.errorcode + " and message " +
                             apiCallResult.message);
                 }
             }
-        } catch (nitro_exception e) {
+        } catch (final nitro_exception e) {
             throw new ExecutionException("Failed to log in to Netscaler device at " + _ip + " due to " + e.getMessage());
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new ExecutionException("Failed to log in to Netscaler device at " + _ip + " due to " + e.getMessage());
         }
     }
@@ -315,9 +315,9 @@ public class NetscalerResource implements ServerResource {
             return;
         }
         try {
-            String[] features = _netscalerService.get_enabled_features();
+            final String[] features = _netscalerService.get_enabled_features();
             if (features != null) {
-                for (String feature : features) {
+                for (final String feature : features) {
                     if (feature.equalsIgnoreCase("LB")) {
                         return;
                     }
@@ -325,56 +325,56 @@ public class NetscalerResource implements ServerResource {
             }
 
             // enable load balancing on the device
-            String[] feature = new String[1];
+            final String[] feature = new String[1];
             feature[0] = "LB";
             apiCallResult = _netscalerService.enable_features(feature);
             if (apiCallResult.errorcode != 0) {
                 throw new ExecutionException("Enabling load balancing feature on the device failed.");
             }
-        } catch (nitro_exception e) {
+        } catch (final nitro_exception e) {
             throw new ExecutionException("Enabling load balancing feature on the device failed  due to " + e.getMessage());
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new ExecutionException("Enabling load balancing feature on the device failed due to " + e.getMessage());
         }
     }
 
-    private void validateInterfaces(String publicInterface, String privateInterface) throws ExecutionException {
+    private void validateInterfaces(final String publicInterface, final String privateInterface) throws ExecutionException {
         try {
             if (!_isSdx && !_cloudManaged) {
-                Interface publicIf = Interface.get(_netscalerService, publicInterface);
-                Interface privateIf = Interface.get(_netscalerService, privateInterface);
+                final Interface publicIf = Interface.get(_netscalerService, publicInterface);
+                final Interface privateIf = Interface.get(_netscalerService, privateInterface);
                 if (publicIf != null || privateIf != null) {
                     return;
                 } else {
                     throw new ExecutionException("Invalid interface name specified for public/private interfaces.");
                 }
             }
-        } catch (nitro_exception e) {
+        } catch (final nitro_exception e) {
             if (e.getErrorCode() == NitroError.NS_RESOURCE_NOT_EXISTS) {
                 throw new ExecutionException("Invalid interface name specified for public and private interfaces.");
             } else {
                 throw new ExecutionException("Failed to verify public interface and private intefaces are valid due to " + e.getMessage());
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new ExecutionException("Failed to verify public interface and private intefaces are valid due to " + e.getMessage());
         }
     }
 
-    private void validateDeviceType(String deviceType) throws ExecutionException {
+    private void validateDeviceType(final String deviceType) throws ExecutionException {
         try {
             if (!_isSdx && !_cloudManaged) {
-                nshardware nsHw = com.citrix.netscaler.nitro.resource.config.ns.nshardware.get(_netscalerService);
+                final nshardware nsHw = com.citrix.netscaler.nitro.resource.config.ns.nshardware.get(_netscalerService);
                 if (nsHw == null) {
                     throw new ExecutionException("Failed to get the hardware description of the Netscaler device at " + _ip);
                 } else {
-                    if ((_deviceName.equalsIgnoreCase("NetscalerMPXLoadBalancer") && nsHw.get_hwdescription().contains("MPX")) ||
-                            (_deviceName.equalsIgnoreCase("NetscalerVPXLoadBalancer") && nsHw.get_hwdescription().contains("NetScaler Virtual Appliance"))) {
+                    if (_deviceName.equalsIgnoreCase("NetscalerMPXLoadBalancer") && nsHw.get_hwdescription().contains("MPX") ||
+                            _deviceName.equalsIgnoreCase("NetscalerVPXLoadBalancer") && nsHw.get_hwdescription().contains("NetScaler Virtual Appliance")) {
                         return;
                     }
                     throw new ExecutionException("Netscalar device type specified does not match with the actuall device type.");
                 }
             } else if (_isSdx) {
-                mps serviceVM = mps.get(_netscalerSdxService);
+                final mps serviceVM = mps.get(_netscalerSdxService);
                 if (serviceVM != null) {
                     if (serviceVM.get_platform().contains("SDX") || serviceVM.get_product().contains("SDX")) {
                         return;
@@ -385,14 +385,14 @@ public class NetscalerResource implements ServerResource {
                     throw new ExecutionException("Failed to get the hardware details of the Netscaler device at " + _ip);
                 }
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new ExecutionException("Failed to verify device type specified when matching with actuall device type due to " + e.getMessage());
         }
     }
 
     @Override
     public StartupCommand[] initialize() {
-        StartupExternalLoadBalancerCommand cmd = new StartupExternalLoadBalancerCommand();
+        final StartupExternalLoadBalancerCommand cmd = new StartupExternalLoadBalancerCommand();
         cmd.setName(_name);
         cmd.setDataCenter(_zoneId);
         cmd.setPod("");
@@ -404,11 +404,11 @@ public class NetscalerResource implements ServerResource {
     }
 
     @Override
-    public Answer executeRequest(Command cmd) {
+    public Answer executeRequest(final Command cmd) {
         return executeRequest(cmd, _numRetries);
     }
 
-    private Answer executeRequest(Command cmd, int numRetries) {
+    private Answer executeRequest(final Command cmd, final int numRetries) {
         if (cmd instanceof ReadyCommand) {
             return execute((ReadyCommand)cmd);
         } else if (cmd instanceof MaintainCommand) {
@@ -434,27 +434,27 @@ public class NetscalerResource implements ServerResource {
         }
     }
 
-    private Answer execute(ReadyCommand cmd) {
+    private Answer execute(final ReadyCommand cmd) {
         return new ReadyAnswer(cmd);
     }
 
-    protected Answer execute(MaintainCommand cmd) {
+    protected Answer execute(final MaintainCommand cmd) {
         return new MaintainAnswer(cmd);
     }
 
-    private synchronized Answer execute(IpAssocCommand cmd, int numRetries) {
+    private synchronized Answer execute(final IpAssocCommand cmd, final int numRetries) {
         if (_isSdx) {
             return Answer.createUnsupportedCommandAnswer(cmd);
         }
 
-        String[] results = new String[cmd.getIpAddresses().length];
+        final String[] results = new String[cmd.getIpAddresses().length];
         int i = 0;
         try {
-            IpAddressTO[] ips = cmd.getIpAddresses();
-            for (IpAddressTO ip : ips) {
-                long guestVlanTag = Long.parseLong(ip.getBroadcastUri());
-                String vlanSelfIp = ip.getVlanGateway();
-                String vlanNetmask = ip.getVlanNetmask();
+            final IpAddressTO[] ips = cmd.getIpAddresses();
+            for (final IpAddressTO ip : ips) {
+                final long guestVlanTag = Long.parseLong(ip.getBroadcastUri());
+                final String vlanSelfIp = ip.getVlanGateway();
+                final String vlanNetmask = ip.getVlanNetmask();
 
                 if (ip.isAdd()) {
                     // Add a new guest VLAN and its subnet and bind it to private interface
@@ -466,12 +466,12 @@ public class NetscalerResource implements ServerResource {
 
                 saveConfiguration();
                 results[i++] = ip.getPublicIp() + " - success";
-                String action = ip.isAdd() ? "associate" : "remove";
+                final String action = ip.isAdd() ? "associate" : "remove";
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug("Netscaler load balancer " + _ip + " successfully executed IPAssocCommand to " + action + " IP " + ip);
                 }
             }
-        } catch (ExecutionException e) {
+        } catch (final ExecutionException e) {
             s_logger.error("Netscaler loadbalancer " + _ip + " failed to execute IPAssocCommand due to " + e.getMessage());
             if (shouldRetry(numRetries)) {
                 return retry(cmd, numRetries);
@@ -483,33 +483,33 @@ public class NetscalerResource implements ServerResource {
         return new IpAssocAnswer(cmd, results);
     }
 
-    private Answer execute(HealthCheckLBConfigCommand cmd, int numRetries) {
+    private Answer execute(final HealthCheckLBConfigCommand cmd, final int numRetries) {
 
-        List<LoadBalancerTO> hcLB = new ArrayList<LoadBalancerTO>();
+        final List<LoadBalancerTO> hcLB = new ArrayList<LoadBalancerTO>();
         try {
 
             if (_isSdx) {
                 return Answer.createUnsupportedCommandAnswer(cmd);
             }
 
-            LoadBalancerTO[] loadBalancers = cmd.getLoadBalancers();
+            final LoadBalancerTO[] loadBalancers = cmd.getLoadBalancers();
 
             if (loadBalancers == null) {
                 return new HealthCheckLBConfigAnswer(hcLB);
             }
 
-            for (LoadBalancerTO loadBalancer : loadBalancers) {
-                HealthCheckPolicyTO[] healthCheckPolicies = loadBalancer.getHealthCheckPolicies();
-                if ((healthCheckPolicies != null) && (healthCheckPolicies.length > 0) && (healthCheckPolicies[0] != null)) {
-                    String nsVirtualServerName = generateNSVirtualServerName(loadBalancer.getSrcIp(), loadBalancer.getSrcPort());
+            for (final LoadBalancerTO loadBalancer : loadBalancers) {
+                final HealthCheckPolicyTO[] healthCheckPolicies = loadBalancer.getHealthCheckPolicies();
+                if (healthCheckPolicies != null && healthCheckPolicies.length > 0 && healthCheckPolicies[0] != null) {
+                    final String nsVirtualServerName = generateNSVirtualServerName(loadBalancer.getSrcIp(), loadBalancer.getSrcPort());
 
-                    com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding[] serviceBindings =
+                    final com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding[] serviceBindings =
                             com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding.get(_netscalerService, nsVirtualServerName);
 
                     if (serviceBindings != null) {
-                        for (DestinationTO destination : loadBalancer.getDestinations()) {
-                            String nsServiceName = generateNSServiceName(destination.getDestIp(), destination.getDestPort());
-                            for (com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding binding : serviceBindings) {
+                        for (final DestinationTO destination : loadBalancer.getDestinations()) {
+                            final String nsServiceName = generateNSServiceName(destination.getDestIp(), destination.getDestPort());
+                            for (final com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding binding : serviceBindings) {
                                 if (nsServiceName.equalsIgnoreCase(binding.get_servicename())) {
                                     destination.setMonitorState(binding.get_curstate());
                                     break;
@@ -521,14 +521,14 @@ public class NetscalerResource implements ServerResource {
                 }
             }
 
-        } catch (ExecutionException e) {
+        } catch (final ExecutionException e) {
             s_logger.error("Failed to execute HealthCheckLBConfigCommand due to ", e);
             if (shouldRetry(numRetries)) {
                 return retry(cmd, numRetries);
             } else {
                 return new HealthCheckLBConfigAnswer(hcLB);
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             s_logger.error("Failed to execute HealthCheckLBConfigCommand due to ", e);
             if (shouldRetry(numRetries)) {
                 return retry(cmd, numRetries);
@@ -539,25 +539,25 @@ public class NetscalerResource implements ServerResource {
         return new HealthCheckLBConfigAnswer(hcLB);
     }
 
-    private synchronized Answer execute(LoadBalancerConfigCommand cmd, int numRetries) {
+    private synchronized Answer execute(final LoadBalancerConfigCommand cmd, final int numRetries) {
         try {
             if (_isSdx) {
                 return Answer.createUnsupportedCommandAnswer(cmd);
             }
 
-            LoadBalancerTO[] loadBalancers = cmd.getLoadBalancers();
+            final LoadBalancerTO[] loadBalancers = cmd.getLoadBalancers();
             if (loadBalancers == null) {
                 return new Answer(cmd);
             }
 
-            for (LoadBalancerTO loadBalancer : loadBalancers) {
-                String srcIp = loadBalancer.getSrcIp();
-                int srcPort = loadBalancer.getSrcPort();
-                String lbProtocol = getNetScalerProtocol(loadBalancer);
-                String lbAlgorithm = loadBalancer.getAlgorithm();
-                String nsVirtualServerName = generateNSVirtualServerName(srcIp, srcPort);
-                String nsMonitorName = generateNSMonitorName(srcIp, srcPort);
-                LbSslCert sslCert = loadBalancer.getSslCert();
+            for (final LoadBalancerTO loadBalancer : loadBalancers) {
+                final String srcIp = loadBalancer.getSrcIp();
+                final int srcPort = loadBalancer.getSrcPort();
+                final String lbProtocol = getNetScalerProtocol(loadBalancer);
+                final String lbAlgorithm = loadBalancer.getAlgorithm();
+                final String nsVirtualServerName = generateNSVirtualServerName(srcIp, srcPort);
+                final String nsMonitorName = generateNSMonitorName(srcIp, srcPort);
+                final LbSslCert sslCert = loadBalancer.getSslCert();
 
                 if (loadBalancer.isAutoScaleVmGroupTO()) {
                     applyAutoScaleConfig(loadBalancer);
@@ -568,7 +568,7 @@ public class NetscalerResource implements ServerResource {
                 boolean deleteMonitor = false;
                 boolean destinationsToAdd = false;
                 boolean deleteCert = false;
-                for (DestinationTO destination : loadBalancer.getDestinations()) {
+                for (final DestinationTO destination : loadBalancer.getDestinations()) {
                     if (!destination.isRevoked()) {
                         destinationsToAdd = true;
                         break;
@@ -584,10 +584,10 @@ public class NetscalerResource implements ServerResource {
                     }
 
                     // create a new monitor
-                    HealthCheckPolicyTO[] healthCheckPolicies = loadBalancer.getHealthCheckPolicies();
-                    if ((healthCheckPolicies != null) && (healthCheckPolicies.length > 0) && (healthCheckPolicies[0] != null)) {
+                    final HealthCheckPolicyTO[] healthCheckPolicies = loadBalancer.getHealthCheckPolicies();
+                    if (healthCheckPolicies != null && healthCheckPolicies.length > 0 && healthCheckPolicies[0] != null) {
 
-                        for (HealthCheckPolicyTO healthCheckPolicyTO : healthCheckPolicies) {
+                        for (final HealthCheckPolicyTO healthCheckPolicyTO : healthCheckPolicies) {
                             if (!healthCheckPolicyTO.isRevoked()) {
                                 addLBMonitor(nsMonitorName, lbProtocol, healthCheckPolicyTO);
                                 hasMonitor = true;
@@ -599,27 +599,27 @@ public class NetscalerResource implements ServerResource {
 
                     }
 
-                    for (DestinationTO destination : loadBalancer.getDestinations()) {
+                    for (final DestinationTO destination : loadBalancer.getDestinations()) {
 
-                        String nsServerName = generateNSServerName(destination.getDestIp());
-                        String nsServiceName = generateNSServiceName(destination.getDestIp(), destination.getDestPort());
+                        final String nsServerName = generateNSServerName(destination.getDestIp());
+                        final String nsServiceName = generateNSServiceName(destination.getDestIp(), destination.getDestPort());
                         if (!destination.isRevoked()) {
                             // add a new destination to deployed load balancing rule
 
                             // add a new server
                             if (!nsServerExists(nsServerName)) {
-                                com.citrix.netscaler.nitro.resource.config.basic.server nsServer = new com.citrix.netscaler.nitro.resource.config.basic.server();
+                                final com.citrix.netscaler.nitro.resource.config.basic.server nsServer = new com.citrix.netscaler.nitro.resource.config.basic.server();
                                 nsServer.set_name(nsServerName);
                                 nsServer.set_ipaddress(destination.getDestIp());
                                 apiCallResult = com.citrix.netscaler.nitro.resource.config.basic.server.add(_netscalerService, nsServer);
-                                if ((apiCallResult.errorcode != 0) && (apiCallResult.errorcode != NitroError.NS_RESOURCE_EXISTS)) {
+                                if (apiCallResult.errorcode != 0 && apiCallResult.errorcode != NitroError.NS_RESOURCE_EXISTS) {
                                     throw new ExecutionException("Failed to add server " + destination.getDestIp() + " due to" + apiCallResult.message);
                                 }
                             }
 
                             // create a new service using the server added
                             if (!nsServiceExists(nsServiceName)) {
-                                com.citrix.netscaler.nitro.resource.config.basic.service newService = new com.citrix.netscaler.nitro.resource.config.basic.service();
+                                final com.citrix.netscaler.nitro.resource.config.basic.service newService = new com.citrix.netscaler.nitro.resource.config.basic.service();
                                 newService.set_name(nsServiceName);
                                 newService.set_port(destination.getDestPort());
                                 newService.set_servername(nsServerName);
@@ -639,7 +639,7 @@ public class NetscalerResource implements ServerResource {
 
                             //bind service to load balancing virtual server
                             if (!nsServiceBindingExists(nsVirtualServerName, nsServiceName)) {
-                                com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding svcBinding =
+                                final com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding svcBinding =
                                         new com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding();
                                 svcBinding.set_name(nsVirtualServerName);
                                 svcBinding.set_servicename(nsServiceName);
@@ -695,7 +695,7 @@ public class NetscalerResource implements ServerResource {
                                                 try (final PemWriter pemWriter = new PemWriter(textWriter);) {
                                                     pemWriter.writeObject(pemObject);
                                                     pemWriter.flush();
-                                                } catch (IOException e) {
+                                                } catch (final IOException e) {
                                                     if (s_logger.isDebugEnabled())
                                                     {
                                                         s_logger.debug("couldn't write PEM to a string", e);
@@ -727,7 +727,7 @@ public class NetscalerResource implements ServerResource {
                                             SSL.uploadKey(_ip, _username, _password, keyFilename, sslCert.getKey().getBytes());
                                             SSL.createSslCertKey(_netscalerService, certFilename, keyFilename, certKeyName, sslCert.getPassword());
                                         }
-                                    } catch (IOException e) {
+                                    } catch (final IOException e) {
                                         if (s_logger.isDebugEnabled())
                                         {
                                             s_logger.debug("couldn't open buffer for certificate", e);
@@ -750,10 +750,10 @@ public class NetscalerResource implements ServerResource {
 
                         } else {
                             // remove a destination from the deployed load balancing rule
-                            com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding[] serviceBindings =
+                            final com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding[] serviceBindings =
                                     com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding.get(_netscalerService, nsVirtualServerName);
                             if (serviceBindings != null) {
-                                for (com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding binding : serviceBindings) {
+                                for (final com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding binding : serviceBindings) {
                                     if (nsServiceName.equalsIgnoreCase(binding.get_servicename())) {
                                         // delete the binding
                                         apiCallResult = com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding.delete(_netscalerService, binding);
@@ -772,8 +772,8 @@ public class NetscalerResource implements ServerResource {
                                         }
 
                                         // delete the server if there is no associated services
-                                        server_service_binding[] services = server_service_binding.get(_netscalerService, nsServerName);
-                                        if ((services == null) || (services.length == 0)) {
+                                        final server_service_binding[] services = server_service_binding.get(_netscalerService, nsServerName);
+                                        if (services == null || services.length == 0) {
                                             apiCallResult = com.citrix.netscaler.nitro.resource.config.basic.server.delete(_netscalerService, nsServerName);
                                             if (apiCallResult.errorcode != 0) {
                                                 throw new ExecutionException("Failed to remove server:" + nsServerName + " due to " + apiCallResult.message);
@@ -786,24 +786,24 @@ public class NetscalerResource implements ServerResource {
                     }
                 } else {
                     // delete the implemented load balancing rule and its destinations
-                    lbvserver lbserver = getVirtualServerIfExisits(nsVirtualServerName);
+                    final lbvserver lbserver = getVirtualServerIfExisits(nsVirtualServerName);
                     if (lbserver != null) {
                         //unbind the all services associated with this virtual server
-                        com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding[] serviceBindings =
+                        final com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding[] serviceBindings =
                                 com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding.get(_netscalerService, nsVirtualServerName);
 
                         if (serviceBindings != null) {
-                            for (com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding binding : serviceBindings) {
-                                String serviceName = binding.get_servicename();
+                            for (final com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding binding : serviceBindings) {
+                                final String serviceName = binding.get_servicename();
                                 apiCallResult = com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding.delete(_netscalerService, binding);
                                 if (apiCallResult.errorcode != 0) {
                                     throw new ExecutionException("Failed to unbind service from the lb virtual server: " + nsVirtualServerName + " due to " +
                                             apiCallResult.message);
                                 }
 
-                                com.citrix.netscaler.nitro.resource.config.basic.service svc =
+                                final com.citrix.netscaler.nitro.resource.config.basic.service svc =
                                         com.citrix.netscaler.nitro.resource.config.basic.service.get(_netscalerService, serviceName);
-                                String nsServerName = svc.get_servername();
+                                final String nsServerName = svc.get_servername();
 
                                 // check if service is bound to any other virtual server
                                 if (!isServiceBoundToVirtualServer(serviceName)) {
@@ -815,8 +815,8 @@ public class NetscalerResource implements ServerResource {
                                 }
 
                                 //delete the server if no more services attached
-                                server_service_binding[] services = server_service_binding.get(_netscalerService, nsServerName);
-                                if ((services == null) || (services.length == 0)) {
+                                final server_service_binding[] services = server_service_binding.get(_netscalerService, nsServerName);
+                                if (services == null || services.length == 0) {
                                     apiCallResult = com.citrix.netscaler.nitro.resource.config.basic.server.delete(_netscalerService, nsServerName);
                                     if (apiCallResult.errorcode != 0) {
                                         throw new ExecutionException("Failed to remove server:" + nsServerName + " due to " + apiCallResult.message);
@@ -834,9 +834,9 @@ public class NetscalerResource implements ServerResource {
                 }
                 if (sslCert != null && deleteCert) {
 
-                    String certFilename = generateSslCertName(sslCert.getFingerprint()) + ".pem"; //netscaler uses ".pem" format for "bundle" files
-                    String keyFilename = generateSslKeyName(sslCert.getFingerprint()) + ".pem"; //netscaler uses ".pem" format for "bundle" files
-                    String certKeyName = generateSslCertKeyName(sslCert.getFingerprint());
+                    final String certFilename = generateSslCertName(sslCert.getFingerprint()) + ".pem"; //netscaler uses ".pem" format for "bundle" files
+                    final String keyFilename = generateSslKeyName(sslCert.getFingerprint()) + ".pem"; //netscaler uses ".pem" format for "bundle" files
+                    final String certKeyName = generateSslCertKeyName(sslCert.getFingerprint());
 
                     // unbind before deleting
                     if (nsVirtualServerExists(nsVirtualServerName) &&
@@ -859,13 +859,13 @@ public class NetscalerResource implements ServerResource {
                      */
 
                     if (sslCert.getChain() != null) {
-                        List<Certificate> chainList = CertificateHelper.parseChain(sslCert.getChain());
+                        final List<Certificate> chainList = CertificateHelper.parseChain(sslCert.getChain());
                         //go from intermediate CAs to ROOT
-                        for (Certificate intermediateCert : chainList) {
+                        for (final Certificate intermediateCert : chainList) {
 
-                            String fingerPrint = CertificateHelper.generateFingerPrint(intermediateCert);
-                            String intermediateCertKeyName = generateSslCertKeyName(fingerPrint);
-                            String intermediateCertFileName = intermediateCertKeyName + ".pem";
+                            final String fingerPrint = CertificateHelper.generateFingerPrint(intermediateCert);
+                            final String intermediateCertKeyName = generateSslCertKeyName(fingerPrint);
+                            final String intermediateCertFileName = intermediateCertKeyName + ".pem";
 
                             if (SSL.isSslCertKeyPresent(_netscalerService, intermediateCertKeyName) &&
                                     !SSL.isCaforCerts(_netscalerService, intermediateCertKeyName)) {
@@ -887,14 +887,14 @@ public class NetscalerResource implements ServerResource {
 
             saveConfiguration();
             return new Answer(cmd);
-        } catch (ExecutionException e) {
+        } catch (final ExecutionException e) {
             s_logger.error("Failed to execute LoadBalancerConfigCommand due to ", e);
             if (shouldRetry(numRetries)) {
                 return retry(cmd, numRetries);
             } else {
                 return new Answer(cmd, e);
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             s_logger.error("Failed to execute LoadBalancerConfigCommand due to ", e);
             if (shouldRetry(numRetries)) {
                 return retry(cmd, numRetries);
@@ -904,18 +904,18 @@ public class NetscalerResource implements ServerResource {
         }
     }
 
-    private synchronized Answer execute(CreateLoadBalancerApplianceCommand cmd, int numRetries) {
+    private synchronized Answer execute(final CreateLoadBalancerApplianceCommand cmd, final int numRetries) {
 
         if (!_isSdx) {
             return Answer.createUnsupportedCommandAnswer(cmd);
         }
 
         try {
-            String vpxName = "Cloud-VPX-" + cmd.getLoadBalancerIP();
-            String username = "admin";
-            String password = "admin";
+            final String vpxName = "Cloud-VPX-" + cmd.getLoadBalancerIP();
+            final String username = "admin";
+            final String password = "admin";
 
-            ns ns_obj = new ns();
+            final ns ns_obj = new ns();
             ns_obj.set_name(vpxName);
             ns_obj.set_ip_address(cmd.getLoadBalancerIP());
             ns_obj.set_netmask(cmd.getNetmask());
@@ -933,12 +933,12 @@ public class NetscalerResource implements ServerResource {
 
             // use the first VPX image of the available VPX images on the SDX to create an instance of VPX
             // TODO: should enable the option to choose the template while adding the SDX device in to CloudStack
-            xen_nsvpx_image[] vpxImages = xen_nsvpx_image.get(_netscalerSdxService);
+            final xen_nsvpx_image[] vpxImages = xen_nsvpx_image.get(_netscalerSdxService);
             if (!(vpxImages != null && vpxImages.length >= 1)) {
                 new Answer(cmd, new ExecutionException("Failed to create VPX instance on the netscaler SDX device " + _ip +
                         " as there are no VPX images on SDX to use for creating VPX."));
             }
-            String imageName = vpxImages[0].get_file_name();
+            final String imageName = vpxImages[0].get_file_name();
             ns_obj.set_image_name(imageName);
 
             String publicIf = _publicInterface;
@@ -956,14 +956,14 @@ public class NetscalerResource implements ServerResource {
 
             // wait for VPX instance to start-up
             long startTick = System.currentTimeMillis();
-            long startWaitMilliSeconds = 600000;
+            final long startWaitMilliSeconds = 600000;
             while (!newVpx.get_instance_state().equalsIgnoreCase("up") && System.currentTimeMillis() - startTick < startWaitMilliSeconds) {
                 try {
                     Thread.sleep(10000);
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     s_logger.debug("[ignored] interupted while waiting for netscaler to be 'up'.");
                 }
-                ns refreshNsObj = new ns();
+                final ns refreshNsObj = new ns();
                 refreshNsObj.set_id(newVpx.get_id());
                 newVpx = ns.get(_netscalerSdxService, refreshNsObj);
             }
@@ -976,19 +976,19 @@ public class NetscalerResource implements ServerResource {
             // wait till NS service in side VPX is actually ready
             startTick = System.currentTimeMillis();
             boolean nsServiceUp = false;
-            long nsServiceWaitMilliSeconds = 60000;
+            final long nsServiceWaitMilliSeconds = 60000;
             while (System.currentTimeMillis() - startTick < nsServiceWaitMilliSeconds) {
                 try {
-                    nitro_service _netscalerService = new nitro_service(cmd.getLoadBalancerIP(), "https");
-                    _netscalerService.set_certvalidation(false);
-                    _netscalerService.set_hostnameverification(false);
-                    _netscalerService.set_credential(username, password);
-                    apiCallResult = _netscalerService.login();
+                    final nitro_service netscalerService = new nitro_service(cmd.getLoadBalancerIP(), "https");
+                    netscalerService.set_certvalidation(false);
+                    netscalerService.set_hostnameverification(false);
+                    netscalerService.set_credential(username, password);
+                    apiCallResult = netscalerService.login();
                     if (apiCallResult.errorcode == 0) {
                         nsServiceUp = true;
                         break;
                     }
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     Thread.sleep(10000);
                     continue;
                 }
@@ -1006,8 +1006,8 @@ public class NetscalerResource implements ServerResource {
             // However the VPX instances created will have interface range start from 10/1 but will only have as many interfaces enabled while creating the VPX instance
             // So due to this, we need to map public & private interface on SDX to correct public & private interface of VPX
 
-            int publicIfnum = Integer.parseInt(_publicInterface.substring(_publicInterface.lastIndexOf("/") + 1));
-            int privateIfnum = Integer.parseInt(_privateInterface.substring(_privateInterface.lastIndexOf("/") + 1));
+            final int publicIfnum = Integer.parseInt(_publicInterface.substring(_publicInterface.lastIndexOf("/") + 1));
+            final int privateIfnum = Integer.parseInt(_privateInterface.substring(_privateInterface.lastIndexOf("/") + 1));
 
             if (_publicInterface.startsWith("10/") && _privateInterface.startsWith("10/")) {
                 if (publicIfnum == privateIfnum) {
@@ -1041,7 +1041,7 @@ public class NetscalerResource implements ServerResource {
 
             return new CreateLoadBalancerApplianceAnswer(cmd, true, "provisioned VPX instance", "NetscalerVPXLoadBalancer", "Netscaler", new NetscalerResource(),
                     publicIf, privateIf, _username, _password);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             if (shouldRetry(numRetries)) {
                 return retry(cmd, numRetries);
             }
@@ -1050,17 +1050,17 @@ public class NetscalerResource implements ServerResource {
         }
     }
 
-    private Answer execute(GlobalLoadBalancerConfigCommand gslbCmd, int numRetries) {
+    private Answer execute(final GlobalLoadBalancerConfigCommand gslbCmd, final int numRetries) {
 
-        String lbMethod = gslbCmd.getLoadBalancerMethod();
-        String persistenceType = gslbCmd.getPersistenceType();
-        String serviceType = gslbCmd.getServiceType();
-        boolean forRevoke = gslbCmd.isForRevoke();
-        long gslbId = gslbCmd.getGslbId();
-        List<SiteLoadBalancerConfig> sites = gslbCmd.getSiteDetails();
+        final String lbMethod = gslbCmd.getLoadBalancerMethod();
+        final String persistenceType = gslbCmd.getPersistenceType();
+        final String serviceType = gslbCmd.getServiceType();
+        final boolean forRevoke = gslbCmd.isForRevoke();
+        final long gslbId = gslbCmd.getGslbId();
+        final List<SiteLoadBalancerConfig> sites = gslbCmd.getSiteDetails();
 
-        String domainName = gslbCmd.getDomainName();
-        String vserverName = GSLB.generateVirtualServerName(domainName);
+        final String domainName = gslbCmd.getDomainName();
+        final String vserverName = GSLB.generateVirtualServerName(domainName);
 
         try {
 
@@ -1070,17 +1070,17 @@ public class NetscalerResource implements ServerResource {
                 GSLB.createVirtualServer(_netscalerService, vserverName, lbMethod, persistenceType, gslbId, serviceType);
 
                 if (sites != null) { // check if there are any sites that are participating in global load balancing
-                    for (SiteLoadBalancerConfig site : sites) {
+                    for (final SiteLoadBalancerConfig site : sites) {
 
-                        String sitePrivateIP = site.getGslbProviderPrivateIp();
-                        String sitePublicIP = site.getGslbProviderPublicIp();
-                        String servicePublicIp = site.getServicePublicIp();
-                        String servicePublicPort = site.getServicePort();
-                        String siteName = GSLB.generateUniqueSiteName(sitePrivateIP, sitePublicIP, site.getDataCenterId());
+                        final String sitePrivateIP = site.getGslbProviderPrivateIp();
+                        final String sitePublicIP = site.getGslbProviderPublicIp();
+                        final String servicePublicIp = site.getServicePublicIp();
+                        final String servicePublicPort = site.getServicePort();
+                        final String siteName = GSLB.generateUniqueSiteName(sitePrivateIP, sitePublicIP, site.getDataCenterId());
 
                         // Add/Delete GSLB local and remote sites that are part of GSLB virtual server
                         if (!site.forRevoke()) {
-                            String siteType = (site.isLocal()) ? "LOCAL" : "REMOTE";
+                            final String siteType = site.isLocal() ? "LOCAL" : "REMOTE";
                             if (GSLB.getSiteObject(_netscalerService, siteName) != null) {
                                 GSLB.updateSite(_netscalerService, siteType, siteName, site.getGslbProviderPrivateIp(), site.getGslbProviderPublicIp());
                             } else {
@@ -1089,8 +1089,8 @@ public class NetscalerResource implements ServerResource {
                         }
 
                         // Add/Delete GSLB service corresponding the service running on each site
-                        String serviceName = GSLB.generateUniqueServiceName(siteName, servicePublicIp, servicePublicPort);
-                        String monitorName = GSLB.generateGslbServiceMonitorName(servicePublicIp);
+                        final String serviceName = GSLB.generateUniqueServiceName(siteName, servicePublicIp, servicePublicPort);
+                        final String monitorName = GSLB.generateGslbServiceMonitorName(servicePublicIp);
                         if (!site.forRevoke()) {
                             // create a 'gslbservice' object
                             GSLB.createService(_netscalerService, serviceName, site.getServiceType(), servicePublicIp, servicePublicPort, siteName);
@@ -1134,15 +1134,15 @@ public class NetscalerResource implements ServerResource {
                 GSLB.deleteVserverDomainBinding(_netscalerService, vserverName, domainName);
 
                 if (sites != null) {
-                    for (SiteLoadBalancerConfig site : sites) {
+                    for (final SiteLoadBalancerConfig site : sites) {
 
-                        String sitePrivateIP = site.getGslbProviderPrivateIp();
-                        String sitePublicIP = site.getGslbProviderPublicIp();
-                        String servicePublicIp = site.getServicePublicIp();
-                        String servicePublicPort = site.getServicePort();
-                        String siteName = GSLB.generateUniqueSiteName(sitePrivateIP, sitePublicIP, site.getDataCenterId());
-                        String serviceName = GSLB.generateUniqueServiceName(siteName, servicePublicIp, servicePublicPort);
-                        String monitorName = GSLB.generateGslbServiceMonitorName(servicePublicIp);
+                        final String sitePrivateIP = site.getGslbProviderPrivateIp();
+                        final String sitePublicIP = site.getGslbProviderPublicIp();
+                        final String servicePublicIp = site.getServicePublicIp();
+                        final String servicePublicPort = site.getServicePort();
+                        final String siteName = GSLB.generateUniqueSiteName(sitePrivateIP, sitePublicIP, site.getDataCenterId());
+                        final String serviceName = GSLB.generateUniqueServiceName(siteName, servicePublicIp, servicePublicPort);
+                        final String monitorName = GSLB.generateGslbServiceMonitorName(servicePublicIp);
 
                         // delete GSLB service and GSLB monitor binding
                         GSLB.deleteGslbServiceGslbMonitorBinding(_netscalerService, monitorName, serviceName);
@@ -1167,8 +1167,8 @@ public class NetscalerResource implements ServerResource {
 
             saveConfiguration();
 
-        } catch (Exception e) {
-            String errMsg = "Failed to apply GSLB configuration due to " + e.getMessage();
+        } catch (final Exception e) {
+            final String errMsg = "Failed to apply GSLB configuration due to " + e.getMessage();
             if (shouldRetry(numRetries)) {
                 return retry(gslbCmd, numRetries);
             }
@@ -1189,7 +1189,7 @@ public class NetscalerResource implements ServerResource {
     private static class GSLB {
 
         // create a 'gslbsite' object representing a site
-        private static void createSite(nitro_service client, String siteName, String siteType, String siteIP, String sitePublicIP) throws ExecutionException {
+        private static void createSite(final nitro_service client, final String siteName, final String siteType, final String siteIP, final String sitePublicIP) throws ExecutionException {
             try {
                 gslbsite site;
                 site = getSiteObject(client, siteName);
@@ -1201,7 +1201,7 @@ public class NetscalerResource implements ServerResource {
                     isUpdateSite = true;
                 }
 
-                assert ("LOCAL".equalsIgnoreCase(siteType) || "REMOTE".equalsIgnoreCase(siteType));
+                assert "LOCAL".equalsIgnoreCase(siteType) || "REMOTE".equalsIgnoreCase(siteType);
                 site.set_sitetype(siteType);
                 site.set_sitename(siteName);
                 site.set_siteipaddress(siteIP);
@@ -1217,8 +1217,8 @@ public class NetscalerResource implements ServerResource {
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug("Successfully created GSLB site: " + siteName);
                 }
-            } catch (Exception e) {
-                String errMsg = "Failed to create GSLB site: " + siteName + " due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to create GSLB site: " + siteName + " due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1227,11 +1227,11 @@ public class NetscalerResource implements ServerResource {
         }
 
         // delete 'gslbsite' object representing a site
-        private static void deleteSite(nitro_service client, String siteName) throws ExecutionException {
+        private static void deleteSite(final nitro_service client, final String siteName) throws ExecutionException {
             try {
-                gslbsite site = getSiteObject(client, siteName);
+                final gslbsite site = getSiteObject(client, siteName);
                 if (site != null) {
-                    gslbsite_gslbservice_binding[] serviceBindings = gslbsite_gslbservice_binding.get(client, siteName);
+                    final gslbsite_gslbservice_binding[] serviceBindings = gslbsite_gslbservice_binding.get(client, siteName);
                     if (serviceBindings != null && serviceBindings.length > 0) {
                         if (s_logger.isDebugEnabled()) {
                             s_logger.debug("There are services associated with GSLB site: " + siteName + " so ignoring site deletion");
@@ -1246,8 +1246,8 @@ public class NetscalerResource implements ServerResource {
                         s_logger.warn("Ignoring delete request for non existing  GSLB site: " + siteName);
                     }
                 }
-            } catch (Exception e) {
-                String errMsg = "Failed to delete GSLB site: " + siteName + " due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to delete GSLB site: " + siteName + " due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1256,7 +1256,7 @@ public class NetscalerResource implements ServerResource {
         }
 
         // update 'gslbsite' object representing a site
-        private static void updateSite(nitro_service client, String siteType, String siteName, String siteIP, String sitePublicIP) throws ExecutionException {
+        private static void updateSite(final nitro_service client, final String siteType, final String siteName, final String siteIP, final String sitePublicIP) throws ExecutionException {
             try {
                 gslbsite site;
                 site = getSiteObject(client, siteName);
@@ -1266,7 +1266,7 @@ public class NetscalerResource implements ServerResource {
                     }
                     return;
                 }
-                assert ("LOCAL".equalsIgnoreCase(siteType) || "REMOTE".equalsIgnoreCase(siteType));
+                assert "LOCAL".equalsIgnoreCase(siteType) || "REMOTE".equalsIgnoreCase(siteType);
                 site.set_sitetype(siteType);
                 site.set_sitename(siteName);
                 site.set_siteipaddress(siteIP);
@@ -1280,8 +1280,8 @@ public class NetscalerResource implements ServerResource {
                     s_logger.debug("Successfully updated GSLB site: " + siteName);
                 }
 
-            } catch (Exception e) {
-                String errMsg = "Failed to update GSLB site: " + siteName + " due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to update GSLB site: " + siteName + " due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1291,7 +1291,7 @@ public class NetscalerResource implements ServerResource {
 
         // create a 'gslbvserver' object representing a globally load balanced service
         private static void
-        createVirtualServer(nitro_service client, String vserverName, String lbMethod, String persistenceType, long persistenceId, String serviceType)
+        createVirtualServer(final nitro_service client, final String vserverName, final String lbMethod, final String persistenceType, final long persistenceId, final String serviceType)
                 throws ExecutionException {
             try {
                 gslbvserver vserver;
@@ -1335,8 +1335,8 @@ public class NetscalerResource implements ServerResource {
                     s_logger.debug("Successfully added GSLB virtual server: " + vserverName);
                 }
 
-            } catch (Exception e) {
-                String errMsg = "Failed to add GSLB virtual server: " + vserverName + " due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to add GSLB virtual server: " + vserverName + " due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1345,9 +1345,9 @@ public class NetscalerResource implements ServerResource {
         }
 
         // delete 'gslbvserver' object representing a globally load balanced service
-        private static void deleteVirtualServer(nitro_service client, String vserverName) throws ExecutionException {
+        private static void deleteVirtualServer(final nitro_service client, final String vserverName) throws ExecutionException {
             try {
-                gslbvserver vserver = getVserverObject(client, vserverName);
+                final gslbvserver vserver = getVserverObject(client, vserverName);
                 if (vserver != null) {
                     gslbvserver.delete(client, vserver);
                     if (s_logger.isDebugEnabled()) {
@@ -1358,8 +1358,8 @@ public class NetscalerResource implements ServerResource {
                         s_logger.warn("Ignoring delete request for non existing  GSLB virtual server: " + vserverName);
                     }
                 }
-            } catch (Exception e) {
-                String errMsg = "Failed to delete GSLB virtual server: " + vserverName + " due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to delete GSLB virtual server: " + vserverName + " due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1368,20 +1368,20 @@ public class NetscalerResource implements ServerResource {
         }
 
         // create, delete, update, get the GSLB services
-        private static void createService(nitro_service client, String serviceName, String serviceType, String serviceIp, String servicePort, String siteName)
+        private static void createService(final nitro_service client, final String serviceName, final String serviceType, final String serviceIp, final String servicePort, final String siteName)
                 throws ExecutionException {
             try {
                 gslbservice service;
                 service = getServiceObject(client, serviceName);
-                String gslbServerName = generateGslbServerName(serviceIp);
+                final String gslbServerName = generateGslbServerName(serviceIp);
 
                 if (!gslbServerExists(client, gslbServerName)) {
                     base_response apiCallResult;
-                    com.citrix.netscaler.nitro.resource.config.basic.server nsServer = new com.citrix.netscaler.nitro.resource.config.basic.server();
+                    final com.citrix.netscaler.nitro.resource.config.basic.server nsServer = new com.citrix.netscaler.nitro.resource.config.basic.server();
                     nsServer.set_name(gslbServerName);
                     nsServer.set_ipaddress(serviceIp);
                     apiCallResult = com.citrix.netscaler.nitro.resource.config.basic.server.add(client, nsServer);
-                    if ((apiCallResult.errorcode != 0) && (apiCallResult.errorcode != NitroError.NS_RESOURCE_EXISTS)) {
+                    if (apiCallResult.errorcode != 0 && apiCallResult.errorcode != NitroError.NS_RESOURCE_EXISTS) {
                         throw new ExecutionException("Failed to add server " + gslbServerName + " due to" + apiCallResult.message);
                     }
                 }
@@ -1395,7 +1395,7 @@ public class NetscalerResource implements ServerResource {
 
                 service.set_sitename(siteName);
                 service.set_servername(gslbServerName);
-                int port = Integer.parseInt(servicePort);
+                final int port = Integer.parseInt(servicePort);
                 service.set_port(port);
                 service.set_servicename(serviceName);
                 service.set_servicetype(serviceType);
@@ -1409,8 +1409,8 @@ public class NetscalerResource implements ServerResource {
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug("Successfully created service: " + serviceName + " at site: " + siteName);
                 }
-            } catch (Exception e) {
-                String errMsg = "Failed to created service: " + serviceName + " at site: " + siteName + " due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to created service: " + serviceName + " at site: " + siteName + " due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1418,9 +1418,9 @@ public class NetscalerResource implements ServerResource {
             }
         }
 
-        private static void deleteService(nitro_service client, String serviceName) throws ExecutionException {
+        private static void deleteService(final nitro_service client, final String serviceName) throws ExecutionException {
             try {
-                gslbservice service = getServiceObject(client, serviceName);
+                final gslbservice service = getServiceObject(client, serviceName);
                 if (service != null) {
                     gslbservice.delete(client, serviceName);
                     if (s_logger.isDebugEnabled()) {
@@ -1431,8 +1431,8 @@ public class NetscalerResource implements ServerResource {
                         s_logger.warn("Ignoring delete request for non existing  service: " + serviceName);
                     }
                 }
-            } catch (Exception e) {
-                String errMsg = "Failed to delete service: " + serviceName + " due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to delete service: " + serviceName + " due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1440,11 +1440,11 @@ public class NetscalerResource implements ServerResource {
             }
         }
 
-        private static void createVserverServiceBinding(nitro_service client, String serviceName, String vserverName, long weight) throws ExecutionException {
+        private static void createVserverServiceBinding(final nitro_service client, final String serviceName, final String vserverName, final long weight) throws ExecutionException {
             String errMsg;
             try {
-                assert (weight >= 1 && weight <= 100);
-                gslbvserver_gslbservice_binding binding = new gslbvserver_gslbservice_binding();
+                assert weight >= 1 && weight <= 100;
+                final gslbvserver_gslbservice_binding binding = new gslbvserver_gslbservice_binding();
                 binding.set_name(vserverName);
                 binding.set_servicename(serviceName);
                 binding.set_weight(weight);
@@ -1452,7 +1452,7 @@ public class NetscalerResource implements ServerResource {
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug("Successfully created service: " + serviceName + " and virtual server: " + vserverName + " binding");
                 }
-            } catch (nitro_exception ne) {
+            } catch (final nitro_exception ne) {
                 if (ne.getErrorCode() == 273) {
                     return;
                 }
@@ -1461,7 +1461,7 @@ public class NetscalerResource implements ServerResource {
                     s_logger.debug(errMsg);
                 }
                 throw new ExecutionException(errMsg);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 errMsg = "Failed to create service: " + serviceName + " and virtual server: " + vserverName + " binding due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
@@ -1470,11 +1470,11 @@ public class NetscalerResource implements ServerResource {
             }
         }
 
-        private static void deleteVserverServiceBinding(nitro_service client, String serviceName, String vserverName) throws ExecutionException {
+        private static void deleteVserverServiceBinding(final nitro_service client, final String serviceName, final String vserverName) throws ExecutionException {
             try {
-                gslbvserver_gslbservice_binding[] bindings = gslbvserver_gslbservice_binding.get(client, vserverName);
+                final gslbvserver_gslbservice_binding[] bindings = gslbvserver_gslbservice_binding.get(client, vserverName);
                 if (bindings != null) {
-                    for (gslbvserver_gslbservice_binding binding : bindings) {
+                    for (final gslbvserver_gslbservice_binding binding : bindings) {
                         if (binding.get_servicename().equalsIgnoreCase(serviceName) && binding.get_name().equals(vserverName)) {
                             gslbvserver_gslbservice_binding.delete(client, binding);
                             if (s_logger.isDebugEnabled()) {
@@ -1484,8 +1484,8 @@ public class NetscalerResource implements ServerResource {
                         }
                     }
                 }
-            } catch (Exception e) {
-                String errMsg = "Failed to create service: " + serviceName + " and virtual server: " + vserverName + " binding due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to create service: " + serviceName + " and virtual server: " + vserverName + " binding due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1494,10 +1494,10 @@ public class NetscalerResource implements ServerResource {
         }
 
         // create, delete GSLB virtual server and domain bindings
-        private static void createVserverDomainBinding(nitro_service client, String vserverName, String domainName) throws ExecutionException {
+        private static void createVserverDomainBinding(final nitro_service client, final String vserverName, final String domainName) throws ExecutionException {
             String errMsg;
             try {
-                gslbvserver_domain_binding binding = new gslbvserver_domain_binding();
+                final gslbvserver_domain_binding binding = new gslbvserver_domain_binding();
                 binding.set_domainname(domainName);
                 binding.set_name(vserverName);
                 gslbvserver_domain_binding.add(client, binding);
@@ -1505,12 +1505,12 @@ public class NetscalerResource implements ServerResource {
                     s_logger.debug("Successfully added virtual server: " + vserverName + " domain name: " + domainName + " binding");
                 }
                 return;
-            } catch (nitro_exception e) {
+            } catch (final nitro_exception e) {
                 if (e.getErrorCode() == NitroError.NS_GSLB_DOMAIN_ALREADY_BOUND) {
                     return;
                 }
                 errMsg = e.getMessage();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 errMsg = e.getMessage();
             }
             errMsg = "Failed to create virtual server: " + vserverName + " domain name: " + domainName + " binding" + errMsg;
@@ -1520,11 +1520,11 @@ public class NetscalerResource implements ServerResource {
             throw new ExecutionException(errMsg);
         }
 
-        private static void deleteVserverDomainBinding(nitro_service client, String vserverName, String domainName) throws ExecutionException {
+        private static void deleteVserverDomainBinding(final nitro_service client, final String vserverName, final String domainName) throws ExecutionException {
             try {
-                gslbvserver_domain_binding[] bindings = gslbvserver_domain_binding.get(client, vserverName);
+                final gslbvserver_domain_binding[] bindings = gslbvserver_domain_binding.get(client, vserverName);
                 if (bindings != null) {
-                    for (gslbvserver_domain_binding binding : bindings) {
+                    for (final gslbvserver_domain_binding binding : bindings) {
                         if (binding.get_domainname().equalsIgnoreCase(domainName)) {
                             gslbvserver_domain_binding.delete(client, binding);
                             if (s_logger.isDebugEnabled()) {
@@ -1534,8 +1534,8 @@ public class NetscalerResource implements ServerResource {
                         }
                     }
                 }
-            } catch (Exception e) {
-                String errMsg = "Failed to delete virtual server: " + vserverName + " and domain " + domainName + " binding due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to delete virtual server: " + vserverName + " and domain " + domainName + " binding due to " + e.getMessage();
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1543,21 +1543,21 @@ public class NetscalerResource implements ServerResource {
             }
         }
 
-        private static void createGslbServiceMonitor(nitro_service nsService, String servicePublicIp, String serviceName) throws ExecutionException {
+        private static void createGslbServiceMonitor(final nitro_service nsService, final String servicePublicIp, final String serviceName) throws ExecutionException {
             try {
-                lbmonitor newmonitor = new lbmonitor();
-                String monitorName = generateGslbServiceMonitorName(servicePublicIp);
+                final lbmonitor newmonitor = new lbmonitor();
+                final String monitorName = generateGslbServiceMonitorName(servicePublicIp);
                 newmonitor.set_type("TCP");
                 newmonitor.set_servicename(serviceName);
                 newmonitor.set_monitorname(monitorName);
                 newmonitor.set_state("ENABLED");
                 lbmonitor.add(nsService, newmonitor);
-            } catch (nitro_exception ne) {
+            } catch (final nitro_exception ne) {
                 if (ne.getErrorCode() == NitroError.NS_RESOURCE_EXISTS) {
                     return;
                 }
-            } catch (Exception e) {
-                String errMsg = "Failed to create GSLB monitor for service public ip" + servicePublicIp;
+            } catch (final Exception e) {
+                final String errMsg = "Failed to create GSLB monitor for service public ip" + servicePublicIp;
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug(errMsg);
                 }
@@ -1565,127 +1565,127 @@ public class NetscalerResource implements ServerResource {
             }
         }
 
-        private static void deleteGslbServiceMonitor(nitro_service nsService, String monitorName) throws ExecutionException {
+        private static void deleteGslbServiceMonitor(final nitro_service nsService, final String monitorName) throws ExecutionException {
             try {
-                lbmonitor serviceMonitor = lbmonitor.get(nsService, monitorName);
+                final lbmonitor serviceMonitor = lbmonitor.get(nsService, monitorName);
                 if (serviceMonitor != null) {
                     lbmonitor.delete(nsService, serviceMonitor);
                 }
-            } catch (nitro_exception ne) {
+            } catch (final nitro_exception ne) {
                 if (ne.getErrorCode() != NitroError.NS_RESOURCE_NOT_EXISTS) {
-                    String errMsg = "Failed to delete monitor " + monitorName + " for GSLB service due to " + ne.getMessage();
+                    final String errMsg = "Failed to delete monitor " + monitorName + " for GSLB service due to " + ne.getMessage();
                     s_logger.debug(errMsg);
                     throw new com.cloud.utils.exception.ExecutionException(errMsg);
                 }
-            } catch (Exception e) {
-                String errMsg = "Failed to delete monitor " + monitorName + " for GSLB service due to " + e.getMessage();
+            } catch (final Exception e) {
+                final String errMsg = "Failed to delete monitor " + monitorName + " for GSLB service due to " + e.getMessage();
                 s_logger.debug(errMsg);
                 throw new com.cloud.utils.exception.ExecutionException(errMsg);
             }
         }
 
-        private static void createGslbServiceGslbMonitorBinding(nitro_service nsService, String monitorName, String serviceName) {
+        private static void createGslbServiceGslbMonitorBinding(final nitro_service nsService, final String monitorName, final String serviceName) {
             try {
-                gslbservice_lbmonitor_binding monitorBinding = new gslbservice_lbmonitor_binding();
+                final gslbservice_lbmonitor_binding monitorBinding = new gslbservice_lbmonitor_binding();
                 monitorBinding.set_monitor_name(monitorName);
                 monitorBinding.set_servicename(serviceName);
                 gslbservice_lbmonitor_binding.add(nsService, monitorBinding);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 // TODO: Nitro API version 10.* is not compatible for NetScalers 9.*, so may fail
                 // against NetScaler version lesser than 10 hence ignore the exception
                 s_logger.warn("Failed to bind monitor to GSLB service due to " + e.getMessage());
             }
         }
 
-        private static void deleteGslbServiceGslbMonitorBinding(nitro_service nsService, String monitorName, String serviceName) {
+        private static void deleteGslbServiceGslbMonitorBinding(final nitro_service nsService, final String monitorName, final String serviceName) {
             try {
-                gslbservice_lbmonitor_binding[] monitorBindings = gslbservice_lbmonitor_binding.get(nsService, serviceName);
+                final gslbservice_lbmonitor_binding[] monitorBindings = gslbservice_lbmonitor_binding.get(nsService, serviceName);
                 if (monitorBindings != null && monitorBindings.length > 0) {
-                    for (gslbservice_lbmonitor_binding binding : monitorBindings) {
+                    for (final gslbservice_lbmonitor_binding binding : monitorBindings) {
                         if (binding.get_monitor_name().equalsIgnoreCase(monitorName)) {
                             s_logger.info("Found a binding between monitor " + binding.get_monitor_name() + " and " + binding.get_servicename());
                             gslbservice_lbmonitor_binding.delete(nsService, binding);
                         }
                     }
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 s_logger.debug("Failed to delete GSLB monitor " + monitorName + " and GSLB service " + serviceName + " binding due to " + e.getMessage() +
                         " but moving on ..., will be cleaned up as part of GSLB " + " service delete any way..");
             }
         }
 
         // get 'gslbsite' object corresponding to a site name
-        private static gslbsite getSiteObject(nitro_service client, String siteName) {
+        private static gslbsite getSiteObject(final nitro_service client, final String siteName) {
             try {
-                gslbsite site = gslbsite.get(client, siteName);
+                final gslbsite site = gslbsite.get(client, siteName);
                 if (site != null) {
                     return site;
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 s_logger.info("[ignored]"
                         + "error getting site: " + e.getLocalizedMessage());
             }
             return null;
         }
 
-        private static gslbvserver getVserverObject(nitro_service client, String vserverName) {
+        private static gslbvserver getVserverObject(final nitro_service client, final String vserverName) {
             try {
-                gslbvserver vserver = gslbvserver.get(client, vserverName);
+                final gslbvserver vserver = gslbvserver.get(client, vserverName);
                 return vserver;
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 return null;
             }
         }
 
-        private static gslbservice getServiceObject(nitro_service client, String serviceName) {
+        private static gslbservice getServiceObject(final nitro_service client, final String serviceName) {
             try {
-                gslbservice service = gslbservice.get(client, serviceName);
+                final gslbservice service = gslbservice.get(client, serviceName);
                 return service;
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 return null;
             }
         }
 
-        private static String generateUniqueSiteName(String sitePrivateIp, String sitePublicIP, long dataCenterId) {
+        private static String generateUniqueSiteName(final String sitePrivateIp, final String sitePublicIP, final long dataCenterId) {
             return "cloudsite" + String.valueOf(dataCenterId);
         }
 
-        private static String generateVirtualServerName(String domainName) {
+        private static String generateVirtualServerName(final String domainName) {
             return "cloud-gslb-vserver-" + domainName;
         }
 
-        private static String generateUniqueServiceName(String siteName, String publicIp, String publicPort) {
+        private static String generateUniqueServiceName(final String siteName, final String publicIp, final String publicPort) {
             return "cloud-gslb-service-" + siteName + "-" + publicIp + "-" + publicPort;
         }
 
-        private static String generateGslbServiceMonitorName(String publicIp) {
+        private static String generateGslbServiceMonitorName(final String publicIp) {
             return "cloud-monitor-" + publicIp;
         }
 
-        private static boolean gslbServerExists(nitro_service client, String serverName) throws ExecutionException {
+        private static boolean gslbServerExists(final nitro_service client, final String serverName) throws ExecutionException {
             try {
                 if (com.citrix.netscaler.nitro.resource.config.basic.server.get(client, serverName) != null) {
                     return true;
                 } else {
                     return false;
                 }
-            } catch (nitro_exception e) {
+            } catch (final nitro_exception e) {
                 if (e.getErrorCode() == NitroError.NS_RESOURCE_NOT_EXISTS) {
                     return false;
                 } else {
                     throw new ExecutionException("Failed to verify Server " + serverName + " exists on the NetScaler device due to " + e.getMessage());
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to verify Server " + serverName + " exists on the NetScaler device due to " + e.getMessage());
             }
         }
 
-        private static String generateGslbServerName(String serverIP) {
+        private static String generateGslbServerName(final String serverIP) {
             return genGslbObjectName("Cloud-Server-", serverIP);
         }
 
-        private static String genGslbObjectName(Object... args) {
-            StringBuffer buff = new StringBuffer();
+        private static String genGslbObjectName(final Object... args) {
+            final StringBuffer buff = new StringBuffer();
             for (int i = 0; i < args.length; i++) {
                 buff.append(args[i]);
                 if (i != args.length - 1) {
@@ -1702,54 +1702,56 @@ public class NetscalerResource implements ServerResource {
         private static final String SSL_CERT_PATH = "/nsconfig/ssl/";
         private static final int SSH_PORT = 22;
 
-        private static boolean isSslCertKeyPresent(nitro_service ns, String certKeyName) throws ExecutionException {
+        private static boolean isSslCertKeyPresent(final nitro_service ns, final String certKeyName) throws ExecutionException {
 
-            String filter = "certkey:" + certKeyName;
+            final String filter = "certkey:" + certKeyName;
 
             try {
-                if (sslcertkey.count_filtered(ns, filter) > 0)
+                if (sslcertkey.count_filtered(ns, filter) > 0) {
                     return true;
-            } catch (nitro_exception e) {
+                }
+            } catch (final nitro_exception e) {
                 throw new ExecutionException("Failed to get certkey " + e.getMessage());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to get certkey " + e.getMessage());
             }
 
             return false;
         }
 
-        private static void deleteSslCertKey(nitro_service ns, String certKeyName) throws ExecutionException {
+        private static void deleteSslCertKey(final nitro_service ns, final String certKeyName) throws ExecutionException {
             try {
 
-                sslcertkey certkey = new sslcertkey();
+                final sslcertkey certkey = new sslcertkey();
                 certkey.set_certkey(certKeyName);
                 sslcertkey.delete(ns, certkey);
 
-            } catch (nitro_exception e) {
+            } catch (final nitro_exception e) {
                 throw new ExecutionException("Failed to delete certkey " + e.getMessage());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to delete certkey " + e.getMessage());
             }
 
         }
 
-        private static void deleteCertFile(String nsIp, String username, String password, String certFilename) throws Exception {
+        private static void deleteCertFile(final String nsIp, final String username, final String password, final String certFilename) throws Exception {
             SshHelper.sshExecute(nsIp, SSH_PORT, username, null, password, "shell rm " + SSL_CERT_PATH + certFilename);
         }
 
-        private static void deleteKeyFile(String nsIp, String username, String password, String keyFilename) throws Exception {
+        private static void deleteKeyFile(final String nsIp, final String username, final String password, final String keyFilename) throws Exception {
             SshHelper.sshExecute(nsIp, SSH_PORT, username, null, password, "shell rm " + SSL_CERT_PATH + keyFilename);
         }
 
-        private static void createSslCertKey(nitro_service ns, String certFilename, String keyFilename, String certKeyName, String password) throws ExecutionException {
+        private static void createSslCertKey(final nitro_service ns, final String certFilename, final String keyFilename, final String certKeyName, final String password) throws ExecutionException {
             s_logger.debug("Adding cert to netscaler");
             try {
-                sslcertkey certkey = new sslcertkey();
+                final sslcertkey certkey = new sslcertkey();
                 certkey.set_certkey(certKeyName);
                 certkey.set_cert(SSL_CERT_PATH + certFilename);
 
-                if (keyFilename != null)
+                if (keyFilename != null) {
                     certkey.set_key(SSL_CERT_PATH + keyFilename);
+                }
 
                 if (password != null) {
                     certkey.set_passplain(password);
@@ -1757,145 +1759,147 @@ public class NetscalerResource implements ServerResource {
 
                 certkey.perform_operation(ns);
 
-            } catch (nitro_exception e) {
+            } catch (final nitro_exception e) {
                 throw new ExecutionException("Failed to add certkey binding " + e.getMessage());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to add certkey binding " + e.getMessage());
             }
 
         }
 
-        private static void bindCertKeyToVserver(nitro_service ns, String certKeyName, String vserver) throws ExecutionException {
+        private static void bindCertKeyToVserver(final nitro_service ns, final String certKeyName, final String vserver) throws ExecutionException {
             s_logger.debug("Adding cert to netscaler");
 
             try {
-                sslvserver_sslcertkey_binding cert_binding = new sslvserver_sslcertkey_binding();
+                final sslvserver_sslcertkey_binding cert_binding = new sslvserver_sslcertkey_binding();
                 cert_binding.set_certkeyname(certKeyName);
                 cert_binding.set_vservername(vserver);
                 cert_binding.perform_operation(ns);
-            } catch (nitro_exception e) {
+            } catch (final nitro_exception e) {
                 throw new ExecutionException("Failed to bind certkey to vserver due to " + e.getMessage());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to bind certkey to vserver due to " + e.getMessage());
             }
         }
 
-        private static void unbindCertKeyFromVserver(nitro_service ns, String certKeyName, String vserver) throws ExecutionException {
+        private static void unbindCertKeyFromVserver(final nitro_service ns, final String certKeyName, final String vserver) throws ExecutionException {
             try {
 
-                sslvserver_sslcertkey_binding cert_binding = new sslvserver_sslcertkey_binding();
+                final sslvserver_sslcertkey_binding cert_binding = new sslvserver_sslcertkey_binding();
                 cert_binding.set_certkeyname(certKeyName);
                 cert_binding.set_vservername(vserver);
                 sslvserver_sslcertkey_binding.delete(ns, cert_binding);
 
-            } catch (nitro_exception e) {
+            } catch (final nitro_exception e) {
                 throw new ExecutionException("Failed to unbind certkey to vserver due to " + e.getMessage());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to unbind certkey to vserver due to " + e.getMessage());
             }
 
         }
 
-        private static void uploadCert(String nsIp, String user, String password, String certFilename, byte[] certData) throws ExecutionException {
+        private static void uploadCert(final String nsIp, final String user, final String password, final String certFilename, final byte[] certData) throws ExecutionException {
             try {
                 SshHelper.scpTo(nsIp, SSH_PORT, user, null, password, SSL_CERT_PATH, certData, certFilename, null);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to copy private key to device " + e.getMessage());
             }
         }
 
-        private static void uploadKey(String nsIp, String user, String password, String keyFilename, byte[] keyData) throws ExecutionException {
+        private static void uploadKey(final String nsIp, final String user, final String password, final String keyFilename, final byte[] keyData) throws ExecutionException {
             try {
                 SshHelper.scpTo(nsIp, SSH_PORT, user, null, password, SSL_CERT_PATH, keyData, keyFilename, null);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to copy private key to device " + e.getMessage());
             }
         }
 
-        private static void enableSslFeature(nitro_service ns, boolean isSdx) throws ExecutionException {
+        private static void enableSslFeature(final nitro_service ns, final boolean isSdx) throws ExecutionException {
             if (isSdx) {
                 return;
             }
             try {
-                base_response result = ns.enable_features(new String[] {"SSL"});
-                if (result.errorcode != 0)
+                final base_response result = ns.enable_features(new String[] {"SSL"});
+                if (result.errorcode != 0) {
                     throw new ExecutionException("Unable to enable SSL on LB");
-            } catch (nitro_exception e) {
+                }
+            } catch (final nitro_exception e) {
                 throw new ExecutionException("Failed to enable ssl feature on load balancer due to " + e.getMessage());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to enable ssl feature on load balancer due to " + e.getMessage());
             }
         }
 
-        public static boolean certLinkExists(nitro_service ns, String userCertName, String caCertName) throws ExecutionException {
+        public static boolean certLinkExists(final nitro_service ns, final String userCertName, final String caCertName) throws ExecutionException {
             try {
                 // check if there is a link from userCertName to caCertName
 
-                sslcertkey userCert = sslcertkey.get(ns, userCertName);
-                String nsCaCert = userCert.get_linkcertkeyname();
+                final sslcertkey userCert = sslcertkey.get(ns, userCertName);
+                final String nsCaCert = userCert.get_linkcertkeyname();
 
-                if (nsCaCert != null && nsCaCert.equals(caCertName))
+                if (nsCaCert != null && nsCaCert.equals(caCertName)) {
                     return true;
+                }
 
-            } catch (nitro_exception e) {
+            } catch (final nitro_exception e) {
                 throw new ExecutionException("Failed to check cert link on load balancer to " + e.getMessage());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to check cert link on load balancer due to " + e.getMessage());
             }
             return false;
         }
 
-        public static void linkCerts(nitro_service ns, String userCertName, String caCertName) throws ExecutionException {
+        public static void linkCerts(final nitro_service ns, final String userCertName, final String caCertName) throws ExecutionException {
             try {
 
                 // the assumption is that that both userCertName and caCertName are present on NS
 
-                sslcertkey caCert = sslcertkey.get(ns, caCertName);
-                sslcertkey userCert = sslcertkey.get(ns, userCertName);
+                final sslcertkey caCert = sslcertkey.get(ns, caCertName);
+                final sslcertkey userCert = sslcertkey.get(ns, userCertName);
 
-                sslcertkey linkResource = new sslcertkey();
+                final sslcertkey linkResource = new sslcertkey();
 
                 // link user cert to CA cert
                 linkResource.set_certkey(userCert.get_certkey());
                 linkResource.set_linkcertkeyname(caCert.get_certkey());
                 sslcertkey.link(ns, linkResource);
 
-            } catch (nitro_exception e) {
+            } catch (final nitro_exception e) {
                 throw new ExecutionException("Failed to check cert link on load balancer to " + e.getMessage());
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new ExecutionException("Failed to check cert link on load balancer due to " + e.getMessage());
             }
 
         }
 
-        public static boolean isCaforCerts(nitro_service ns, String caCertName) throws ExecutionException {
+        public static boolean isCaforCerts(final nitro_service ns, final String caCertName) throws ExecutionException {
             // check if this certificate  serves as a CA for other certificates
             try {
-                sslcertlink[] childLinks = sslcertlink.get_filtered(ns, "linkcertkeyname:" + caCertName);
+                final sslcertlink[] childLinks = sslcertlink.get_filtered(ns, "linkcertkeyname:" + caCertName);
                 if (childLinks != null && childLinks.length > 0) {
                     return true;
                 }
 
-            } catch (nitro_exception e) {
+            } catch (final nitro_exception e) {
                 throw new E

<TRUNCATED>

Mime
View raw message