01: // Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)
02:
03: package org.xbill.DNS;
04:
05: import java.io.*;
06:
07: /**
08: * Responsible Person Record - lists the mail address of a responsible person
09: * and a domain where TXT records are available.
10: *
11: * @author Tom Scola <tscola@research.att.com>
12: * @author Brian Wellington
13: */
14:
15: public class RPRecord extends Record {
16:
17: private Name mailbox;
18: private Name textDomain;
19:
20: RPRecord() {
21: }
22:
23: Record getObject() {
24: return new RPRecord();
25: }
26:
27: /**
28: * Creates an RP Record from the given data
29: * @param mailbox The responsible person
30: * @param textDomain The address where TXT records can be found
31: */
32: public RPRecord(Name name, int dclass, long ttl, Name mailbox,
33: Name textDomain) {
34: super (name, Type.RP, dclass, ttl);
35:
36: this .mailbox = checkName("mailbox", mailbox);
37: this .textDomain = checkName("textDomain", textDomain);
38: }
39:
40: void rrFromWire(DNSInput in) throws IOException {
41: mailbox = new Name(in);
42: textDomain = new Name(in);
43: }
44:
45: void rdataFromString(Tokenizer st, Name origin) throws IOException {
46: mailbox = st.getName(origin);
47: textDomain = st.getName(origin);
48: }
49:
50: /** Converts the RP Record to a String */
51: String rrToString() {
52: StringBuffer sb = new StringBuffer();
53: sb.append(mailbox);
54: sb.append(" ");
55: sb.append(textDomain);
56: return sb.toString();
57: }
58:
59: /** Gets the mailbox address of the RP Record */
60: public Name getMailbox() {
61: return mailbox;
62: }
63:
64: /** Gets the text domain info of the RP Record */
65: public Name getTextDomain() {
66: return textDomain;
67: }
68:
69: void rrToWire(DNSOutput out, Compression c, boolean canonical) {
70: mailbox.toWire(out, null, canonical);
71: textDomain.toWire(out, null, canonical);
72: }
73:
74: }
|