diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-04-29 12:12:25 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-05-24 15:16:13 +0200 |
commit | 432b79f947965c6fa13102757998d42d0f17ab5e (patch) | |
tree | 44af6d394a7c1fe1efbf2137cb683127ce139408 /config-model/src/main/java/com/yahoo/config/model/producer | |
parent | f63093f6519dbad54cf7293826100ce6b510880a (diff) |
Assign Slobroks only on cluster controllers
Diffstat (limited to 'config-model/src/main/java/com/yahoo/config/model/producer')
-rw-r--r-- | config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java b/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java index 602e0c80d4b..2784c111019 100644 --- a/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java +++ b/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java @@ -43,7 +43,7 @@ public abstract class AbstractConfigProducer<CHILD extends AbstractConfigProduce private final String subId; private String configId = null; - private List<Service> descendantServices = new ArrayList<>(); + private final List<Service> descendantServices = new ArrayList<>(); private AbstractConfigProducer parent = null; @@ -59,8 +59,8 @@ public abstract class AbstractConfigProducer<CHILD extends AbstractConfigProduce * Creates a new AbstractConfigProducer with the given parent and subId. * This constructor will add the resulting producer to the children of parent. * - * @param parent The parent of this ConfigProducer - * @param subId The fragment of the config id for the producer + * @param parent the parent of this ConfigProducer + * @param subId the fragment of the config id for the producer */ public AbstractConfigProducer(AbstractConfigProducer parent, String subId) { this(subId); @@ -69,7 +69,13 @@ public abstract class AbstractConfigProducer<CHILD extends AbstractConfigProduce } } - protected final void setParent(AbstractConfigProducer parent) { + /** Removes this from the config model */ + protected void remove() { + if (parent != null) + parent.removeChild(this); + } + + protected final void setParent(AbstractConfigProducer<?> parent) { this.parent = parent; computeConfigId(); } @@ -92,7 +98,7 @@ public abstract class AbstractConfigProducer<CHILD extends AbstractConfigProduce /** * Adds a child to this config producer. * - * @param child The child config producer to add. + * @param child the child config producer to add */ protected void addChild(CHILD child) { if (child == null) { |