Added highlights to policy endpoint#813
Conversation
|
looks good, nice and straightforward. will run some tests then merge assuming all good. |
There was a problem hiding this comment.
Few minors
General
Im struggling to see how a client will use this information. Is it just an arbitrary selection of stuff that the adjunct wishes to surface that will change from adjunct to adjunct? If so i think the highlight should probably contain more information to describe what it is
| * under the License. | ||
| */ | ||
| package org.apache.brooklyn.api.objs; | ||
|
|
| package org.apache.brooklyn.api.objs; | ||
|
|
||
| public class HighlightTuple { | ||
|
|
There was a problem hiding this comment.
Would AdjunctHighlight be a better name?
| if (this == o) return true; | ||
| if (o == null || getClass() != o.getClass()) return false; | ||
|
|
||
| HighlightTuple that = (HighlightTuple) o; |
There was a problem hiding this comment.
Id personally use guava Objects.equalsas its already a dependency
|
|
||
| @Override | ||
| public int hashCode() { | ||
| int result = description != null ? description.hashCode() : 0; |
|
works a treat, did a sample impl on |
|
@m4rkmckenna re your general comment, a human client will use this to understand what's going on. currently adjuncts (policies etc) are opaque unless you look at logs or tasks (or code). highlights are an arbitrary set of summary info -- although with some conventions -- which let an adjunct communicate to a user at a high level what it has been doing. on the premise that a little bit of sensibly distilled info is better than lots of raw info -- but sensible distillation does depend on the adjunct author a bit. (i'd like to have activities properly tagged to adjuncts as well, so we can also expose lots of "raw" info.) your point about javadoc is a good one so people know how to use these -- added in #818. i prefer the name i also prefer |
Policies now return highlights from the REST API. Highlights are a map of ids -> (description, time, task id). They are used to expose more information about a policy, for example the last action or the triggers for a policy.
I have also updated the rebind code such that policies can have there highlights re-bound.
In the future highlights will be extended to all adjuncts.