summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2018-01-05 15:16:27 +0100
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2018-02-26 16:01:14 +0100
commit5fc4864fe9240f07d13796bb2ae3c4c761c74341 (patch)
tree8b76a172f5a9ced5821f57ff208e674e86d45d76 /controller-api
parent784e50fff8f6658f2565633d5cec8619591311b5 (diff)
Revert "Revert "Jvenstad/pushing build system""
This reverts commit e65ca655fd3b8a6293fba56d031a973874452412.
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/BuildService.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/BuildService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/BuildService.java
index 7933a23c45f..5e9c8d73b38 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/BuildService.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/BuildService.java
@@ -1,18 +1,21 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration;
+import java.util.Objects;
+
/**
* @author jvenstad
*/
public interface BuildService {
/**
- * Enqueue a job defined by "buildJob in an external build system, and return the outcome of the enqueue request.
- * This method should return @false only when a retry is in order, and @true otherwise, e.g., on success, or for
+ * Enqueue a job defined by buildJob in an external build system, and return the outcome of the enqueue request.
+ * This method should return false only when a retry is in order, and true otherwise, e.g., on success, or for
* invalid jobs.
*/
boolean trigger(BuildJob buildJob);
+
class BuildJob {
private final long projectId;
@@ -27,7 +30,23 @@ public interface BuildService {
public String jobName() { return jobName; }
@Override
- public String toString() { return jobName + "@" + projectId; }
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if ( ! (o instanceof BuildJob)) return false;
+ BuildJob buildJob = (BuildJob) o;
+ return projectId == buildJob.projectId &&
+ Objects.equals(jobName, buildJob.jobName);
+ }
+
+ @Override
+ public String toString() {
+ return jobName + "@" + projectId;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(projectId, jobName);
+ }
}