aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2017-10-26 15:47:41 +0200
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2017-10-26 15:47:41 +0200
commit243aa7d33bc9fc1bcaa4640cd9ad1f0e2f0a3008 (patch)
tree92059cfadbcadcb44fd71ae3085baa85f699f427 /controller-api
parenta17560d462b57c0eda372795a16eb68c6c397ebe (diff)
Comments taken into account
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java7
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/IssueId.java3
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/MockOrganization.java6
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Organization.java6
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/User.java9
5 files changed, 28 insertions, 3 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java
index 74f02172af0..df182b56fd8 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java
@@ -6,6 +6,12 @@ import com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId;
import java.util.Objects;
import java.util.Optional;
+/**
+ * Represents an issue which needs to reported, typically from the controller, to a responsible party,
+ * the identity of which is determined by the propertyId and, possibly, assignee fields.
+ *
+ * @author jvenstad
+ */
public class Issue {
private final String summary;
@@ -37,6 +43,7 @@ public class Issue {
public Issue withLabel(String label) {
return new Issue(summary, description, label, assignee, propertyId);
}
+
public Issue withAssignee(User assignee) {
return new Issue(summary, description, label, assignee, propertyId);
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/IssueId.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/IssueId.java
index 42524c865c9..84b441ff4a8 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/IssueId.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/IssueId.java
@@ -4,6 +4,9 @@ package com.yahoo.vespa.hosted.controller.api.integration.organization;
import java.util.Objects;
/**
+ * Used to identify issues stored in some issue tracking system.
+ * The {@code value()} and {@code from()} methods should be inverses.
+ *
* @author jvenstad
*/
public class IssueId {
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/MockOrganization.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/MockOrganization.java
index e8effe91263..4eaca8fb642 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/MockOrganization.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/MockOrganization.java
@@ -90,17 +90,17 @@ public class MockOrganization implements Organization {
@Override
public URI issueCreationUri(PropertyId propertyId) {
- return URI.create("www.issues.com/" + propertyId.id());
+ return URI.create("www.issues.tld/" + propertyId.id());
}
@Override
public URI contactsUri(PropertyId propertyId) {
- return URI.create("www.contacts.com/" + propertyId.id());
+ return URI.create("www.contacts.tld/" + propertyId.id());
}
@Override
public URI propertyUri(PropertyId propertyId) {
- return URI.create("www.properties.com/" + propertyId.id());
+ return URI.create("www.properties.tld/" + propertyId.id());
}
public void close(IssueId issueId) {
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Organization.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Organization.java
index d401c090b4d..00c0d87554a 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Organization.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Organization.java
@@ -9,6 +9,12 @@ import java.time.Duration;
import java.util.List;
import java.util.Optional;
+/**
+ * Represents the humans who use this software, and their organization.
+ * Lets the software report issues to its caretakers, and provides other useful human resource lookups.
+ *
+ * @author jvenstad
+ */
public interface Organization {
/**
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/User.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/User.java
index 13141ee2adb..82a86de3824 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/User.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/User.java
@@ -3,6 +3,11 @@ package com.yahoo.vespa.hosted.controller.api.integration.organization;
import java.util.Objects;
+/**
+ * Represents a human computer user, typically by UNIX account name.
+ *
+ * @author jvenstad
+ */
public class User {
private final String username;
@@ -15,6 +20,10 @@ public class User {
return username;
}
+ public String displayName() {
+ return username;
+ }
+
public static User from(String username) {
if (username.isEmpty())
throw new IllegalArgumentException("Username may not be empty!");