01: // Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)
02:
03: package org.xbill.DNS;
04:
05: /**
06: * Key Exchange - delegation of authority
07: *
08: * @author Brian Wellington
09: */
10:
11: public class KXRecord extends U16NameBase {
12:
13: KXRecord() {
14: }
15:
16: Record getObject() {
17: return new KXRecord();
18: }
19:
20: /**
21: * Creates a KX Record from the given data
22: * @param preference The preference of this KX. Records with lower priority
23: * are preferred.
24: * @param target The host that authority is delegated to
25: */
26: public KXRecord(Name name, int dclass, long ttl, int preference,
27: Name target) {
28: super (name, Type.KX, dclass, ttl, preference, "preference",
29: target, "target");
30: }
31:
32: /** Returns the target of the KX record */
33: public Name getTarget() {
34: return getNameField();
35: }
36:
37: /** Returns the preference of this KX record */
38: public int getPreference() {
39: return getU16Field();
40: }
41:
42: public Name getAdditionalName() {
43: return getNameField();
44: }
45:
46: }
|