diff options
author | andreer <andreer@verizonmedia.com> | 2019-04-17 13:54:21 +0200 |
---|---|---|
committer | andreer <andreer@verizonmedia.com> | 2019-04-17 13:54:21 +0200 |
commit | 454f616dee6e2ded7460fecb8a98a8ea63b69978 (patch) | |
tree | 451eadb227eefa4a38b56a868282286ff7dabf93 /controller-api | |
parent | 3e0a75f6e7c5fc5af04690343744bc6f61c56e29 (diff) |
create multiple records when required
Diffstat (limited to 'controller-api')
2 files changed, 9 insertions, 7 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java index 63faadfe555..1fd63beab39 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/MemoryNameService.java @@ -43,10 +43,12 @@ public class MemoryNameService implements NameService { } @Override - public Record createTxt(RecordName name, RecordData txtData) { - Record record = new Record(Record.Type.TXT, name, txtData); - records.add(record); - return record; + public List<Record> createTxtRecords(RecordName name, List<RecordData> txtData) { + List<Record> records = txtData.stream() + .map(data -> new Record(Record.Type.TXT, name, data)) + .collect(Collectors.toList()); + this.records.addAll(records); + return records; } @Override 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 1bac0f6cfc1..903ea250935 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 @@ -32,10 +32,10 @@ public interface NameService { /** * Create a new TXT record containing the provided data. * @param name Name of the created record - * @param txtData TXT data for the record, consisting of one or more space-separated <em>double-quoted</em> strings: "string1" "string2" - * @return The created record + * @param txtRecords TXT data values for the record, each consisting of one or more space-separated <em>double-quoted</em> strings: "string1" "string2" + * @return The created records */ - Record createTxt(RecordName name, RecordData txtData); + List<Record> createTxtRecords(RecordName name, List<RecordData> txtRecords); /** Find all records matching given type and name */ List<Record> findRecords(Record.Type type, RecordName name); |