From bed7ddbb01e922281ab268098357ebc42e47c0a3 Mon Sep 17 00:00:00 2001 From: Brian Murphy Date: Thu, 20 Nov 2014 17:24:20 +0000 Subject: [PATCH] DOCS : Add some java docs. Original commit: elastic/x-pack-elasticsearch@394d957364fa86010f497eff8774c4b515c2d27a --- .../java/org/elasticsearch/alerts/AlertAckState.java | 7 ++++++- .../transport/actions/ack/AckAlertResponse.java | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/alerts/AlertAckState.java b/src/main/java/org/elasticsearch/alerts/AlertAckState.java index d97eeb85629..141adefad60 100644 --- a/src/main/java/org/elasticsearch/alerts/AlertAckState.java +++ b/src/main/java/org/elasticsearch/alerts/AlertAckState.java @@ -11,7 +11,12 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import java.io.IOException; /** - * @TODO add jdocs + * This class represents the ack (acknowleged state of an alert) + * + * NOT_ACKABLE : This alert cannot be ACKed + * NOT_TRIGGERED : This alert is in the base line state. A positive trigger will cause the alert to move to the NEEDS_ACK state + * NEEDS_ACK : This alert is in the fired state and has sent an alert action, subsequent positive triggers will cause more actions to occur + * ACKED : This alert has been acknowleged, subsequent positive triggers will not cause actions to occur, a negative trigger will move the alert back into NOT_TRIGGERED state */ public enum AlertAckState implements ToXContent { NOT_ACKABLE, ///@TODO perhaps null diff --git a/src/main/java/org/elasticsearch/alerts/transport/actions/ack/AckAlertResponse.java b/src/main/java/org/elasticsearch/alerts/transport/actions/ack/AckAlertResponse.java index fc46f312991..5c917dddee6 100644 --- a/src/main/java/org/elasticsearch/alerts/transport/actions/ack/AckAlertResponse.java +++ b/src/main/java/org/elasticsearch/alerts/transport/actions/ack/AckAlertResponse.java @@ -14,6 +14,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import java.io.IOException; /** + * This class contains the ackState of the alert, if the alert was successfully acked this will be ACK */ public class AckAlertResponse extends ActionResponse { @@ -22,14 +23,25 @@ public class AckAlertResponse extends ActionResponse { public AckAlertResponse() { } + /** + * The Constructor that takes the ack state for the alert + * @param alertAckState + */ public AckAlertResponse(@Nullable AlertAckState alertAckState) { this.alertAckState = alertAckState; } + /** + * @return The ack state for the alert + */ public AlertAckState getAlertAckState() { return alertAckState; } + public void setAlertAckState(AlertAckState alertAckState) { + this.alertAckState = alertAckState; + } + @Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in);