summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2019-01-03 18:54:01 +0100
committerJon Marius Venstad <venstad@gmail.com>2019-01-03 18:54:01 +0100
commitcea4ddb1d2d8b3ae8a51b99fb92fa73cd1964807 (patch)
treebcaba7a8ae6ddc4d2936dddcb07753dfbed9c1a5 /controller-api
parent5a678c888e69f29713a1050e3c18fed03735207d (diff)
Update notifications syntax
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java14
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Mail.java7
2 files changed, 11 insertions, 10 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java
index f833ff9babe..7d1369da864 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/DeploymentFailureMails.java
@@ -4,7 +4,7 @@ import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.RunId;
import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry;
-import java.util.List;
+import java.util.Collection;
/**
* Used to create mails for different kinds of deployment failure.
@@ -19,38 +19,38 @@ public class DeploymentFailureMails {
this.registry = registry;
}
- public Mail outOfCapacity(RunId id, List<String> recipients) {
+ public Mail outOfCapacity(RunId id, Collection<String> recipients) {
return mail(id, recipients, " due to lack of capacity",
"as the zone does not have enough free capacity to " +
"accomodate the deployment. Please contact the Vespa team to request more!");
}
- public Mail deploymentFailure(RunId id, List<String> recipients) {
+ public Mail deploymentFailure(RunId id, Collection<String> recipients) {
return mail(id, recipients, " deployment",
"and any previous deployment in the zone is unaffected. " +
"This is usually due to an invalid application configuration, or because " +
"of timeouts waiting for other deployments of the same application to finish.");
}
- public Mail installationFailure(RunId id, List<String> recipients) {
+ public Mail installationFailure(RunId id, Collection<String> recipients) {
return mail(id, recipients, "installation",
"as nodes were not able to start the new Java containers. " +
"This is very often due to a misconfiguration of the components of an " +
"application, where one or more of these can not be instantiated.");
}
- public Mail testFailure(RunId id, List<String> recipients) {
+ public Mail testFailure(RunId id, Collection<String> recipients) {
return mail(id, recipients, "tests",
"as one or more verification tests against the deployment failed.");
}
- public Mail systemError(RunId id, List<String> recipients) {
+ public Mail systemError(RunId id, Collection<String> recipients) {
return mail(id, recipients, "due to system error",
"as something in the framework went wrong. Such errors are " +
"usually transient. Please contact the Vespa team if the problem persists!");
}
- private Mail mail(RunId id, List<String> recipients, String summaryDetail, String messageDetail) {
+ private Mail mail(RunId id, Collection<String> recipients, String summaryDetail, String messageDetail) {
return new Mail(recipients,
String.format("Vespa application %s: %s failing %s",
id.application(),
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Mail.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Mail.java
index a3f492da21f..38b9cd4db5a 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Mail.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Mail.java
@@ -2,6 +2,7 @@ package com.yahoo.vespa.hosted.controller.api.integration.organization;
import com.google.common.collect.ImmutableList;
+import java.util.Collection;
import java.util.List;
import java.util.Objects;
@@ -12,11 +13,11 @@ import java.util.Objects;
*/
public class Mail {
- private final List<String> recipients;
+ private final Collection<String> recipients;
private final String subject;
private final String message;
- public Mail(List<String> recipients, String subject, String message) {
+ public Mail(Collection<String> recipients, String subject, String message) {
if (recipients.isEmpty())
throw new IllegalArgumentException("Empty recipient list is not allowed.");
recipients.forEach(Objects::requireNonNull);
@@ -25,7 +26,7 @@ public class Mail {
this.message = Objects.requireNonNull(message);
}
- public List<String> recipients() { return recipients; }
+ public Collection<String> recipients() { return recipients; }
public String subject() { return subject; }
public String message() { return message; }