Class BaseDnsWriter

    • Constructor Detail

      • BaseDnsWriter

        public BaseDnsWriter()
    • Method Detail

      • commit

        public final void commit()
        Description copied from interface: DnsWriter
        Commits the updates to the DNS server atomically.

        The user is responsible for making sure commit() isn't called twice. Implementations are encouraged to throw an error if commit() is called twice.

        Here's an example of how you would do that

         private boolean committed = false;
         void commit() {
           checkState(!committed, "commit() has already been called");
           committed = true;
           // ... actual commit implementation
        Specified by:
        commit in interface DnsWriter
      • commitUnchecked

        protected abstract void commitUnchecked()
        Commits DNS updates. This can never be called more than once.