Skip to content

Commit

Permalink
Prepare for release 0.0.2
Browse files Browse the repository at this point in the history
- update bus dependency from 0.0.5 to 0.0.6
- more jdoc fixes to pass the very strict release:perform task
  • Loading branch information
jshaughn committed May 22, 2015
1 parent 310522b commit e03a071
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
*/
package org.hawkular.actions.api.model;

import com.google.gson.annotations.Expose;
import java.util.Set;

import org.hawkular.bus.common.BasicMessage;

import java.util.Set;
import com.google.gson.annotations.Expose;

/**
* An action plugin registration message.
Expand All @@ -30,7 +31,7 @@
*
* "op" parameter define the operation (register a plugin, re-register a plugin).
* Current values are:
* - "init" -> register and initializes a plugin
* "init" : register and initializes a plugin
*
* @author Jay Shaughnessy
* @author Lucas Ponce
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

import static org.hawkular.alerts.api.model.trigger.Trigger.Mode.FIRING;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

import org.hawkular.alerts.api.log.MsgLogger;
import org.hawkular.alerts.api.model.trigger.Trigger.Mode;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

/**
* A numeric comparison condition.
* i.e. "X > 80% of Y" or "FreeSpace < 20% of TotalSpace"
* A numeric comparison condition. Examples:
* <code>"X GT 80% of Y"</code>, <code>"FreeSpace LT 20% of TotalSpace"</code>
*
* @author Jay Shaughnessy
* @author Lucas Ponce
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ public Dampening() {
/**
* Fire if we have <code>numTrueEvals</code> consecutive true evaluations of the condition set. There is
* no time limit for the evaluations.
* @param triggerId
* @param triggerId the triggerId
* @param triggerMode the trigger mode for when this dampening is active
* @param numConsecutiveTrueEvals
* @param numConsecutiveTrueEvals the numConsecutiveTrueEvals
* @return the configured Dampening
*/
public static Dampening forStrict(String triggerId, Mode triggerMode, int numConsecutiveTrueEvals) {
Expand All @@ -108,10 +108,10 @@ public static Dampening forStrict(String triggerId, Mode triggerMode, int numCon
/**
* Fire if we have <code>numTrueEvals</code> of the condition set out of <code>numTotalEvals</code>. There is
* no time limit for the evaluations.
* @param triggerId
* @param triggerId the triggerId
* @param triggerMode the trigger mode for when this dampening is active
* @param numTrueEvals
* @param numTotalEvals
* @param numTrueEvals the numTrueEvals
* @param numTotalEvals the numTotalEvals
* @return the configured Dampening
*/
public static Dampening forRelaxedCount(String triggerId, Mode triggerMode, int numTrueEvals, int numTotalEvals) {
Expand All @@ -122,9 +122,9 @@ public static Dampening forRelaxedCount(String triggerId, Mode triggerMode, int
* Fire if we have <code>numTrueEvals</code> of the condition set within <code>evalPeriod</code>. This can only
* fire if the condition set is evaluated the required number of times in the given <code>evalPeriod</code>, so
* the requisite data must be supplied in a timely manner.
* @param triggerId
* @param triggerId the triggerId
* @param triggerMode the trigger mode for when this dampening is active
* @param numTrueEvals
* @param numTrueEvals the numTrueEvals
* @param evalPeriod Elapsed real time, in milliseconds. In other words, this is not measured against
* collectionTimes (i.e. the timestamp on the data) but rather the evaluation times.
* @return the configured Dampening
Expand All @@ -135,9 +135,9 @@ public static Dampening forRelaxedTime(String triggerId, Mode triggerMode, int n

/**
* Fire if we have only true evaluations of the condition set for at least <code>evalPeriod</code>. In other
* words, fire the Trigger after N consecutive true condition set evaluations, such that N >= 2
* and delta(evalTime-1,evalTime-N) >= <code>evalPeriod</code>. Any false evaluation resets the dampening.
* @param triggerId
* words, fire the Trigger after N consecutive true condition set evaluations, such that <code>N GTE 2</code>
* and <code>delta(evalTime-1,evalTime-N) GTE evalPeriod</code>. Any false evaluation resets the dampening.
* @param triggerId the triggerId
* @param triggerMode the trigger mode for when this dampening is active
* @param evalPeriod Elapsed real time, in milliseconds. In other words, this is not measured against
* collectionTimes (i.e. the timestamp on the data) but rather the evaluation times.
Expand All @@ -149,9 +149,9 @@ public static Dampening forStrictTime(String triggerId, Mode triggerMode, long e

/**
* Fire if we have only true evaluations of the condition set for <code>evalPeriod</code>. In other
* words, fire the Trigger after N consecutive true condition set evaluations, such that N >= 1
* and delta(evalTime-1,currentTime) == <code>evalPeriod</code>. Any false evaluation resets the dampening.
* @param triggerId
* words, fire the Trigger after N consecutive true condition set evaluations, such that <code>N GTE 1</code>
* and <code>delta(evalTime-1,currentTime) == evalPeriod</code>. Any false evaluation resets the dampening.
* @param triggerId the triggerId
* @param triggerMode the trigger mode for when this dampening is active
* @param evalPeriod Elapsed real time, in milliseconds. In other words, this is not measured against
* collectionTimes (i.e. the timestamp on the data) but rather the clock starts at true-evaluation-time-1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public Availability() {
}

/**
* @param id
* @param timestamp
* @param id the id
* @param timestamp the timestamp
* @param value Must be a valid {@link AvailabilityType} name.
*/
public Availability(String id, long timestamp, String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
* A base class for incoming data into alerts subsystem. All {@link Data} has an Id and a timestamp. The
* timestamp is used to ensure that data is time-ordered when being sent into the alerting engine. If
* not assigned the timestamp will be assigned to current time.
* <br/><br/>
* <p>
* This provides a default implementation of {@link #compareTo(Data)}. Subclasses must Override this if
* they are unhappy with the Natural Ordering provided:
* Id asc, Timestamp asc, Value asc
*
* they are unhappy with the Natural Ordering provided: Id asc, Timestamp asc, Value asc
* </p>
* @author Jay Shaughnessy
* @author Lucas Ponce
*/
Expand Down Expand Up @@ -57,8 +56,10 @@ public Data() {
}

/**
* @param id not null.
* @param timestamp if <=0 assigned currentTime.
* @param id not null
* @param timestamp in millis, if less than 1 assigned currentTime.
* @param value the value
* @param type the type of data
*/
public Data(String id, long timestamp, Object value, Type type) {
this.id = id;
Expand All @@ -80,7 +81,7 @@ public long getTimestamp() {
}

/**
* @param timestamp if <=0 assigned currentTime.
* @param timestamp in millis, if less than 1 assigned currentTime.
*/
public void setTimestamp(long timestamp) {
this.timestamp = (timestamp <= 0) ? System.currentTimeMillis() : timestamp;
Expand Down Expand Up @@ -157,8 +158,8 @@ public int compareTo(Data o) {
/**
* Subclasses must provide the natural comparison of their value type. Or, override {@link #compare(Data, Data)}
* completely.
* @param value1
* @param value2
* @param value1 the value1
* @param value2 the value2
* @return standard -1, 0, 1 compare value
*/
abstract int compareValue(Object value1, Object value2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Tag() {
/**
* Create a searchable Tag on name only
*
* @param name @NotEmpty
* @param name NotEmpty
*/
public Tag(String name) {
this(null, null, name, false);
Expand All @@ -45,8 +45,8 @@ public Tag(String name) {
/**
* Create a searchable Tag on category + name
*
* @param category @Nullable
* @param tag @NotEmpty
* @param category Nullable
* @param tag NotEmpty
*/
public Tag(String category, String tag) {
this(null, category, tag, false);
Expand All @@ -55,18 +55,18 @@ public Tag(String category, String tag) {
/**
* Create an invisible Tag for persisting.
*
* @param triggerId @Nullable Note, required for storage but not search.
* @param category @Nullable
* @param tag @NotEmpty
* @param triggerId Nullable Note, required for storage but not search.
* @param category Nullable
* @param tag NotEmpty
*/
public Tag(String triggerId, String category, String tag) {
this(triggerId, category, tag, false);
}

/**
* @param triggerId @Nullable Note, required for storage but not search.
* @param category @Nullable
* @param name @NotEmpty
* @param triggerId Nullable Note, required for storage but not search.
* @param category Nullable
* @param name NotEmpty
* @param visible flag indicating whether this tag is available for display
*/
public Tag(String triggerId, String category, String name, boolean visible) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ public interface ActionsService {
void send(Action action);

/**
* Register a listener that will process asynchronously:
* - An action message
* Register a listener that will process asynchronously.
*
* @param listener the listener
*/
void addListener(ActionListener listener);
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Long getStartTime() {
}

/**
* @param startTime fetched Alerts must have cTime >= startTime
* @param startTime fetched Alerts must have cTime greater than or equal to startTime
*/
public void setStartTime(Long startTime) {
this.startTime = startTime;
Expand All @@ -59,7 +59,7 @@ public Long getEndTime() {
}

/**
* @param endTime fetched Alerts must have cTime <= endTime
* @param endTime fetched Alerts must have cTime less than or equal to endTime
*/
public void setEndTime(Long endTime) {
this.endTime = endTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,21 @@ public interface AlertsService {
/**
* Reload the specified Trigger. Removes any existing definition from the engine. If enabled then loads the firing
* condition set and dampening. If safetyEnabled then also loads the safety condition set and dampening.
* @param triggerId
* @param triggerId the triggerId
*/
void reloadTrigger(String triggerId);

/**
* @param criteria If null returns all alerts (not recommended)
* @return NotNull, can be empty.
* @throws Exception any problem
*/
List<Alert> getAlerts(AlertsCriteria criteria) throws Exception;

/**
* Persist the provided alerts.
* @param alerts Set of unpersisted Alerts.
* @throws Exception any problem
*/
void addAlerts(Collection<Alert> alerts) throws Exception;

Expand All @@ -71,6 +73,7 @@ public interface AlertsService {
* @param alertIds Alerts to be acknowledged.
* @param ackBy Optional. Typically the user acknowledging the alerts.
* @param ackNotes Optional notes about the acknowledgement.
* @throws Exception any problem
*/
void ackAlerts(Collection<String> alertIds, String ackBy, String ackNotes) throws Exception;

Expand All @@ -81,17 +84,19 @@ public interface AlertsService {
* @param resolvedBy Optional. Typically the user resolving the alerts.
* @param resolvedNotes Optional notes about the resolution.
* @param resolvedEvalSets Optional. Typically the evalSets leading to an auto-resolved alert.
* @throws Exception any problem
*/
void resolveAlerts(Collection<String> alertIds, String resolvedBy, String resolvedNotes,
List<Set<ConditionEval>> resolvedEvalSets) throws Exception;

/**
* Set unresolved alerts for the provided trigger to RESOLVED status. The resolvedTime will be set to the
* system time.
* @param triggerId
* @param triggerId the triggerId
* @param resolvedBy Optional. Typically the user resolving the alerts.
* @param resolvedNotes Optional notes about the resolution.
* @param resolvedEvalSets Optional. Typically the evalSets leading to an auto-resolved alert.
* @throws Exception any problem
*/
void resolveAlertsForTrigger(String triggerId, String resolvedBy, String resolvedNotes,
List<Set<ConditionEval>> resolvedEvalSets) throws Exception;
Expand Down

0 comments on commit e03a071

Please sign in to comment.