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

    https://github.com/apache/brooklyn-server/pull/564#discussion_r103450036
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/feed/AbstractCommandFeed.java ---
    @@ -0,0 +1,260 @@
    +/*
    + * 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.feed;
    +
    +import static com.google.common.base.Preconditions.checkNotNull;
    +
    +import java.io.IOException;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.Set;
    +import java.util.concurrent.Callable;
    +import java.util.concurrent.TimeUnit;
    +
    +import org.apache.brooklyn.api.entity.Entity;
    +import org.apache.brooklyn.api.entity.EntityLocal;
    +import org.apache.brooklyn.api.location.MachineLocation;
    +import org.apache.brooklyn.config.ConfigKey;
    +import org.apache.brooklyn.core.config.ConfigKeys;
    +import org.apache.brooklyn.core.feed.AbstractFeed;
    +import org.apache.brooklyn.core.feed.AttributePollHandler;
    +import org.apache.brooklyn.core.feed.DelegatingPollHandler;
    +import org.apache.brooklyn.core.feed.Poller;
    +import org.apache.brooklyn.core.location.Locations;
    +import org.apache.brooklyn.feed.ssh.SshPollValue;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +import org.apache.brooklyn.util.time.Duration;
    +
    +import com.google.common.base.Objects;
    +import com.google.common.base.Supplier;
    +import com.google.common.base.Suppliers;
    +import com.google.common.collect.HashMultimap;
    +import com.google.common.collect.SetMultimap;
    +import com.google.common.collect.Sets;
    +import com.google.common.reflect.TypeToken;
    +
    +/**
    + * Provides a feed of attribute values, by polling over ssh.
    + * 
    + * Example usage (e.g. in an entity that extends SoftwareProcessImpl):
    + * <pre>
    + * {@code
    + * private SshFeed feed;
    + * 
    + * //@Override
    + * protected void connectSensors() {
    + *   super.connectSensors();
    + *   
    + *   feed = SshFeed.builder()
    + *       .entity(this)
    + *       .machine(mySshMachineLachine)
    + *       .poll(new CommandPollConfig<Boolean>(SERVICE_UP)
    + *           .command("rabbitmqctl -q status")
    + *           .onSuccess(new Function<SshPollValue, Boolean>() {
    + *               public Boolean apply(SshPollValue input) {
    + *                 return (input.getExitStatus() == 0);
    + *               }}))
    + *       .build();
    + * }
    + * 
    + * {@literal @}Override
    + * protected void disconnectSensors() {
    + *   super.disconnectSensors();
    + *   if (feed != null) feed.stop();
    + * }
    + * }
    + * </pre>
    + * 
    + * @author aled
    --- End diff --
    
    The comment is not accurate for this class. Could replace it with 
references to the implementing classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to