Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

AS7-5753 Reject virtual-nodes in add handler as well

  • Loading branch information...
commit 9fbc0be878dca7b54c3a6ed958f4fb744e66bcbe 1 parent 7c411e6
@bstansberry bstansberry authored
View
8 clustering/infinispan/src/main/java/org/jboss/as/clustering/infinispan/subsystem/DistributedCacheAdd.java
@@ -28,6 +28,7 @@
import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.ConfigurationBuilder;
+import org.jboss.as.clustering.infinispan.InfinispanMessages;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.operations.common.Util;
@@ -55,6 +56,13 @@ private DistributedCacheAdd() {
void populate(ModelNode fromModel, ModelNode toModel) throws OperationFailedException {
super.populate(fromModel, toModel);
+ @SuppressWarnings("deprecation")
+ final String deprecatedKey = ModelKeys.VIRTUAL_NODES;
+ if (fromModel.hasDefined(deprecatedKey)
+ && fromModel.get(deprecatedKey).asInt() != 1) {
+ throw InfinispanMessages.MESSAGES.attributeDeprecated(deprecatedKey);
+ }
+
DistributedCacheResource.OWNERS.validateAndSet(fromModel, toModel);
DistributedCacheResource.SEGMENTS.validateAndSet(fromModel, toModel);
DistributedCacheResource.L1_LIFESPAN.validateAndSet(fromModel, toModel);
Please sign in to comment.
Something went wrong with that request. Please try again.