Update (dnsjava documentation)
Date: 2013-04-10

org.xbill.DNS

## Class Update

- java.lang.Object
- - org.xbill.DNS.Message
  - - org.xbill.DNS.Update

- All Implemented Interfaces:
    Cloneable

      public class Update
      extends Message

  A helper class for constructing dynamic DNS (DDNS) update messages.
  Author:
    Brian Wellington

- - ### Field Summary

    - ### Fields inherited from class org.xbill.DNS.Message

      `MAXLENGTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Update(Name zone)` Creates an update message.
    `Update(Name zone, int dclass)` Creates an update message.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `absent(Name name)` Inserts a prerequisite that the specified name does not exist; that is, there are no records with the given name in the zone.
    `void` | `absent(Name name, int type)` Inserts a prerequisite that the specified rrset does not exist; that is, there are no records with the given name and type in the zone.
    `void` | `add(Name name, int type, long ttl, String record)` Parses a record from the string, and indicates that the record should be inserted into the zone.
    `void` | `add(Name name, int type, long ttl, Tokenizer tokenizer)` Parses a record from the tokenizer, and indicates that the record should be inserted into the zone.
    `void` | `add(Record record)` Indicates that the record should be inserted into the zone.
    `void` | `add(Record[] records)` Indicates that the records should be inserted into the zone.
    `void` | `add(RRset rrset)` Indicates that all of the records in the rrset should be inserted into the zone.
    `void` | `delete(Name name)` Indicates that all records with the given name should be deleted from the zone.
    `void` | `delete(Name name, int type)` Indicates that all records with the given name and type should be deleted from the zone.
    `void` | `delete(Name name, int type, String record)` Parses a record from the string, and indicates that the record should be deleted from the zone.
    `void` | `delete(Name name, int type, Tokenizer tokenizer)` Parses a record from the tokenizer, and indicates that the record should be deleted from the zone.
    `void` | `delete(Record record)` Indicates that the specified record should be deleted from the zone.
    `void` | `delete(Record[] records)` Indicates that the records should be deleted from the zone.
    `void` | `delete(RRset rrset)` Indicates that all of the records in the rrset should be deleted from the zone.
    `void` | `present(Name name)` Inserts a prerequisite that the specified name exists; that is, there exist records with the given name in the zone.
    `void` | `present(Name name, int type)` Inserts a prerequisite that the specified rrset exists; that is, there exist records with the given name and type in the zone.
    `void` | `present(Name name, int type, String record)` Parses a record from the string, and inserts a prerequisite that the record exists.
    `void` | `present(Name name, int type, Tokenizer tokenizer)` Parses a record from the tokenizer, and inserts a prerequisite that the record exists.
    `void` | `present(Record record)` Inserts a prerequisite that the specified record exists.
    `void` | `replace(Name name, int type, long ttl, String record)` Parses a record from the string, and indicates that the record should be inserted into the zone replacing any other records with the same name and type.
    `void` | `replace(Name name, int type, long ttl, Tokenizer tokenizer)` Parses a record from the tokenizer, and indicates that the record should be inserted into the zone replacing any other records with the same name and type.
    `void` | `replace(Record record)` Indicates that the record should be inserted into the zone replacing any other records with the same name and type.
    `void` | `replace(Record[] records)` Indicates that the records should be inserted into the zone replacing any other records with the same name and type as each one.
    `void` | `replace(RRset rrset)` Indicates that all of the records in the rrset should be inserted into the zone replacing any other records with the same name and type.

    - ### Methods inherited from class org.xbill.DNS.Message

      `addRecord, clone, findRecord, findRecord, findRRset, findRRset, getHeader, getOPT, getQuestion, getRcode, getSectionArray, getSectionRRsets, getTSIG, isSigned, isVerified, newQuery, newUpdate, numBytes, removeAllRecords, removeRecord, sectionToString, setHeader, setTSIG, toString, toWire, toWire`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Update

          public Update(Name zone,
                int dclass)

      Creates an update message.
      Parameters:
        `zone` - The name of the zone being updated.
        `dclass` - The class of the zone being updated.

    - #### Update

          public Update(Name zone)

      Creates an update message. The class is assumed to be IN.
      Parameters:
        `zone` - The name of the zone being updated.

  - ### Method Detail

    - #### present

          public void present(Name name)

      Inserts a prerequisite that the specified name exists; that is, there exist records with the given name in the zone.

    - #### present

          public void present(Name name,
                     int type)

      Inserts a prerequisite that the specified rrset exists; that is, there exist records with the given name and type in the zone.

    - #### present

          public void present(Name name,
                     int type,
                     String record)
                       throws IOException

      Parses a record from the string, and inserts a prerequisite that the record exists. Due to the way value-dependent prequisites work, the condition that must be met is that the set of all records with the same and type in the update message must be identical to the set of all records with that name and type on the server.
      Throws:
        `IOException` - The record could not be parsed.

    - #### present

          public void present(Name name,
                     int type,
                     Tokenizer tokenizer)
                       throws IOException

      Parses a record from the tokenizer, and inserts a prerequisite that the record exists. Due to the way value-dependent prequisites work, the condition that must be met is that the set of all records with the same and type in the update message must be identical to the set of all records with that name and type on the server.
      Throws:
        `IOException` - The record could not be parsed.

    - #### present

          public void present(Record record)

      Inserts a prerequisite that the specified record exists. Due to the way value-dependent prequisites work, the condition that must be met is that the set of all records with the same and type in the update message must be identical to the set of all records with that name and type on the server.

    - #### absent

          public void absent(Name name)

      Inserts a prerequisite that the specified name does not exist; that is, there are no records with the given name in the zone.

    - #### absent

          public void absent(Name name,
                    int type)

      Inserts a prerequisite that the specified rrset does not exist; that is, there are no records with the given name and type in the zone.

    - #### add

          public void add(Name name,
                 int type,
                 long ttl,
                 String record)
                   throws IOException

      Parses a record from the string, and indicates that the record should be inserted into the zone.
      Throws:
        `IOException` - The record could not be parsed.

    - #### add

          public void add(Name name,
                 int type,
                 long ttl,
                 Tokenizer tokenizer)
                   throws IOException

      Parses a record from the tokenizer, and indicates that the record should be inserted into the zone.
      Throws:
        `IOException` - The record could not be parsed.

    - #### add

          public void add(Record record)

      Indicates that the record should be inserted into the zone.

    - #### add

          public void add(Record[] records)

      Indicates that the records should be inserted into the zone.

    - #### add

          public void add(RRset rrset)

      Indicates that all of the records in the rrset should be inserted into the zone.

    - #### delete

          public void delete(Name name)

      Indicates that all records with the given name should be deleted from the zone.

    - #### delete

          public void delete(Name name,
                    int type)

      Indicates that all records with the given name and type should be deleted from the zone.

    - #### delete

          public void delete(Name name,
                    int type,
                    String record)
                      throws IOException

      Parses a record from the string, and indicates that the record should be deleted from the zone.
      Throws:
        `IOException` - The record could not be parsed.

    - #### delete

          public void delete(Name name,
                    int type,
                    Tokenizer tokenizer)
                      throws IOException

      Parses a record from the tokenizer, and indicates that the record should be deleted from the zone.
      Throws:
        `IOException` - The record could not be parsed.

    - #### delete

          public void delete(Record record)

      Indicates that the specified record should be deleted from the zone.

    - #### delete

          public void delete(Record[] records)

      Indicates that the records should be deleted from the zone.

    - #### delete

          public void delete(RRset rrset)

      Indicates that all of the records in the rrset should be deleted from the zone.

    - #### replace

          public void replace(Name name,
                     int type,
                     long ttl,
                     String record)
                       throws IOException

      Parses a record from the string, and indicates that the record should be inserted into the zone replacing any other records with the same name and type.
      Throws:
        `IOException` - The record could not be parsed.

    - #### replace

          public void replace(Name name,
                     int type,
                     long ttl,
                     Tokenizer tokenizer)
                       throws IOException

      Parses a record from the tokenizer, and indicates that the record should be inserted into the zone replacing any other records with the same name and type.
      Throws:
        `IOException` - The record could not be parsed.

    - #### replace

          public void replace(Record record)

      Indicates that the record should be inserted into the zone replacing any other records with the same name and type.

    - #### replace

          public void replace(Record[] records)

      Indicates that the records should be inserted into the zone replacing any other records with the same name and type as each one.

    - #### replace

          public void replace(RRset rrset)

      Indicates that all of the records in the rrset should be inserted into the zone replacing any other records with the same name and type.