1// Copyright (c) 2004 Brian Wellington (bwelling@xbill.org) 2 3package org.xbill.DNS; 4 5/** 6 * Route Through Record - lists a route preference and intermediate host. 7 * 8 * @author Brian Wellington 9 */ 10 11public class RTRecord extends U16NameBase { 12 13private static final long serialVersionUID = -3206215651648278098L; 14 15RTRecord() {} 16 17Record 18getObject() { 19 return new RTRecord(); 20} 21 22/** 23 * Creates an RT Record from the given data 24 * @param preference The preference of the route. Smaller numbers indicate 25 * more preferred routes. 26 * @param intermediateHost The domain name of the host to use as a router. 27 */ 28public 29RTRecord(Name name, int dclass, long ttl, int preference, 30 Name intermediateHost) 31{ 32 super(name, Type.RT, dclass, ttl, preference, "preference", 33 intermediateHost, "intermediateHost"); 34} 35 36/** Gets the preference of the route. */ 37public int 38getPreference() { 39 return getU16Field(); 40} 41 42/** Gets the host to use as a router. */ 43public Name 44getIntermediateHost() { 45 return getNameField(); 46} 47 48} 49