Top Description Fields Constructors Methods
io.vertx.core.dns.impl.decoder

public Class RecordDecoder

extends Object
Class Inheritance
Imports
io.netty.buffer.ByteBuf, io.netty.handler.codec.DecoderException, io.netty.handler.codec.dns.DnsPtrRecord, .DnsRawRecord, .DnsRecord, .DnsRecordType, io.netty.util.CharsetUtil, io.vertx.core.dns.impl.MxRecordImpl, .SrvRecordImpl, io.vertx.core.impl.logging.Logger, .LoggerFactory, java.net.InetAddress, .UnknownHostException, java.util.ArrayList, .HashMap, .List, .Map, java.util.function.Function

Handles the decoding of resource records. Some default decoders are mapped to their resource types in the map decoders.

Field Summary

Modifier and TypeField and Description
public static final Function<DnsRecord, String>
A

Decodes A resource records into IPv4 addresses.

public static final Function<DnsRecord, String>
AAAA

Decodes AAAA resource records into IPv6 addresses.

private static final Map<DnsRecordType, Function<DnsRecord, ?>>
public static final Function<DnsRecord, String>
DOMAIN

Decodes any record that simply returns a domain name, such as NS (name server) and CNAME (canonical name) resource records.

private static final Logger
public static final Function<DnsRecord, MxRecordImpl>
MX

Decodes MX (mail exchanger) resource records.

public static final Function<DnsRecord, StartOfAuthorityRecord>
SOA

Decodes SOA (start of authority) resource records.

public static final Function<DnsRecord, SrvRecordImpl>
SRV

Decodes SRV (service) resource records.

public static final Function<DnsRecord, List<String>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static Function<DnsRecord, String>
address(int octets)

public static <T> T

Returns:

the decoded resource record
decode
(DnsRecord record)

Decodes a resource record and returns the result.

pack-priv static String

Returns:

the domain name for an entry
getName
(ByteBuf
the byte buffer containing the DNS packet
buf
,
int
the position at which the name begins
offset
)

Retrieves a domain name given a buffer containing a DNS packet without advancing the readerIndex for the buffer.

pack-priv static String

Returns:

the domain name for an entry
readName
(ByteBuf
the byte buffer containing the DNS packet
buf
)

Retrieves a domain name given a buffer containing a DNS packet.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

Aback to summary
public static final Function<DnsRecord, String> A

Decodes A resource records into IPv4 addresses.

AAAAback to summary
public static final Function<DnsRecord, String> AAAA

Decodes AAAA resource records into IPv6 addresses.

decodersback to summary
private static final Map<DnsRecordType, Function<DnsRecord, ?>> decoders
DOMAINback to summary
public static final Function<DnsRecord, String> DOMAIN

Decodes any record that simply returns a domain name, such as NS (name server) and CNAME (canonical name) resource records.

logback to summary
private static final Logger log
MXback to summary
public static final Function<DnsRecord, MxRecordImpl> MX

Decodes MX (mail exchanger) resource records.

SOAback to summary
public static final Function<DnsRecord, StartOfAuthorityRecord> SOA

Decodes SOA (start of authority) resource records.

SRVback to summary
public static final Function<DnsRecord, SrvRecordImpl> SRV

Decodes SRV (service) resource records.

TXTback to summary
public static final Function<DnsRecord, List<String>> TXT

Constructor Detail

RecordDecoderback to summary
public RecordDecoder()

Method Detail

addressback to summary
pack-priv static Function<DnsRecord, String> address(int octets)
decodeback to summary
public static <T> T decode(DnsRecord record)

Decodes a resource record and returns the result.

Returns:T

the decoded resource record

Annotations
@SuppressWarnings:unchecked
getNameback to summary
pack-priv static String getName(ByteBuf buf, int offset)

Retrieves a domain name given a buffer containing a DNS packet without advancing the readerIndex for the buffer.

Parameters
buf:ByteBuf

the byte buffer containing the DNS packet

offset:int

the position at which the name begins

Returns:String

the domain name for an entry

readNameback to summary
pack-priv static String readName(ByteBuf buf)

Retrieves a domain name given a buffer containing a DNS packet. If the name contains a pointer, the position of the buffer will be set to directly after the pointer's index after the name has been read.

Parameters
buf:ByteBuf

the byte buffer containing the DNS packet

Returns:String

the domain name for an entry