Class MemoryNameService

  • All Implemented Interfaces:
    NameService

    public class MemoryNameService
    extends Object
    implements NameService
    An in-memory name service for testing purposes.
    Author:
    mpolden
    • Constructor Detail

      • MemoryNameService

        public MemoryNameService()
    • Method Detail

      • add

        public void add​(Record record)
      • createCname

        public Record createCname​(RecordName name,
                                  RecordData canonicalName)
        Description copied from interface: NameService
        Create a new CNAME record
        Specified by:
        createCname in interface NameService
        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: 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.
      • 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