brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Don't spin BrooklynEntityMirror f...
Date Thu, 04 Jun 2015 12:37:17 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/672#discussion_r31715825
  
    --- Diff: software/base/src/main/java/brooklyn/entity/brooklynnode/EntityHttpClient.java
---
    @@ -23,10 +23,29 @@
     import brooklyn.util.http.HttpTool;
     import brooklyn.util.http.HttpToolResponse;
     
    +import com.google.common.base.Predicate;
    +import com.google.common.base.Predicates;
    +import com.google.common.collect.Range;
    +
     /**
      * Helpful methods for making HTTP requests to {@link BrooklynNode} entities.
      */
     public interface EntityHttpClient {
    +    interface ResponseCodePredicates {
    +        static class ResponseCodeHealthyPredicate implements Predicate<Integer>
{
    +            @Override
    +            public boolean apply(Integer input) {
    +                return HttpTool.isStatusCodeHealthy(input);
    +            }
    +        }
    +        Predicate<Integer> INFORMATIONAL = Range.closed(100, 199);
    --- End diff --
    
    I have a personal preference for methods rather than static constants, which gives us
future flexibility. That follows the guava convention, such as the method `Predicates.alwaysTrue()`.
In this case I can't see why we'd ever change it, but I'd prefer us sticking to the general
guava pattern.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message