You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by st...@apache.org on 2014/02/04 19:10:57 UTC
svn commit: r1564403 - in
/sling/trunk/bundles/extensions/discovery/impl/src/main:
java/org/apache/sling/discovery/impl/Config.java
resources/OSGI-INF/metatype/metatype.properties
Author: stefanegli
Date: Tue Feb 4 18:10:57 2014
New Revision: 1564403
URL: http://svn.apache.org/r1564403
Log:
SLING-3316 : add property that allows to automatically stop local-loop topology connectors, disabled by default
Modified:
sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/Config.java
sling/trunk/bundles/extensions/discovery/impl/src/main/resources/OSGI-INF/metatype/metatype.properties
Modified: sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/Config.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/Config.java?rev=1564403&r1=1564402&r2=1564403&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/Config.java (original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/Config.java Tue Feb 4 18:10:57 2014
@@ -97,6 +97,12 @@ public class Config {
public static final String LEADER_ELECTION_REPOSITORY_DESCRIPTOR_NAME_KEY = "leaderElectionRepositoryDescriptor";
/**
+ * If set to true, local-loops of topology connectors are automatically stopped when detected so.
+ */
+ @Property(boolValue=false)
+ private static final String AUTO_STOP_LOCAL_LOOP_ENABLED = "autoStopLocalLoopEnabled";
+
+ /**
* If set to true, hmac is enabled and the white list is disabled.
*/
@Property(boolValue=false)
@@ -124,6 +130,9 @@ public class Config {
private String leaderElectionRepositoryDescriptor ;
+ /** True when auto-stop of a local-loop is enabled. Default is false. **/
+ private boolean autoStopLocalLoopEnabled;
+
/**
* True when the hmac is enabled and signing is disabled.
*/
@@ -225,6 +234,8 @@ public class Config {
logger.debug("configure: leaderElectionRepositoryDescriptor='{}'",
this.leaderElectionRepositoryDescriptor);
+ autoStopLocalLoopEnabled = PropertiesUtil.toBoolean(properties.get(AUTO_STOP_LOCAL_LOOP_ENABLED), false);
+
hmacEnabled = PropertiesUtil.toBoolean(properties.get(HMAC_ENABLED), true);
encryptionEnabled = PropertiesUtil.toBoolean(properties.get(ENCRYPTION_ENABLED), false);
sharedKey = PropertiesUtil.toString(properties.get(SHARED_KEY), null);
@@ -348,4 +359,11 @@ public class Config {
public boolean isEncryptionEnabled() {
return encryptionEnabled;
}
+
+ /**
+ * @return true if the auto-stopping of local-loop topology connectors is enabled.
+ */
+ public boolean isAutoStopLocalLoopEnabled() {
+ return autoStopLocalLoopEnabled;
+ }
}
Modified: sling/trunk/bundles/extensions/discovery/impl/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1564403&r1=1564402&r2=1564403&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/main/resources/OSGI-INF/metatype/metatype.properties (original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/main/resources/OSGI-INF/metatype/metatype.properties Tue Feb 4 18:10:57 2014
@@ -55,6 +55,11 @@ leaderElectionRepositoryDescriptor.descr
into account for leader election: those instances have preference to become leader which have \
the corresponding descriptor value of 'false'.
+autoStopLocalLoopEnabled.name = Enable Auto-Stop for Local-Loop Connectors
+autoStopLocalLoopEnabled.description = If true, and the discovery.impl detects a local-looping \
+ topology connector, the corresponding topology connector will be automatically stopped. \
+ This is useful to prevent unnecessary loops with eg pre-configured topology connectors.
+
hmacEnabled.name = Enable Hmac message signatures
hmacEnabled.description = If true, and the Shared Key is set to the same value on all members of the \
topology, the messages will be validated using a HMAC of a digest of the body of the message. \