Home / Class/ DatagramDnsResponse Class — netty Architecture

DatagramDnsResponse Class — netty Architecture

Architecture documentation for the DatagramDnsResponse class in DatagramDnsResponse.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  02ebafdc_6fbb_cf94_1c01_2d44e3bcbfdd["DatagramDnsResponse"]
  b7202df5_7554_4a8c_d9bc_59bd3e893223["DatagramDnsResponse.java"]
  02ebafdc_6fbb_cf94_1c01_2d44e3bcbfdd -->|defined in| b7202df5_7554_4a8c_d9bc_59bd3e893223
  0eee8d12_c491_8876_a499_da9f977562dc["DatagramDnsResponse()"]
  02ebafdc_6fbb_cf94_1c01_2d44e3bcbfdd -->|method| 0eee8d12_c491_8876_a499_da9f977562dc
  82a8c242_88fd_2f17_4fe4_d43656780cfa["InetSocketAddress()"]
  02ebafdc_6fbb_cf94_1c01_2d44e3bcbfdd -->|method| 82a8c242_88fd_2f17_4fe4_d43656780cfa
  3d1aab0d_7a07_b187_5c62_d40187161324["equals()"]
  02ebafdc_6fbb_cf94_1c01_2d44e3bcbfdd -->|method| 3d1aab0d_7a07_b187_5c62_d40187161324
  e9a1bbf5_e1ce_4542_fadc_ed6f0ab1f7d6["hashCode()"]
  02ebafdc_6fbb_cf94_1c01_2d44e3bcbfdd -->|method| e9a1bbf5_e1ce_4542_fadc_ed6f0ab1f7d6

Relationship Graph

Source Code

codec-dns/src/main/java/io/netty/handler/codec/dns/DatagramDnsResponse.java lines 26–220

public class DatagramDnsResponse extends DefaultDnsResponse
        implements AddressedEnvelope<DatagramDnsResponse, InetSocketAddress> {

    private final InetSocketAddress sender;
    private final InetSocketAddress recipient;

    /**
     * Creates a new instance with the {@link DnsOpCode#QUERY} {@code opCode} and
     * the {@link DnsResponseCode#NOERROR} {@code RCODE}.
     *
     * @param sender the address of the sender
     * @param recipient the address of the recipient
     * @param id the {@code ID} of the DNS response
     */
    public DatagramDnsResponse(InetSocketAddress sender, InetSocketAddress recipient, int id) {
        this(sender, recipient, id, DnsOpCode.QUERY, DnsResponseCode.NOERROR);
    }

    /**
     * Creates a new instance with the {@link DnsResponseCode#NOERROR} responseCode.
     *
     * @param sender the address of the sender
     * @param recipient the address of the recipient
     * @param id the {@code ID} of the DNS response
     * @param opCode the {@code opCode} of the DNS response
     */
    public DatagramDnsResponse(InetSocketAddress sender, InetSocketAddress recipient, int id, DnsOpCode opCode) {
        this(sender, recipient, id, opCode, DnsResponseCode.NOERROR);
    }

    /**
     * Creates a new instance.
     *
     * @param sender the address of the sender
     * @param recipient the address of the recipient
     * @param id the {@code ID} of the DNS response
     * @param opCode the {@code opCode} of the DNS response
     * @param responseCode the {@code RCODE} of the DNS response
     */
    public DatagramDnsResponse(
            InetSocketAddress sender, InetSocketAddress recipient,
            int id, DnsOpCode opCode, DnsResponseCode responseCode) {
        super(id, opCode, responseCode);

        if (recipient == null && sender == null) {
            throw new NullPointerException("recipient and sender");
        }

        this.sender = sender;
        this.recipient = recipient;
    }

    @Override
    public DatagramDnsResponse content() {
        return this;
    }

    @Override
    public InetSocketAddress sender() {
        return sender;
    }

    @Override
    public InetSocketAddress recipient() {
        return recipient;
    }

    @Override
    public DatagramDnsResponse setAuthoritativeAnswer(boolean authoritativeAnswer) {
        return (DatagramDnsResponse) super.setAuthoritativeAnswer(authoritativeAnswer);
    }

    @Override
    public DatagramDnsResponse setTruncated(boolean truncated) {
        return (DatagramDnsResponse) super.setTruncated(truncated);
    }

    @Override
    public DatagramDnsResponse setRecursionAvailable(boolean recursionAvailable) {
        return (DatagramDnsResponse) super.setRecursionAvailable(recursionAvailable);
    }

Frequently Asked Questions

What is the DatagramDnsResponse class?
DatagramDnsResponse is a class in the netty codebase, defined in codec-dns/src/main/java/io/netty/handler/codec/dns/DatagramDnsResponse.java.
Where is DatagramDnsResponse defined?
DatagramDnsResponse is defined in codec-dns/src/main/java/io/netty/handler/codec/dns/DatagramDnsResponse.java at line 26.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free