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@2ec6f89b4b
This commit is contained in:
Brian Murphy 2014-11-07 10:38:43 +00:00
parent 1dc9021fbe
commit 7efeffd2c2
12 changed files with 109 additions and 25 deletions

36
pom.xml
View File

@ -195,6 +195,42 @@
</plugins>
</build>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>2.5</version>
<configuration>
<header>dev-tools/elasticsearch_license_header.txt</header>
<headerDefinitions>
<headerDefinition>dev-tools/license_header_definition.xml</headerDefinition>
</headerDefinitions>
<includes>
<include>src/main/java/org/elasticsearch/**/*.java</include>
<include>src/test/java/org/elasticsearch/**/*.java</include>
</includes>
<excludes>
</excludes>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>coverage</id>
<activation>

View File

@ -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;

View File

@ -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;

View File

@ -21,29 +21,97 @@ import org.elasticsearch.client.ElasticsearchClient;
*/
public interface AlertsClientInterface extends ElasticsearchClient<AlertsClientInterface> {
/**
* 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<GetAlertResponse> 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<GetAlertResponse> 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<GetAlertResponse> 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<DeleteAlertResponse> 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<DeleteAlertResponse> 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<DeleteAlertResponse> 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<IndexAlertResponse> 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<IndexAlertResponse> 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<IndexAlertResponse> indexAlert(IndexAlertRequest request);
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
/**
*/

View File

@ -70,7 +70,6 @@ public class DeleteAlertRequest extends MasterNodeOperationRequest<DeleteAlertRe
super.writeTo(out);
out.writeString(alertName);
Versions.writeVersion(version, out);
}
@Override

View File

@ -5,11 +5,8 @@
*/
package org.elasticsearch.alerts.transport.actions.get;
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;
/**
*/

View File

@ -154,7 +154,7 @@ public class AlertTrigger implements ToXContent {
}
}
public static String asString(final TriggerType triggerType){
public static String asString(final TriggerType triggerType) {
switch (triggerType) {
case NUMBER_OF_EVENTS:
return "numberOfEvents";

View File

@ -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.triggers;