From 7efeffd2c2724b0951828b0e423d590c8691fe10 Mon Sep 17 00:00:00 2001 From: Brian Murphy Date: Fri, 7 Nov 2014 10:38:43 +0000 Subject: [PATCH] Add License header to all files and javadocs for AlertClientInterface. This commit adds the license header to all java files and enforces the license check on compile. It also adds javadocs for all the methods in the AlertClientInterface Original commit: elastic/x-pack-elasticsearch@2ec6f89b4ba1536a23fd5080e15db3eb4cf472cd --- pom.xml | 36 +++++++++ .../alerts/actions/AlertActionEntry.java | 2 - .../alerts/actions/package-info.java | 2 - .../alerts/client/AlertsClientInterface.java | 76 ++++++++++++++++++- .../elasticsearch/alerts/package-info.java | 3 - .../alerts/rest/package-info.java | 2 - .../alerts/scheduler/package-info.java | 2 - .../actions/delete/DeleteAlertAction.java | 3 - .../actions/delete/DeleteAlertRequest.java | 1 - .../transport/actions/get/GetAlertAction.java | 3 - .../alerts/triggers/AlertTrigger.java | 2 +- .../alerts/triggers/package-info.java | 2 - 12 files changed, 109 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index a120c73ccdb..ea2d7ac4a2b 100644 --- a/pom.xml +++ b/pom.xml @@ -195,6 +195,42 @@ + + default + + true + + + + + com.mycila + license-maven-plugin + 2.5 + +
dev-tools/elasticsearch_license_header.txt
+ + dev-tools/license_header_definition.xml + + + src/main/java/org/elasticsearch/**/*.java + src/test/java/org/elasticsearch/**/*.java + + + +
+ + + compile + + check + + + +
+
+
+
+ coverage diff --git a/src/main/java/org/elasticsearch/alerts/actions/AlertActionEntry.java b/src/main/java/org/elasticsearch/alerts/actions/AlertActionEntry.java index 63e0fca9597..9d23a20a8f1 100644 --- a/src/main/java/org/elasticsearch/alerts/actions/AlertActionEntry.java +++ b/src/main/java/org/elasticsearch/alerts/actions/AlertActionEntry.java @@ -5,12 +5,10 @@ */ package org.elasticsearch.alerts.actions; -import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.alerts.Alert; import org.elasticsearch.alerts.triggers.AlertTrigger; -import org.elasticsearch.alerts.triggers.TriggerResult; import org.elasticsearch.common.io.stream.DataOutputStreamOutput; import org.elasticsearch.common.joda.time.DateTime; import org.elasticsearch.common.xcontent.ToXContent; diff --git a/src/main/java/org/elasticsearch/alerts/actions/package-info.java b/src/main/java/org/elasticsearch/alerts/actions/package-info.java index bd6023ea8c6..69fab0082aa 100644 --- a/src/main/java/org/elasticsearch/alerts/actions/package-info.java +++ b/src/main/java/org/elasticsearch/alerts/actions/package-info.java @@ -3,6 +3,4 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -/** - */ package org.elasticsearch.alerts.actions; \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/alerts/client/AlertsClientInterface.java b/src/main/java/org/elasticsearch/alerts/client/AlertsClientInterface.java index 46006a7b56a..63be219434c 100644 --- a/src/main/java/org/elasticsearch/alerts/client/AlertsClientInterface.java +++ b/src/main/java/org/elasticsearch/alerts/client/AlertsClientInterface.java @@ -21,29 +21,97 @@ import org.elasticsearch.client.ElasticsearchClient; */ public interface AlertsClientInterface extends ElasticsearchClient { + /** + * Creates a request builder that gets an alert by name (id) + * + * @param alertName the name (id) of the alert + * @return The request builder + */ GetAlertRequestBuilder prepareGetAlert(String alertName); + /** + * Creates a request builder that gets an alert + * + * @return the request builder + */ GetAlertRequestBuilder prepareGetAlert(); - public void getAlert(GetAlertRequest request, ActionListener response); + /** + * Gets an alert from the alert index + * + * @param request The get alert request + * @param listener The listener for the get alert response containing the GetResponse for this alert + */ + public void getAlert(GetAlertRequest request, ActionListener listener); + /** + * Gets an alert from the alert index + * + * @param request The get alert request with the alert name (id) + * @return The response containing the GetResponse for this alert + */ ActionFuture getAlert(GetAlertRequest request); - + /** + * Creates a request builder to delete an alert by name (id) + * + * @param alertName the name (id) of the alert + * @return The request builder + */ DeleteAlertRequestBuilder prepareDeleteAlert(String alertName); + /** + * Creates a request builder that deletes an alert + * + * @return The request builder + */ DeleteAlertRequestBuilder prepareDeleteAlert(); - public void deleteAlert(DeleteAlertRequest request, ActionListener response); + /** + * Deletes an alert + * + * @param request The delete request with the alert name (id) to be deleted + * @param listener The listener for the delete alert response containing the DeleteResponse for this action + */ + public void deleteAlert(DeleteAlertRequest request, ActionListener listener); + /** + * Deletes an alert + * + * @param request The delete request with the alert name (id) to be deleted + * @return The response containing the DeleteResponse for this action + */ ActionFuture deleteAlert(DeleteAlertRequest request); + /** + * Creates a request builder to build a request to index an alert + * + * @param alertName The name of the alert to index + * @return The builder to create the alert + */ IndexAlertRequestBuilder prepareIndexAlert(String alertName); + /** + * Creates a request builder to build a request to index an alert + * + * @return The builder + */ IndexAlertRequestBuilder prepareIndexAlert(); - public void indexAlert(IndexAlertRequest request, ActionListener response); + /** + * Indexes an alert and registers it with the scheduler + * + * @param request The request containing the alert to index and register + * @param listener The listener for the response containing the IndexResponse for this alert + */ + public void indexAlert(IndexAlertRequest request, ActionListener listener); + /** + * Indexes an alert and registers it with the scheduler + * + * @param request The request containing the alert to index and register + * @return The response containing the IndexResponse for this alert + */ ActionFuture indexAlert(IndexAlertRequest request); } diff --git a/src/main/java/org/elasticsearch/alerts/package-info.java b/src/main/java/org/elasticsearch/alerts/package-info.java index 01b86a19d65..9abf2c2be37 100644 --- a/src/main/java/org/elasticsearch/alerts/package-info.java +++ b/src/main/java/org/elasticsearch/alerts/package-info.java @@ -3,7 +3,4 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -/** - * Created by brian on 8/12/14. - */ package org.elasticsearch.alerts; \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/alerts/rest/package-info.java b/src/main/java/org/elasticsearch/alerts/rest/package-info.java index 5a546ae1503..603040d6744 100644 --- a/src/main/java/org/elasticsearch/alerts/rest/package-info.java +++ b/src/main/java/org/elasticsearch/alerts/rest/package-info.java @@ -3,6 +3,4 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -/** - */ package org.elasticsearch.alerts.rest; \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/alerts/scheduler/package-info.java b/src/main/java/org/elasticsearch/alerts/scheduler/package-info.java index 9936f79ca3a..3d9acfc9f9a 100644 --- a/src/main/java/org/elasticsearch/alerts/scheduler/package-info.java +++ b/src/main/java/org/elasticsearch/alerts/scheduler/package-info.java @@ -3,6 +3,4 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -/** - */ package org.elasticsearch.alerts.scheduler; \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/alerts/transport/actions/delete/DeleteAlertAction.java b/src/main/java/org/elasticsearch/alerts/transport/actions/delete/DeleteAlertAction.java index b3689d0b145..d0600ba82f5 100644 --- a/src/main/java/org/elasticsearch/alerts/transport/actions/delete/DeleteAlertAction.java +++ b/src/main/java/org/elasticsearch/alerts/transport/actions/delete/DeleteAlertAction.java @@ -5,11 +5,8 @@ */ package org.elasticsearch.alerts.transport.actions.delete; -import org.elasticsearch.action.ClientAction; -import org.elasticsearch.alerts.client.AlertsClient; import org.elasticsearch.alerts.client.AlertsClientAction; import org.elasticsearch.alerts.client.AlertsClientInterface; -import org.elasticsearch.client.Client; /** */ diff --git a/src/main/java/org/elasticsearch/alerts/transport/actions/delete/DeleteAlertRequest.java b/src/main/java/org/elasticsearch/alerts/transport/actions/delete/DeleteAlertRequest.java index 72d905ba4a6..3bde1601dc9 100644 --- a/src/main/java/org/elasticsearch/alerts/transport/actions/delete/DeleteAlertRequest.java +++ b/src/main/java/org/elasticsearch/alerts/transport/actions/delete/DeleteAlertRequest.java @@ -70,7 +70,6 @@ public class DeleteAlertRequest extends MasterNodeOperationRequest