01: // Copyright (c) 2004 Brian Wellington (bwelling@xbill.org)
02:
03: package org.xbill.DNS;
04:
05: /**
06: * Route Through Record - lists a route preference and intermediate host.
07: *
08: * @author Brian Wellington
09: */
10:
11: public class RTRecord extends U16NameBase {
12:
13: RTRecord() {
14: }
15:
16: Record getObject() {
17: return new RTRecord();
18: }
19:
20: /**
21: * Creates an RT Record from the given data
22: * @param preference The preference of the route. Smaller numbers indicate
23: * more preferred routes.
24: * @param intermediateHost The domain name of the host to use as a router.
25: */
26: public RTRecord(Name name, int dclass, long ttl, int preference,
27: Name intermediateHost) {
28: super (name, Type.RT, dclass, ttl, preference, "preference",
29: intermediateHost, "intermediateHost");
30: }
31:
32: /** Gets the preference of the route. */
33: public int getPreference() {
34: return getU16Field();
35: }
36:
37: /** Gets the host to use as a router. */
38: public Name getIntermediateHost() {
39: return getNameField();
40: }
41:
42: }
|