Add DnsWriter for Cloud DNS

The plumbing to support different DnsWriter implementations per TLD
using DI will come in a later CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129375856
This commit is contained in:
Greg Shikhman 2016-08-04 14:46:12 -07:00 committed by Justine Tunney
parent 51bdb26e7d
commit 0e4244a03d
6 changed files with 481 additions and 0 deletions

View file

@ -17,6 +17,7 @@ package google.registry.model.domain.secdns;
import com.google.common.annotations.VisibleForTesting;
import com.googlecode.objectify.annotation.Embed;
import google.registry.model.ImmutableObject;
import javax.xml.bind.DatatypeConverter;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
@ -90,4 +91,15 @@ public class DelegationSignerData
public int compareTo(DelegationSignerData other) {
return Integer.compare(getKeyTag(), other.getKeyTag());
}
/**
* Returns the presentation format of this DS record.
*
* @see <a href="https://tools.ietf.org/html/rfc4034#section-5.3">RFC 4034 Section 5.3</a>
*/
public String toRrData() {
return String.format(
"%d %d %d %s",
this.keyTag, this.algorithm, this.digestType, DatatypeConverter.printHexBinary(digest));
}
}