Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate group.members.delegate and prevent delegate creation when adding to quarantine #1142

Merged
merged 1 commit into from
Jan 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ public interface AbstractGroup extends Entity, Group, Changeable {
AttributeSensor<Entity> 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<Boolean> 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<String> MEMBER_DELEGATE_NAME_FORMAT = ConfigKeys.newStringConfigKey(
"group.members.delegate.nameFormat", "Delegate members name format string (Use %s for the original entity display name)", "%s");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Entity> result = Iterables.tryFind(getChildren(), Predicates.equalTo(member));
if (!result.isPresent()) {
String nameFormat = Optional.fromNullable(getConfig(MEMBER_DELEGATE_NAME_FORMAT)).or("%s");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
@ImplementedBy(QuarantineGroupImpl.class)
public interface QuarantineGroup extends AbstractGroup {

ConfigKey<Boolean> 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);
Expand Down