brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graeme-Miller <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #818: More on adjunct highlights
Date Wed, 13 Sep 2017 14:37:04 GMT
Github user Graeme-Miller commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/818#discussion_r138638872
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java
---
    @@ -568,6 +570,98 @@ public void setUniqueTag(String uniqueTag) {
             return highlightsToReturn;
         }
     
    +    /** Records a named highlight against this object, for persistence and API access.
    +     * See common highlights including {@link #HIGHLIGHT_NAME_LAST_ACTION} and
    +     * {@link #HIGHLIGHT_NAME_LAST_CONFIRMATION}.
    +     * Also see convenience methods eg  {@link #highlightOngoing(String, String)} and
{@link #highlight(String, String, Task)}
    +     * and {@link HighlightTuple}. 
    +     */
    +    protected void setHighlight(String name, HighlightTuple tuple) {
    +        highlights.put(name, tuple);
    +    }
    +
    +    /** As {@link #setHighlight(String, HighlightTuple)}, convenience for recording an
item which is intended to be ongoing. */
    +    protected void highlightOngoing(String name, String description) {
    +        highlights.put(name, new HighlightTuple(description, 0, null));
    --- End diff --
    
    Should be calling setHighlight, rather than putting directly into the map. This would
allow these methods to remain uncoupled from how we store the highlights. Same for the below
highlight methods.


---

Mime
View raw message