From f0e4070343a768fe766d9251edbd90253d48fef7 Mon Sep 17 00:00:00 2001 From: John McCabe Date: Wed, 13 Jan 2016 15:54:01 +0000 Subject: [PATCH] deprecate group.members.delegate and prevent delegate creation when adding to quarantine - use of delegate to denote quarantine group membership in the jsgui is no longer required due to #929 --- .../org/apache/brooklyn/entity/group/AbstractGroup.java | 6 +++++- .../org/apache/brooklyn/entity/group/AbstractGroupImpl.java | 1 + .../org/apache/brooklyn/entity/group/QuarantineGroup.java | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroup.java b/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroup.java index aa9ca90c75..625d9810a7 100644 --- a/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroup.java +++ b/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroup.java @@ -58,8 +58,12 @@ public interface AbstractGroup extends Entity, Group, Changeable { AttributeSensor FIRST = Sensors.newSensor(Entity.class, "cluster.first.entity", "The first member of the cluster"); + /** + * @deprecated since 0.9.0, the UI no longer relies on the use of delegates to represent group membership (see #929) + */ + @Deprecated ConfigKey MEMBER_DELEGATE_CHILDREN = ConfigKeys.newBooleanConfigKey( - "group.members.delegate", "Add delegate child entities for members of the group", Boolean.FALSE); + "group.members.delegate", "Deprecated: Add delegate child entities for members of the group", Boolean.FALSE); ConfigKey MEMBER_DELEGATE_NAME_FORMAT = ConfigKeys.newStringConfigKey( "group.members.delegate.nameFormat", "Delegate members name format string (Use %s for the original entity display name)", "%s"); diff --git a/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java b/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java index d8814bd4a0..bfd366f1f6 100644 --- a/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java +++ b/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/AbstractGroupImpl.java @@ -146,6 +146,7 @@ public boolean addMember(Entity member) { sensors().emit(MEMBER_ADDED, member); if (Boolean.TRUE.equals(getConfig(MEMBER_DELEGATE_CHILDREN))) { + log.warn("Use of deprecated ConfigKey {} in {} (as of 0.9.0)", MEMBER_DELEGATE_CHILDREN.getName(), this); Optional result = Iterables.tryFind(getChildren(), Predicates.equalTo(member)); if (!result.isPresent()) { String nameFormat = Optional.fromNullable(getConfig(MEMBER_DELEGATE_NAME_FORMAT)).or("%s"); diff --git a/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/QuarantineGroup.java b/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/QuarantineGroup.java index e6f2aabf8a..c13d914ec2 100644 --- a/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/QuarantineGroup.java +++ b/brooklyn-server/core/src/main/java/org/apache/brooklyn/entity/group/QuarantineGroup.java @@ -27,8 +27,6 @@ @ImplementedBy(QuarantineGroupImpl.class) public interface QuarantineGroup extends AbstractGroup { - ConfigKey MEMBER_DELEGATE_CHILDREN = ConfigKeys.newConfigKeyWithDefault(AbstractGroup.MEMBER_DELEGATE_CHILDREN, Boolean.TRUE); - @Effector(description="Removes all members of the quarantined group, unmanaging them") void expungeMembers( @EffectorParam(name="firstStop", description="Whether to first call stop() on those members that are stoppable") boolean stopFirst);