@Override public DnsRawRecord replace(ByteBuf content) { return new DefaultDnsRawRecord(name(), type(), dnsClass(), timeToLive(), content); }
@Override public DnsRawRecord retain() { content().retain(); return this; }
new DefaultDnsRawRecord(hostname, type, 86400, content))); return promise;
.dnsTTL(txtRecord.timeToLive()) .build();
new DefaultDnsRawRecord(hostname, type, 86400, content))); return promise;
.dnsTTL(txtRecord.timeToLive()) .build();
@Override public DnsRawRecord replace(ByteBuf content) { return new DefaultDnsRawRecord(name(), type(), dnsClass(), timeToLive(), content); }
@Override public boolean release(int decrement) { return content().release(decrement); }
/** * Decodes a record from the information decoded so far by {@link #decodeRecord(ByteBuf)}. * * @param name the domain name of the record * @param type the type of the record * @param dnsClass the class of the record * @param timeToLive the TTL of the record * @param in the {@link ByteBuf} that contains the RDATA * @param offset the start offset of the RDATA in {@code in} * @param length the length of the RDATA * * @return a {@link DnsRawRecord}. Override this method to decode RDATA and return other record implementation. */ protected DnsRecord decodeRecord( String name, DnsRecordType type, int dnsClass, long timeToLive, ByteBuf in, int offset, int length) throws Exception { // DNS message compression means that domain names may contain "pointers" to other positions in the packet // to build a full message. This means the indexes are meaningful and we need the ability to reference the // indexes un-obstructed, and thus we cannot use a slice here. // See https://www.ietf.org/rfc/rfc1035 [4.1.4. Message compression] if (type == DnsRecordType.PTR) { return new DefaultDnsPtrRecord( name, dnsClass, timeToLive, decodeName0(in.duplicate().setIndex(offset, offset + length))); } return new DefaultDnsRawRecord( name, type, dnsClass, timeToLive, in.retainedDuplicate().setIndex(offset, offset + length)); }
@Override public String toString() { final StringBuilder buf = new StringBuilder(64).append(StringUtil.simpleClassName(this)).append('('); final DnsRecordType type = type(); if (type != DnsRecordType.OPT) { buf.append(name().isEmpty()? "<root>" : name()) .append(' ') .append(timeToLive()) .append(' '); DnsMessageUtil.appendRecordClass(buf, dnsClass()) .append(' ') .append(type.name()); } else { buf.append("OPT flags:") .append(timeToLive()) .append(" udp:") .append(dnsClass()); } buf.append(' ') .append(content().readableBytes()) .append("B)"); return buf.toString(); } }
@Override public DnsRawRecord retain(int increment) { content().retain(increment); return this; }
/** * Decodes a record from the information decoded so far by {@link #decodeRecord(ByteBuf)}. * * @param name the domain name of the record * @param type the type of the record * @param dnsClass the class of the record * @param timeToLive the TTL of the record * @param in the {@link ByteBuf} that contains the RDATA * @param offset the start offset of the RDATA in {@code in} * @param length the length of the RDATA * * @return a {@link DnsRawRecord}. Override this method to decode RDATA and return other record implementation. */ protected DnsRecord decodeRecord( String name, DnsRecordType type, int dnsClass, long timeToLive, ByteBuf in, int offset, int length) throws Exception { // DNS message compression means that domain names may contain "pointers" to other positions in the packet // to build a full message. This means the indexes are meaningful and we need the ability to reference the // indexes un-obstructed, and thus we cannot use a slice here. // See https://www.ietf.org/rfc/rfc1035 [4.1.4. Message compression] if (type == DnsRecordType.PTR) { return new DefaultDnsPtrRecord( name, dnsClass, timeToLive, decodeName0(in.duplicate().setIndex(offset, offset + length))); } return new DefaultDnsRawRecord( name, type, dnsClass, timeToLive, in.retainedDuplicate().setIndex(offset, offset + length)); }
@Override public String toString() { final StringBuilder buf = new StringBuilder(64).append(StringUtil.simpleClassName(this)).append('('); final DnsRecordType type = type(); if (type != DnsRecordType.OPT) { buf.append(name().isEmpty()? "<root>" : name()) .append(' ') .append(timeToLive()) .append(' '); DnsMessageUtil.appendRecordClass(buf, dnsClass()) .append(' ') .append(type.name()); } else { buf.append("OPT flags:") .append(timeToLive()) .append(" udp:") .append(dnsClass()); } buf.append(' ') .append(content().readableBytes()) .append("B)"); return buf.toString(); } }
@Override public boolean release() { return content().release(); }