karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [karaf-cellar] branch master updated: Default sync policy to null
Date Fri, 04 Oct 2019 09:02:12 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf-cellar.git


The following commit(s) were added to refs/heads/master by this push:
     new e3b49ec  Default sync policy to null
     new 9b2b6e2  Merge pull request #66 from Jahia/null-policy-as-default
e3b49ec is described below

commit e3b49ec3254f2e7ee710aa45f015c09d3561a786
Author: tdraier <tdraier@jahia.com>
AuthorDate: Thu Oct 3 17:10:05 2019 +0200

    Default sync policy to null
---
 .../org/apache/karaf/cellar/bundle/BundleSynchronizer.java    | 11 +++++------
 .../apache/karaf/cellar/config/ConfigurationSynchronizer.java |  5 ++---
 .../apache/karaf/cellar/features/FeaturesSynchronizer.java    |  5 ++---
 .../karaf/cellar/http/balancer/ServletSynchronizer.java       |  5 ++---
 .../java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java  |  5 ++---
 5 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java b/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java
index f1b064e..2e78fe4 100644
--- a/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java
+++ b/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java
@@ -83,8 +83,7 @@ public class BundleSynchronizer extends BundleSupport implements Synchronizer
{
         String policy = getSyncPolicy(group);
         if (policy == null) {
             LOGGER.warn("CELLAR BUNDLE: sync policy is not defined for cluster group {}",
group.getName());
-        }
-        if (policy.equalsIgnoreCase("cluster")) {
+        } else if (policy.equalsIgnoreCase("cluster")) {
             LOGGER.debug("CELLAR BUNDLE: sync policy set as 'cluster' for cluster group {}",
group.getName());
             LOGGER.debug("CELLAR BUNDLE: updating node from the cluster (pull first)");
             pull(group);
@@ -134,9 +133,9 @@ public class BundleSynchronizer extends BundleSupport implements Synchronizer
{
                     BundleState state = entry.getValue();
 
                     String[] tokens = id.split("/");
-                    String symbolicName = tokens[0];
-                    String version = tokens[1];
-                    if (tokens != null && tokens.length == 2) {
+                    if (tokens.length == 2) {
+                        String symbolicName = tokens[0];
+                        String version = tokens[1];
                         if (state != null) {
                             String bundleLocation = state.getLocation();
                             if (isAllowed(group, Constants.CATEGORY, bundleLocation, EventType.INBOUND))
{
@@ -342,7 +341,7 @@ public class BundleSynchronizer extends BundleSupport implements Synchronizer
{
             LOGGER.error("CELLAR BUNDLE: error while retrieving the sync policy", e);
         }
 
-        return "cluster";
+        return null;
     }
 
 }
diff --git a/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
b/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
index 17be5a0..b171bff 100644
--- a/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
+++ b/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
@@ -79,8 +79,7 @@ public class ConfigurationSynchronizer extends ConfigurationSupport implements
S
         String policy = getSyncPolicy(group);
         if (policy == null) {
             LOGGER.warn("CELLAR CONFIG: sync policy is not defined for cluster group {}",
group.getName());
-        }
-        if (policy.equalsIgnoreCase("cluster")) {
+        } else if (policy.equalsIgnoreCase("cluster")) {
             LOGGER.debug("CELLAR CONFIG: sync policy set as 'cluster' for cluster group {}",
group.getName());
             LOGGER.debug("CELLAR CONFIG: updating node from the cluster (pull first)");
             pull(group);
@@ -270,7 +269,7 @@ public class ConfigurationSynchronizer extends ConfigurationSupport implements
S
             LOGGER.error("CELLAR CONFIG: error while retrieving the sync policy", e);
         }
 
-        return "cluster";
+        return null;
     }
 
 }
diff --git a/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
b/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
index 331a7ce..487b780 100644
--- a/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
+++ b/features/src/main/java/org/apache/karaf/cellar/features/FeaturesSynchronizer.java
@@ -80,8 +80,7 @@ public class FeaturesSynchronizer extends FeaturesSupport implements Synchronize
         String policy = getSyncPolicy(group);
         if (policy == null) {
             LOGGER.warn("CELLAR FEATURE: sync policy is not defined for cluster group {}",
group.getName());
-        }
-        if (policy.equalsIgnoreCase("cluster")) {
+        } else if (policy.equalsIgnoreCase("cluster")) {
             LOGGER.debug("CELLAR FEATURE: sync policy set as 'cluster' for cluster group
{}", group.getName());
             LOGGER.debug("CELLAR FEATURE: updating node from the cluster (pull first)");
             pull(group);
@@ -341,7 +340,7 @@ public class FeaturesSynchronizer extends FeaturesSupport implements Synchronize
             LOGGER.error("CELLAR FEATURE: error while retrieving the sync policy", e);
         }
 
-        return "cluster";
+        return null;
     }
 
 }
diff --git a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ServletSynchronizer.java
b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ServletSynchronizer.java
index e3fb6e6..89a8c6c 100644
--- a/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ServletSynchronizer.java
+++ b/http/balancer/src/main/java/org/apache/karaf/cellar/http/balancer/ServletSynchronizer.java
@@ -64,8 +64,7 @@ public class ServletSynchronizer implements Synchronizer {
         String policy = getSyncPolicy(group);
         if (policy == null) {
             LOGGER.warn("CELLAR HTTP BALANCER: sync policy is not defined for cluster group
{}", group.getName());
-        }
-        if (policy.equalsIgnoreCase("cluster")) {
+        } else if (policy.equalsIgnoreCase("cluster")) {
             LOGGER.debug("CELLAR HTTP BALANCER: sync policy set as 'cluster' for cluster
group {}", group.getName());
             LOGGER.debug("CELLAR HTTP BALANCER: updating node from the cluster (pull first)");
             pull(group);
@@ -186,7 +185,7 @@ public class ServletSynchronizer implements Synchronizer {
             LOGGER.error("CELLAR HTTP BALANCER: error while retrieving the sync policy",
e);
         }
 
-        return "cluster";
+        return null;
     }
 
     public void setClusterManager(ClusterManager clusterManager) {
diff --git a/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java b/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
index 726d33b..4d60bd7 100644
--- a/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
+++ b/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
@@ -79,8 +79,7 @@ public class ObrUrlSynchronizer extends ObrSupport implements Synchronizer
{
         String policy = getSyncPolicy(group);
         if (policy == null) {
             LOGGER.warn("CELLAR OBR: sync policy is not defined for cluster group {}", group.getName());
-        }
-        if (policy.equalsIgnoreCase("cluster")) {
+        } else if (policy.equalsIgnoreCase("cluster")) {
             LOGGER.debug("CELLAR OBR: sync policy set as 'cluster' for cluster group {}",
group.getName());
             LOGGER.debug("CELLAR OBR: updating node from the cluster (pull first)");
             pull(group);
@@ -199,7 +198,7 @@ public class ObrUrlSynchronizer extends ObrSupport implements Synchronizer
{
             LOGGER.error("CELLAR OBR: error while retrieving the sync policy", e);
         }
 
-        return "cluster";
+        return null;
     }
 
 }


Mime
View raw message