summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authortoby <smorgrav@yahoo-inc.com>2018-10-04 09:38:01 +0200
committertoby <smorgrav@yahoo-inc.com>2018-10-04 09:38:01 +0200
commite9d5eadda69dcc2e3619ba7fcf5473e27f323c24 (patch)
tree91ded799073f352cf5883bf0ce13f3aa83051ed9 /controller-api
parent34a575c8292deeefed1974ccc6ad89bab9587bee (diff)
Add method to look up multiple records by name and apply this
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/NameService.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/NameService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/NameService.java
index 1d341f06f90..356bdeecfc8 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/NameService.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/NameService.java
@@ -1,6 +1,7 @@
// 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.dns;
+import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@@ -20,8 +21,16 @@ public interface NameService {
RecordId createCname(RecordName alias, RecordData canonicalName);
/** Find record by type and name */
+ @Deprecated
Optional<Record> findRecord(Record.Type type, RecordName name);
+ /** Find record by type and name - may return multiple records */
+ default List<Record> findRecords(Record.Type type, RecordName name) {
+ List<Record> result = new ArrayList<>();
+ findRecord(type, name).ifPresent(result::add);
+ return result;
+ }
+
/** Find record by type and data */
List<Record> findRecord(Record.Type type, RecordData data);