summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2021-07-16 09:45:26 +0200
committerMartin Polden <mpolden@mpolden.no>2021-07-16 09:54:12 +0200
commitf820d4442bcf87dcce0b17db81a638db21404fa1 (patch)
treef7f72f7de6459b3f6d41aa3e300278b0a28e273a /controller-api
parent51d3f222baeb36bfbec3e1d56016b68d129f82b0 (diff)
Remove unused method from CloudEventFetcher
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java4
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/CloudEventFetcher.java (renamed from controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/AwsEventFetcher.java)7
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockAwsEventFetcher.java34
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockCloudEventFetcher.java25
4 files changed, 29 insertions, 41 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
index fdd66c037d9..4714b74ba94 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
@@ -4,7 +4,7 @@ package com.yahoo.vespa.hosted.controller.api.integration;
import com.yahoo.vespa.hosted.controller.api.integration.archive.ArchiveService;
import com.yahoo.vespa.hosted.controller.api.integration.athenz.AccessControlService;
import com.yahoo.vespa.hosted.controller.api.integration.aws.RoleService;
-import com.yahoo.vespa.hosted.controller.api.integration.aws.AwsEventFetcher;
+import com.yahoo.vespa.hosted.controller.api.integration.aws.CloudEventFetcher;
import com.yahoo.vespa.hosted.controller.api.integration.aws.ResourceTagger;
import com.yahoo.vespa.hosted.controller.api.integration.billing.BillingController;
import com.yahoo.vespa.hosted.controller.api.integration.certificates.EndpointCertificateProvider;
@@ -68,7 +68,7 @@ public interface ServiceRegistry {
CostReportConsumer costReportConsumer();
- AwsEventFetcher eventFetcherService();
+ CloudEventFetcher eventFetcherService();
ArtifactRepository artifactRepository();
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/AwsEventFetcher.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/CloudEventFetcher.java
index 42c7e3c2590..1085897f22b 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/AwsEventFetcher.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/CloudEventFetcher.java
@@ -1,16 +1,13 @@
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.aws;
-import com.yahoo.vespa.hosted.controller.api.integration.organization.Issue;
-
import java.util.List;
/**
* @author freva
*/
-public interface AwsEventFetcher {
+public interface CloudEventFetcher {
- List<CloudEvent> getEvents(String awsRegionName);
- Issue createIssue(CloudEvent event);
+ List<CloudEvent> getEvents(String regionName);
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockAwsEventFetcher.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockAwsEventFetcher.java
deleted file mode 100644
index 056d5bec223..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockAwsEventFetcher.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.api.integration.aws;
-
-import com.yahoo.vespa.hosted.controller.api.integration.organization.Issue;
-import com.yahoo.vespa.hosted.controller.api.integration.organization.User;
-
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.ArrayList;
-import java.util.Optional;
-
-/**
- * @author freva
- */
-public class MockAwsEventFetcher implements AwsEventFetcher {
-
- private final Map<String, List<CloudEvent>> mockedEvents = new HashMap<>();
-
- @Override
- public List<CloudEvent> getEvents(String awsRegionName) {
- return mockedEvents.getOrDefault(awsRegionName, new ArrayList<>());
- }
-
- @Override
- public Issue createIssue(CloudEvent event) {
- return new Issue("summary", event.affectedInstances.toString(), "VESPA", Optional.empty()).with(User.from(event.awsRegionName));
- }
-
- public void addEvent(String awsRegionName, CloudEvent cloudEvent) {
- mockedEvents.computeIfAbsent(awsRegionName, i -> new ArrayList<>()).add(cloudEvent);
- }
-
-}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockCloudEventFetcher.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockCloudEventFetcher.java
new file mode 100644
index 00000000000..c2d803caaf5
--- /dev/null
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockCloudEventFetcher.java
@@ -0,0 +1,25 @@
+// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.vespa.hosted.controller.api.integration.aws;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author freva
+ */
+public class MockCloudEventFetcher implements CloudEventFetcher {
+
+ private final Map<String, List<CloudEvent>> mockedEvents = new HashMap<>();
+
+ @Override
+ public List<CloudEvent> getEvents(String regionName) {
+ return mockedEvents.getOrDefault(regionName, new ArrayList<>());
+ }
+
+ public void addEvent(String regionName, CloudEvent cloudEvent) {
+ mockedEvents.computeIfAbsent(regionName, i -> new ArrayList<>()).add(cloudEvent);
+ }
+
+}