Class MemoryNameService
- java.lang.Object
-
- com.yahoo.vespa.hosted.controller.api.integration.dns.MemoryNameService
-
- All Implemented Interfaces:
NameService
public class MemoryNameService extends Object implements NameService
An in-memory name service for testing purposes.- Author:
- mpolden
-
-
Constructor Summary
Constructors Constructor Description MemoryNameService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Record record)List<Record>createAlias(RecordName name, Set<AliasTarget> targets)Create a non-standard ALIAS record pointing to given targets.RecordcreateCname(RecordName name, RecordData canonicalName)Create a new CNAME recordList<Record>createTxtRecords(RecordName name, List<RecordData> txtData)Create a new TXT record containing the provided data.List<Record>findRecords(Record.Type type, RecordData data)Find all records matching given type and dataList<Record>findRecords(Record.Type type, RecordName name)Find all records matching given type and nameSet<Record>records()voidremoveRecords(List<Record> records)Remove given record(s)voidupdateRecord(Record record, RecordData newData)Update existing record
-
-
-
Method Detail
-
add
public void add(Record record)
-
createCname
public Record createCname(RecordName name, RecordData canonicalName)
Description copied from interface:NameServiceCreate a new CNAME record- Specified by:
createCnamein interfaceNameService- Parameters:
name- The alias to create (lhs of the record)canonicalName- The canonical name which the alias should point to (rhs of the record). This must be a FQDN.- Returns:
- The created record
-
createAlias
public List<Record> createAlias(RecordName name, Set<AliasTarget> targets)
Description copied from interface:NameServiceCreate a non-standard ALIAS record pointing to given targets. Implementations of this are expected to be idempotent- Specified by:
createAliasin interfaceNameServicetargets- Targets that should be resolved by this name.- Returns:
- The created records. One per target.
-
createTxtRecords
public List<Record> createTxtRecords(RecordName name, List<RecordData> txtData)
Description copied from interface:NameServiceCreate a new TXT record containing the provided data.- Specified by:
createTxtRecordsin interfaceNameService- Parameters:
name- Name of the created recordtxtData- TXT data values for the record, each consisting of one or more space-separated double-quoted strings: "string1" "string2"- Returns:
- The created records
-
findRecords
public List<Record> findRecords(Record.Type type, RecordName name)
Description copied from interface:NameServiceFind all records matching given type and name- Specified by:
findRecordsin interfaceNameService
-
findRecords
public List<Record> findRecords(Record.Type type, RecordData data)
Description copied from interface:NameServiceFind all records matching given type and data- Specified by:
findRecordsin interfaceNameService
-
updateRecord
public void updateRecord(Record record, RecordData newData)
Description copied from interface:NameServiceUpdate existing record- Specified by:
updateRecordin interfaceNameService
-
removeRecords
public void removeRecords(List<Record> records)
Description copied from interface:NameServiceRemove given record(s)- Specified by:
removeRecordsin interfaceNameService
-
-