diff options
Diffstat (limited to 'controller-api')
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!"); |