diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2017-11-17 10:58:50 +0100 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2017-11-17 10:58:50 +0100 |
commit | c189a6cf1629438f01297815b8c8073ca0185ce4 (patch) | |
tree | 23623e5a546b6517da9ca3fd7906fa0ea963c154 /controller-api | |
parent | 0181f8096639237153f466d1f1b5993c52f701c8 (diff) | |
parent | 359d3c4a6d22a0ea4aef20e7293fe808228d4b6f (diff) |
Resolved conflict
Diffstat (limited to 'controller-api')
2 files changed, 76 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/OwnershipIssues.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/OwnershipIssues.java new file mode 100644 index 00000000000..8ded0c5fb52 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/OwnershipIssues.java @@ -0,0 +1,48 @@ +package com.yahoo.vespa.hosted.controller.api.integration.organization; + +import com.yahoo.config.provision.ApplicationId; +import com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId; + +import java.util.Optional; + +/** + * Periodically issues ownership confirmation requests for given applications, and escalates the issues if needed. + * + * Even machines wrought from cold steel occasionally require the gentle touch only a fleshling can provide. + * By making humans regularly acknowledge their dedication to given applications, this class provides the machine + * with reassurance that any misbehaving applications will swiftly be dealt with. + * Ignored confirmation requests are periodically redirected to humans of higher rank, until they are acknowledged. + * + * @author jvenstad + */ +public interface OwnershipIssues { + + /** + * Ensure ownership of the given application has been recently confirmed by the given property. + * + * @param issueId ID of the previous ownership issue filed for the given application. + * @param applicationId ID of the application for which to file an issue. + * @param propertyId ID of the property responsible for the given application. + * @return ID of the created issue, if one was created. + */ + Optional<IssueId> confirmOwnership(Optional<IssueId> issueId, ApplicationId applicationId, PropertyId propertyId); + + /** + * Ensure ownership of the given application has been recently confirmed by the given user. + * + * @param issueId ID of the previous ownership issue filed for the given application. + * @param applicationId ID of the application for which to file an issue. + * @param owner ID of the user responsible for the given application. + * @return ID of the created issue, if one was created. + */ + Optional<IssueId> confirmOwnership(Optional<IssueId> issueId, ApplicationId applicationId, User owner); + + /** + * Make sure the given ownership confirmation request is acted upon, unless it is already acknowledged. + * + * @param issueId ID of the ownership issue to escalate. + * @param propertyId ID of the property responsible for the issue, if any. + */ + void ensureResponse(IssueId issueId, Optional<PropertyId> propertyId); + +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/DummyOwnershipIssues.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/DummyOwnershipIssues.java new file mode 100644 index 00000000000..0cf103739d1 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/DummyOwnershipIssues.java @@ -0,0 +1,28 @@ +package com.yahoo.vespa.hosted.controller.api.integration.stubs; + +import com.yahoo.config.provision.ApplicationId; +import com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId; +import com.yahoo.vespa.hosted.controller.api.integration.organization.IssueId; +import com.yahoo.vespa.hosted.controller.api.integration.organization.OwnershipIssues; +import com.yahoo.vespa.hosted.controller.api.integration.organization.User; + +import java.util.Optional; + +public class DummyOwnershipIssues implements OwnershipIssues { + + @Override + public Optional<IssueId> confirmOwnership(Optional<IssueId> issueId, ApplicationId applicationId, PropertyId propertyId) { + return Optional.empty(); + } + + @Override + public Optional<IssueId> confirmOwnership(Optional<IssueId> issueId, ApplicationId applicationId, User owner) { + return Optional.empty(); + } + + @Override + public void ensureResponse(IssueId issueId, Optional<PropertyId> propertyId) { + + } + +} |