Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/879#discussion_r149351706
  
    --- Diff: 
policy/src/main/java/org/apache/brooklyn/policy/ha/PropagatePrimaryEnricher.java
 ---
    @@ -0,0 +1,204 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.brooklyn.policy.ha;
    +
    +import java.util.Collection;
    +import java.util.Map;
    +import java.util.Set;
    +
    +import org.apache.brooklyn.api.effector.Effector;
    +import org.apache.brooklyn.api.entity.Entity;
    +import org.apache.brooklyn.api.mgmt.TaskAdaptable;
    +import org.apache.brooklyn.api.sensor.AttributeSensor;
    +import org.apache.brooklyn.api.sensor.EnricherSpec;
    +import org.apache.brooklyn.api.sensor.Sensor;
    +import org.apache.brooklyn.api.sensor.SensorEvent;
    +import org.apache.brooklyn.api.sensor.SensorEventListener;
    +import org.apache.brooklyn.config.ConfigKey;
    +import org.apache.brooklyn.core.config.ConfigKeys;
    +import org.apache.brooklyn.core.effector.Effectors;
    +import org.apache.brooklyn.core.effector.EffectorTasks.EffectorTaskFactory;
    +import org.apache.brooklyn.core.enricher.AbstractEnricher;
    +import org.apache.brooklyn.core.entity.EntityInternal;
    +import 
org.apache.brooklyn.core.entity.EntityInternal.SensorSupportInternal;
    +import org.apache.brooklyn.core.sensor.Sensors;
    +import org.apache.brooklyn.enricher.stock.Propagator;
    +import org.apache.brooklyn.util.collections.MutableSet;
    +import org.apache.brooklyn.util.core.config.ConfigBag;
    +import org.apache.brooklyn.util.core.task.DynamicTasks;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import com.google.common.base.Objects;
    +
    +/** Makes all sensors/effectors available on primary mirrored at this node,
    + * apart from those already present here. */ 
    +@SuppressWarnings("rawtypes")
    +public class PropagatePrimaryEnricher extends AbstractEnricher implements 
SensorEventListener {
    --- End diff --
    
    I'd unit test this directly, rather than just as part of the 
`ElectPrimaryTest`.


---

Reply via email to