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 Details

    • MemoryNameService

      public MemoryNameService()
  • Method Details

    • records

      public Set<Record> records()
    • add

      public void add(Record record)
    • createRecord

      public Record createRecord(Record.Type type, RecordName name, RecordData canonicalName)
      Description copied from interface: NameService
      Create a new record
      Specified by:
      createRecord in interface NameService
      Parameters:
      type - The DNS type of record to make, only a small set of types are supported, check with the implementation
      name - Name of the record, e.g. a FQDN for records of type A
      canonicalName - Data of the record, e.g. IP address for records of type A
      Returns:
      The created record
    • createAlias

      public List<Record> createAlias(RecordName name, Set<AliasTarget> targets)
      Description copied from interface: NameService
      Create a non-standard ALIAS record pointing to given targets. Implementations of this are expected to be idempotent
      Specified by:
      createAlias in interface NameService
      targets - Targets that should be resolved by this name.
      Returns:
      The created records. One per target.
    • createDirect

      public List<Record> createDirect(RecordName name, Set<DirectTarget> targets)
      Description copied from interface: NameService
      Create a non-standard record pointing to given targets. Implementations of this are expected to be idempotent
      Specified by:
      createDirect in interface NameService
      targets - 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: NameService
      Create a new TXT record containing the provided data.
      Specified by:
      createTxtRecords in interface NameService
      Parameters:
      name - Name of the created record
      txtData - 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: NameService
      Find all records matching given type and name
      Specified by:
      findRecords in interface NameService
    • findRecords

      public List<Record> findRecords(Record.Type type, RecordData data)
      Description copied from interface: NameService
      Find all records matching given type and data
      Specified by:
      findRecords in interface NameService
    • updateRecord

      public void updateRecord(Record record, RecordData newData)
      Description copied from interface: NameService
      Update existing record
      Specified by:
      updateRecord in interface NameService
    • removeRecords

      public void removeRecords(List<Record> records)
      Description copied from interface: NameService
      Remove given record(s)
      Specified by:
      removeRecords in interface NameService