You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2005/09/01 09:55:52 UTC
svn commit: r265668 [2/3] - in /directory/protocol-providers/dns/trunk/src:
java/org/apache/dns/ java/org/apache/dns/io/ java/org/apache/dns/messages/
java/org/apache/dns/protocol/ java/org/apache/dns/records/
java/org/apache/dns/records/internet/ java...
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/RecordType.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/RecordType.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/RecordType.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/RecordType.java Thu Sep 1 00:55:12 2005
@@ -23,139 +23,136 @@
public class RecordType implements Comparable
{
- /**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
- */
- public static final RecordType A = new RecordType( 1, "A", "Host address" );
- public static final RecordType NS = new RecordType( 2, "NS", "Authoritative name server" );
- public static final RecordType MD = new RecordType( 3, "MD", "Mail destination" );
- public static final RecordType MF = new RecordType( 4, "MF", "Mail forwarder" );
- public static final RecordType CNAME = new RecordType( 5, "CNAME", "Canonical name for an alias" );
- public static final RecordType SOA = new RecordType( 6, "SOA", "Start of a zone of authority" );
- public static final RecordType MB = new RecordType( 7, "MB", "Mailbox domain name" );
- public static final RecordType MG = new RecordType( 8, "MG", "Mail group member" );
- public static final RecordType MR = new RecordType( 9, "MR", "Mail rename domain name" );
- public static final RecordType NULL = new RecordType( 10, "NULL", "Null resource record" );
- public static final RecordType WKS = new RecordType( 11, "WKS", "Well known service description" );
- public static final RecordType PTR = new RecordType( 12, "PTR", "Domain name pointer" );
- public static final RecordType HINFO = new RecordType( 13, "HINFO", "Host information" );
- public static final RecordType MINFO = new RecordType( 14, "MINFO", "Mailbox or mail list information" );
- public static final RecordType MX = new RecordType( 15, "MX", "Mail exchange" );
- public static final RecordType TXT = new RecordType( 16, "TXT", "Text strings" );
- public static final RecordType RP = new RecordType( 17, "RP", "Responsible person" );
- public static final RecordType AFSDB = new RecordType( 18, "AFSDB", "AFS cell database" );
- public static final RecordType X25 = new RecordType( 19, "X25", "X.25 calling address" );
- public static final RecordType ISDN = new RecordType( 20, "ISDN", "ISDN calling address" );
- public static final RecordType RT = new RecordType( 21, "RT", "Router" );
- public static final RecordType NSAP = new RecordType( 22, "NSAP", "NSAP address" );
- public static final RecordType NSAP_PTR = new RecordType( 23, "NSAP_PTR", "Reverse NSAP address (deprecated)" );
- public static final RecordType SIG = new RecordType( 24, "SIG", "Signature" );
- public static final RecordType KEY = new RecordType( 25, "KEY", "Key" );
- public static final RecordType PX = new RecordType( 26, "PX", "X.400 mail mapping" );
- public static final RecordType GPOS = new RecordType( 27, "GPOS", "Geographical position (withdrawn)" );
- public static final RecordType AAAA = new RecordType( 28, "AAAA", "IPv6 address" );
- public static final RecordType LOC = new RecordType( 29, "LOC", "Location" );
- public static final RecordType NXT = new RecordType( 30, "NXT", "Next valid name in zone" );
- public static final RecordType EID = new RecordType( 31, "EID", "Endpoint identifier" );
- public static final RecordType NIMLOC = new RecordType( 32, "NIMLOC", "Nimrod locator" );
- public static final RecordType SRV = new RecordType( 33, "SRV", "Server selection" );
- public static final RecordType ATMA = new RecordType( 34, "ATMA", "ATM address" );
- public static final RecordType NAPTR = new RecordType( 35, "NAPTR", "Naming authority pointer" );
- public static final RecordType KX = new RecordType( 36, "KX", "Key exchange" );
- public static final RecordType CERT = new RecordType( 34, "CERT", "Certificate" );
- public static final RecordType A6 = new RecordType( 38, "A6", "IPv6 address (experimental)" );
- public static final RecordType DNAME = new RecordType( 39, "DNAME", "Non-terminal name redirection" );
- public static final RecordType OPT = new RecordType( 41, "OPT", "Options - contains EDNS metadata" );
- public static final RecordType APL = new RecordType( 42, "APL", "Address Prefix List" );
- public static final RecordType DS = new RecordType( 43, "DS", "Delegation Signer" );
- public static final RecordType SSHFP = new RecordType( 44, "SSHFP", "SSH Key Fingerprint" );
- public static final RecordType RRSIG = new RecordType( 46, "RRSIG", "Resource Record Signature" );
- public static final RecordType NSEC = new RecordType( 47, "NSEC", "Next Secure Name" );
- public static final RecordType DNSKEY = new RecordType( 48, "DNSKEY", "DNSSEC Key" );
- public static final RecordType TKEY = new RecordType( 249, "TKEY", "Transaction key - used to compute a shared secret or exchange a key" );
- public static final RecordType TSIG = new RecordType( 250, "TSIG", "Transaction signature" );
- public static final RecordType IXFR = new RecordType( 251, "IXFR", "Incremental zone transfer" );
- public static final RecordType AXFR = new RecordType( 252, "AXFR", "Request for transfer of an entire zone" );
- public static final RecordType MAILB = new RecordType( 253, "MAILB", "Request for mailbox-related records" );
- public static final RecordType MAILA = new RecordType( 254, "MAILA", "Request for mail agent resource records" );
- public static final RecordType ANY = new RecordType( 255, "ANY", "Request for all records" );
-
- public String toString()
- {
- return name;
- }
-
- public int compareTo( Object that )
- {
- return ordinal - ( (RecordType) that ).ordinal;
- }
-
- public static RecordType getTypeByOrdinal( int type )
- {
- for ( int ii = 0; ii < values.length; ii++ )
- if ( values[ ii ].ordinal == type )
- return values[ ii ];
- return A;
- }
-
- public static RecordType getTypeByName( String type )
- {
- for ( int ii = 0; ii < values.length; ii++ )
- if ( values[ ii ].code.equalsIgnoreCase( type ) )
- return values[ ii ];
- return A;
- }
-
- public int getOrdinal()
- {
- return ordinal;
- }
-
- public static boolean isResourceRecord( RecordType resourceType )
- {
- int type = resourceType.getOrdinal();
-
- switch ( type )
- {
- case 41:
- case 249:
- case 250:
- case 251:
- case 252:
- case 253:
- case 254:
- case 255:
- return false;
- default:
- return true;
- }
- }
-
- /// PRIVATE /////
- private final String name;
- private final String code;
- private final int ordinal;
-
- /**
- * Private constructor prevents construction outside of this class.
- */
- private RecordType( int ordinal, String code, String name )
+ /**
+ * Enumeration elements are constructed once upon class loading.
+ * Order of appearance here determines the order of compareTo.
+ */
+ public static final RecordType A = new RecordType( 1, "A", "Host address" );
+ public static final RecordType NS = new RecordType( 2, "NS", "Authoritative name server" );
+ public static final RecordType MD = new RecordType( 3, "MD", "Mail destination" );
+ public static final RecordType MF = new RecordType( 4, "MF", "Mail forwarder" );
+ public static final RecordType CNAME = new RecordType( 5, "CNAME", "Canonical name for an alias" );
+ public static final RecordType SOA = new RecordType( 6, "SOA", "Start of a zone of authority" );
+ public static final RecordType MB = new RecordType( 7, "MB", "Mailbox domain name" );
+ public static final RecordType MG = new RecordType( 8, "MG", "Mail group member" );
+ public static final RecordType MR = new RecordType( 9, "MR", "Mail rename domain name" );
+ public static final RecordType NULL = new RecordType( 10, "NULL", "Null resource record" );
+ public static final RecordType WKS = new RecordType( 11, "WKS", "Well known service description" );
+ public static final RecordType PTR = new RecordType( 12, "PTR", "Domain name pointer" );
+ public static final RecordType HINFO = new RecordType( 13, "HINFO", "Host information" );
+ public static final RecordType MINFO = new RecordType( 14, "MINFO", "Mailbox or mail list information" );
+ public static final RecordType MX = new RecordType( 15, "MX", "Mail exchange" );
+ public static final RecordType TXT = new RecordType( 16, "TXT", "Text strings" );
+ public static final RecordType RP = new RecordType( 17, "RP", "Responsible person" );
+ public static final RecordType AFSDB = new RecordType( 18, "AFSDB", "AFS cell database" );
+ public static final RecordType X25 = new RecordType( 19, "X25", "X.25 calling address" );
+ public static final RecordType ISDN = new RecordType( 20, "ISDN", "ISDN calling address" );
+ public static final RecordType RT = new RecordType( 21, "RT", "Router" );
+ public static final RecordType NSAP = new RecordType( 22, "NSAP", "NSAP address" );
+ public static final RecordType NSAP_PTR = new RecordType( 23, "NSAP_PTR", "Reverse NSAP address (deprecated)" );
+ public static final RecordType SIG = new RecordType( 24, "SIG", "Signature" );
+ public static final RecordType KEY = new RecordType( 25, "KEY", "Key" );
+ public static final RecordType PX = new RecordType( 26, "PX", "X.400 mail mapping" );
+ public static final RecordType GPOS = new RecordType( 27, "GPOS", "Geographical position (withdrawn)" );
+ public static final RecordType AAAA = new RecordType( 28, "AAAA", "IPv6 address" );
+ public static final RecordType LOC = new RecordType( 29, "LOC", "Location" );
+ public static final RecordType NXT = new RecordType( 30, "NXT", "Next valid name in zone" );
+ public static final RecordType EID = new RecordType( 31, "EID", "Endpoint identifier" );
+ public static final RecordType NIMLOC = new RecordType( 32, "NIMLOC", "Nimrod locator" );
+ public static final RecordType SRV = new RecordType( 33, "SRV", "Server selection" );
+ public static final RecordType ATMA = new RecordType( 34, "ATMA", "ATM address" );
+ public static final RecordType NAPTR = new RecordType( 35, "NAPTR", "Naming authority pointer" );
+ public static final RecordType KX = new RecordType( 36, "KX", "Key exchange" );
+ public static final RecordType CERT = new RecordType( 34, "CERT", "Certificate" );
+ public static final RecordType A6 = new RecordType( 38, "A6", "IPv6 address (experimental)" );
+ public static final RecordType DNAME = new RecordType( 39, "DNAME", "Non-terminal name redirection" );
+ public static final RecordType OPT = new RecordType( 41, "OPT", "Options - contains EDNS metadata" );
+ public static final RecordType APL = new RecordType( 42, "APL", "Address Prefix List" );
+ public static final RecordType DS = new RecordType( 43, "DS", "Delegation Signer" );
+ public static final RecordType SSHFP = new RecordType( 44, "SSHFP", "SSH Key Fingerprint" );
+ public static final RecordType RRSIG = new RecordType( 46, "RRSIG", "Resource Record Signature" );
+ public static final RecordType NSEC = new RecordType( 47, "NSEC", "Next Secure Name" );
+ public static final RecordType DNSKEY = new RecordType( 48, "DNSKEY", "DNSSEC Key" );
+ public static final RecordType TKEY = new RecordType( 249, "TKEY",
+ "Transaction key - used to compute a shared secret or exchange a key" );
+ public static final RecordType TSIG = new RecordType( 250, "TSIG", "Transaction signature" );
+ public static final RecordType IXFR = new RecordType( 251, "IXFR", "Incremental zone transfer" );
+ public static final RecordType AXFR = new RecordType( 252, "AXFR", "Request for transfer of an entire zone" );
+ public static final RecordType MAILB = new RecordType( 253, "MAILB", "Request for mailbox-related records" );
+ public static final RecordType MAILA = new RecordType( 254, "MAILA", "Request for mail agent resource records" );
+ public static final RecordType ANY = new RecordType( 255, "ANY", "Request for all records" );
+
+ public String toString()
+ {
+ return name;
+ }
+
+ public int compareTo( Object that )
+ {
+ return ordinal - ( (RecordType) that ).ordinal;
+ }
+
+ public static RecordType getTypeByOrdinal( int type )
+ {
+ for ( int ii = 0; ii < values.length; ii++ )
+ if ( values[ ii ].ordinal == type ) return values[ ii ];
+ return A;
+ }
+
+ public static RecordType getTypeByName( String type )
+ {
+ for ( int ii = 0; ii < values.length; ii++ )
+ if ( values[ ii ].code.equalsIgnoreCase( type ) ) return values[ ii ];
+ return A;
+ }
+
+ public int getOrdinal()
+ {
+ return ordinal;
+ }
+
+ public static boolean isResourceRecord( RecordType resourceType )
+ {
+ int type = resourceType.getOrdinal();
+
+ switch ( type )
+ {
+ case 41:
+ case 249:
+ case 250:
+ case 251:
+ case 252:
+ case 253:
+ case 254:
+ case 255:
+ return false;
+ default:
+ return true;
+ }
+ }
+
+ /// PRIVATE /////
+ private final String name;
+ private final String code;
+ private final int ordinal;
+
+ /**
+ * Private constructor prevents construction outside of this class.
+ */
+ private RecordType( int ordinal, String code, String name )
{
this.ordinal = ordinal;
- this.code = code;
- this.name = name;
- }
-
- /**
- * These two lines are all that's necessary to export a List of VALUES.
- */
- private static final RecordType[] values = { A, NS, MD, MF, CNAME, SOA, MB,
- MG, MR, NULL, WKS, PTR, HINFO, MINFO, MX, TXT, RP, AFSDB, X25, ISDN,
- RT, NSAP, NSAP_PTR, SIG, KEY, PX, GPOS, AAAA, LOC, NXT, EID, NIMLOC,
- SRV, ATMA, NAPTR, KX, CERT, A6, DNAME, OPT, APL, DS, SSHFP, RRSIG,
- NSEC, DNSKEY, TKEY, TSIG, IXFR, AXFR, MAILB, MAILA, ANY };
- // VALUES needs to be located here, otherwise illegal forward reference
- public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+ this.code = code;
+ this.name = name;
+ }
+
+ /**
+ * These two lines are all that's necessary to export a List of VALUES.
+ */
+ private static final RecordType[] values = { A, NS, MD, MF, CNAME, SOA, MB, MG, MR, NULL, WKS, PTR, HINFO, MINFO,
+ MX, TXT, RP, AFSDB, X25, ISDN, RT, NSAP, NSAP_PTR, SIG, KEY, PX, GPOS, AAAA, LOC, NXT, EID, NIMLOC, SRV,
+ ATMA, NAPTR, KX, CERT, A6, DNAME, OPT, APL, DS, SSHFP, RRSIG, NSEC, DNSKEY, TKEY, TSIG, IXFR, AXFR, MAILB,
+ MAILA, ANY };
+ // VALUES needs to be located here, otherwise illegal forward reference
+ public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/ResourceRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/ResourceRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/ResourceRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/ResourceRecord.java Thu Sep 1 00:55:12 2005
@@ -47,32 +47,30 @@
*/
public abstract class ResourceRecord extends Record
{
- protected int timeToLive;
- protected byte[] resourceData;
-
- public ResourceRecord( String domainName, RecordType recordType, RecordClass recordClass,
- int timeToLive, byte[] resourceData )
- {
- super( domainName, recordType, recordClass );
-
- this.timeToLive = timeToLive;
- this.resourceData = resourceData;
- }
-
- protected void dataToByteBuffer( ByteBuffer byteBuffer )
- {
- super.dataToByteBuffer( byteBuffer );
-
- byteBuffer.putInt( timeToLive );
- byteBuffer.putShort( (short)resourceData.length );
- byteBuffer.put( resourceData );
- }
-
- public String toString()
- {
- return getClass().getName() + " [ " + domainName + " ( " +
- recordClass + " " + recordType + " " + timeToLive + " " +
- resourceData.length + " ) ]";
- }
-}
+ protected int timeToLive;
+ protected byte[] resourceData;
+
+ public ResourceRecord( String domainName, RecordType recordType, RecordClass recordClass, int timeToLive,
+ byte[] resourceData )
+ {
+ super( domainName, recordType, recordClass );
+
+ this.timeToLive = timeToLive;
+ this.resourceData = resourceData;
+ }
+ protected void dataToByteBuffer( ByteBuffer byteBuffer )
+ {
+ super.dataToByteBuffer( byteBuffer );
+
+ byteBuffer.putInt( timeToLive );
+ byteBuffer.putShort( (short) resourceData.length );
+ byteBuffer.put( resourceData );
+ }
+
+ public String toString()
+ {
+ return getClass().getName() + " [ " + domainName + " ( " + recordClass + " " + recordType + " " + timeToLive
+ + " " + resourceData.length + " ) ]";
+ }
+}
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/AddressRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/AddressRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/AddressRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/AddressRecord.java Thu Sep 1 00:55:12 2005
@@ -45,37 +45,36 @@
*/
public class AddressRecord extends InternetResource
{
- /**
- * Basic ResourceRecord constructor.
- */
- public AddressRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.A, timeToLive, resourceData );
- }
-
+ /**
+ * Basic ResourceRecord constructor.
+ */
+ public AddressRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.A, timeToLive, resourceData );
+ }
+
/**
* Static factory method, type-conversion operator.
*/
- public static ResourceRecord valueOf( String domainName, int timeToLive, InetAddress internetAddress )
- {
- return new AddressRecord( domainName, timeToLive, internetAddress.getAddress() );
- }
-
- /**
- * Lazy accessor.
- */
- public InetAddress getAddress()
- {
- try
- {
- return InetAddress.getByAddress( resourceData );
- }
- catch (UnknownHostException uhe)
- {
- uhe.printStackTrace();
- }
-
- return null;
- }
-}
+ public static ResourceRecord valueOf( String domainName, int timeToLive, InetAddress internetAddress )
+ {
+ return new AddressRecord( domainName, timeToLive, internetAddress.getAddress() );
+ }
+ /**
+ * Lazy accessor.
+ */
+ public InetAddress getAddress()
+ {
+ try
+ {
+ return InetAddress.getByAddress( resourceData );
+ }
+ catch ( UnknownHostException uhe )
+ {
+ uhe.printStackTrace();
+ }
+
+ return null;
+ }
+}
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/ProtocolType.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/ProtocolType.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/ProtocolType.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/ProtocolType.java Thu Sep 1 00:55:12 2005
@@ -21,102 +21,98 @@
import java.util.Collections;
import java.util.List;
-
public final class ProtocolType implements Comparable
{
- /**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
- */
- public static final ProtocolType NULL = new ProtocolType( 0, "Null" );
- public static final ProtocolType ICMP = new ProtocolType( 1, "Internet Control Message" );
- public static final ProtocolType IGMP = new ProtocolType( 2, "Internet Group Management" );
- public static final ProtocolType GGP = new ProtocolType( 3, "Gateway-to-Gateway" );
- public static final ProtocolType ST = new ProtocolType( 5, "Stream" );
- public static final ProtocolType TCP = new ProtocolType( 6, "Transmission Control" );
- public static final ProtocolType UCL = new ProtocolType( 7, "UCL" );
- public static final ProtocolType EGP = new ProtocolType( 8, "Exterior Gateway Protocol" );
- public static final ProtocolType IGP = new ProtocolType( 9, "any private interior gateway" );
- public static final ProtocolType BBN_RCC_MON = new ProtocolType( 10, "BBN RCC Monitoring" );
- public static final ProtocolType NVP_II = new ProtocolType( 11, "Network Voice Protocol" );
- public static final ProtocolType PUP = new ProtocolType( 12, "PUP" );
- public static final ProtocolType ARGUS = new ProtocolType( 13, "ARGUS" );
- public static final ProtocolType EMCON = new ProtocolType( 14, "EMCON" );
- public static final ProtocolType XNET = new ProtocolType( 15, "Cross Net Debugger" );
- public static final ProtocolType CHAOS = new ProtocolType( 16, "Chaos" );
- public static final ProtocolType UDP = new ProtocolType( 17, "User Datagram" );
- public static final ProtocolType MUX = new ProtocolType( 18, "Multiplexing" );
- public static final ProtocolType DCN_MEAS = new ProtocolType( 19, "DCN Measurement Subsystems" );
- public static final ProtocolType HMP = new ProtocolType( 20, "Host Monitoring" );
- public static final ProtocolType PRM = new ProtocolType( 21, "Packet Radio Measurement" );
- public static final ProtocolType XNS_IDP = new ProtocolType( 22, "XEROX NS IDP" );
- public static final ProtocolType TRUNK_1 = new ProtocolType( 23, "Trunk-1" );
- public static final ProtocolType TRUNK_2 = new ProtocolType( 24, "Trunk-2" );
- public static final ProtocolType LEAF_1 = new ProtocolType( 25, "Leaf-1" );
- public static final ProtocolType LEAF_2 = new ProtocolType( 26, "Leaf-2" );
- public static final ProtocolType RDP = new ProtocolType( 27, "Reliable Data Protocol" );
- public static final ProtocolType IRTP = new ProtocolType( 28, "Internet Reliable Transaction" );
- public static final ProtocolType ISO_TP4 = new ProtocolType( 29, "ISO Transport Protocol Class 4" );
- public static final ProtocolType NETBLT = new ProtocolType( 30, "Bulk Data Transfer Protocol" );
- public static final ProtocolType MFE_NSP = new ProtocolType( 31, "MFE Network Services Protocol" );
- public static final ProtocolType MERIT_INP = new ProtocolType( 32, "MERIT Internodal Protocol" );
- public static final ProtocolType SEP = new ProtocolType( 33, "Sequential Exchange Protocol" );
- public static final ProtocolType CFTP = new ProtocolType( 62, "CFTP" );
- public static final ProtocolType SAT_EXPAK = new ProtocolType( 64, "SATNET and Backroom EXPAK" );
- public static final ProtocolType MIT_SUBNET = new ProtocolType( 65, "MIT Subnet Support" );
- public static final ProtocolType RVD = new ProtocolType( 66, "MIT Remote Virtual Disk Protocol" );
- public static final ProtocolType IPPC = new ProtocolType( 67, "Internet Pluribus Packet Core" );
- public static final ProtocolType SAT_MON = new ProtocolType( 69, "SATNET Monitoring" );
- public static final ProtocolType IPCV = new ProtocolType( 71, "Internet Packet Core Utility" );
- public static final ProtocolType BR_SAT_MON = new ProtocolType( 76, "Backroom SATNET Monitoring" );
- public static final ProtocolType WB_MON = new ProtocolType( 78, "WIDEBAND Monitoring" );
- public static final ProtocolType WB_EXPAK = new ProtocolType( 79, "WIDEBAND EXPAK" );
-
- public String toString()
+ /**
+ * Enumeration elements are constructed once upon class loading.
+ * Order of appearance here determines the order of compareTo.
+ */
+ public static final ProtocolType NULL = new ProtocolType( 0, "Null" );
+ public static final ProtocolType ICMP = new ProtocolType( 1, "Internet Control Message" );
+ public static final ProtocolType IGMP = new ProtocolType( 2, "Internet Group Management" );
+ public static final ProtocolType GGP = new ProtocolType( 3, "Gateway-to-Gateway" );
+ public static final ProtocolType ST = new ProtocolType( 5, "Stream" );
+ public static final ProtocolType TCP = new ProtocolType( 6, "Transmission Control" );
+ public static final ProtocolType UCL = new ProtocolType( 7, "UCL" );
+ public static final ProtocolType EGP = new ProtocolType( 8, "Exterior Gateway Protocol" );
+ public static final ProtocolType IGP = new ProtocolType( 9, "any private interior gateway" );
+ public static final ProtocolType BBN_RCC_MON = new ProtocolType( 10, "BBN RCC Monitoring" );
+ public static final ProtocolType NVP_II = new ProtocolType( 11, "Network Voice Protocol" );
+ public static final ProtocolType PUP = new ProtocolType( 12, "PUP" );
+ public static final ProtocolType ARGUS = new ProtocolType( 13, "ARGUS" );
+ public static final ProtocolType EMCON = new ProtocolType( 14, "EMCON" );
+ public static final ProtocolType XNET = new ProtocolType( 15, "Cross Net Debugger" );
+ public static final ProtocolType CHAOS = new ProtocolType( 16, "Chaos" );
+ public static final ProtocolType UDP = new ProtocolType( 17, "User Datagram" );
+ public static final ProtocolType MUX = new ProtocolType( 18, "Multiplexing" );
+ public static final ProtocolType DCN_MEAS = new ProtocolType( 19, "DCN Measurement Subsystems" );
+ public static final ProtocolType HMP = new ProtocolType( 20, "Host Monitoring" );
+ public static final ProtocolType PRM = new ProtocolType( 21, "Packet Radio Measurement" );
+ public static final ProtocolType XNS_IDP = new ProtocolType( 22, "XEROX NS IDP" );
+ public static final ProtocolType TRUNK_1 = new ProtocolType( 23, "Trunk-1" );
+ public static final ProtocolType TRUNK_2 = new ProtocolType( 24, "Trunk-2" );
+ public static final ProtocolType LEAF_1 = new ProtocolType( 25, "Leaf-1" );
+ public static final ProtocolType LEAF_2 = new ProtocolType( 26, "Leaf-2" );
+ public static final ProtocolType RDP = new ProtocolType( 27, "Reliable Data Protocol" );
+ public static final ProtocolType IRTP = new ProtocolType( 28, "Internet Reliable Transaction" );
+ public static final ProtocolType ISO_TP4 = new ProtocolType( 29, "ISO Transport Protocol Class 4" );
+ public static final ProtocolType NETBLT = new ProtocolType( 30, "Bulk Data Transfer Protocol" );
+ public static final ProtocolType MFE_NSP = new ProtocolType( 31, "MFE Network Services Protocol" );
+ public static final ProtocolType MERIT_INP = new ProtocolType( 32, "MERIT Internodal Protocol" );
+ public static final ProtocolType SEP = new ProtocolType( 33, "Sequential Exchange Protocol" );
+ public static final ProtocolType CFTP = new ProtocolType( 62, "CFTP" );
+ public static final ProtocolType SAT_EXPAK = new ProtocolType( 64, "SATNET and Backroom EXPAK" );
+ public static final ProtocolType MIT_SUBNET = new ProtocolType( 65, "MIT Subnet Support" );
+ public static final ProtocolType RVD = new ProtocolType( 66, "MIT Remote Virtual Disk Protocol" );
+ public static final ProtocolType IPPC = new ProtocolType( 67, "Internet Pluribus Packet Core" );
+ public static final ProtocolType SAT_MON = new ProtocolType( 69, "SATNET Monitoring" );
+ public static final ProtocolType IPCV = new ProtocolType( 71, "Internet Packet Core Utility" );
+ public static final ProtocolType BR_SAT_MON = new ProtocolType( 76, "Backroom SATNET Monitoring" );
+ public static final ProtocolType WB_MON = new ProtocolType( 78, "WIDEBAND Monitoring" );
+ public static final ProtocolType WB_EXPAK = new ProtocolType( 79, "WIDEBAND EXPAK" );
+
+ public String toString()
{
- return name;
- }
+ return name;
+ }
- public int compareTo( Object that )
+ public int compareTo( Object that )
{
- return ordinal - ( (ProtocolType) that ).ordinal;
- }
+ return ordinal - ( (ProtocolType) that ).ordinal;
+ }
- public static ProtocolType getTypeByOrdinal( int type )
+ public static ProtocolType getTypeByOrdinal( int type )
{
- for ( int ii = 0; ii < values.length; ii++ )
- if ( values[ ii ].ordinal == type )
- return values[ ii ];
- return NULL;
- }
-
- public int getOrdinal()
+ for ( int ii = 0; ii < values.length; ii++ )
+ if ( values[ ii ].ordinal == type ) return values[ ii ];
+ return NULL;
+ }
+
+ public int getOrdinal()
{
- return ordinal;
- }
+ return ordinal;
+ }
- /// PRIVATE /////
- private final String name;
- private final int ordinal;
-
- /**
- * Private constructor prevents construction outside of this class.
- */
- private ProtocolType( int ordinal, String name )
+ /// PRIVATE /////
+ private final String name;
+ private final int ordinal;
+
+ /**
+ * Private constructor prevents construction outside of this class.
+ */
+ private ProtocolType( int ordinal, String name )
{
this.ordinal = ordinal;
- this.name = name;
- }
+ this.name = name;
+ }
- /**
- * These two lines are all that's necessary to export a List of VALUES.
- */
- private static final ProtocolType[] values = { NULL, ICMP, IGMP, GGP, ST, TCP, UCL,
- EGP, IGP, BBN_RCC_MON, NVP_II, PUP, ARGUS, EMCON, XNET, CHAOS, UDP, MUX,
- DCN_MEAS, HMP, PRM, XNS_IDP, TRUNK_1, TRUNK_2, LEAF_1, LEAF_2, RDP, IRTP,
- ISO_TP4, NETBLT, MFE_NSP, MERIT_INP, SEP, CFTP, SAT_EXPAK, MIT_SUBNET, RVD,
- IPPC, SAT_MON, IPCV, BR_SAT_MON, WB_MON, WB_EXPAK };
- // VALUES needs to be located here, otherwise illegal forward reference
- public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+ /**
+ * These two lines are all that's necessary to export a List of VALUES.
+ */
+ private static final ProtocolType[] values = { NULL, ICMP, IGMP, GGP, ST, TCP, UCL, EGP, IGP, BBN_RCC_MON, NVP_II,
+ PUP, ARGUS, EMCON, XNET, CHAOS, UDP, MUX, DCN_MEAS, HMP, PRM, XNS_IDP, TRUNK_1, TRUNK_2, LEAF_1, LEAF_2,
+ RDP, IRTP, ISO_TP4, NETBLT, MFE_NSP, MERIT_INP, SEP, CFTP, SAT_EXPAK, MIT_SUBNET, RVD, IPPC, SAT_MON, IPCV,
+ BR_SAT_MON, WB_MON, WB_EXPAK };
+ // VALUES needs to be located here, otherwise illegal forward reference
+ public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/ServiceType.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/ServiceType.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/ServiceType.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/ServiceType.java Thu Sep 1 00:55:12 2005
@@ -21,144 +21,139 @@
import java.util.Collections;
import java.util.List;
-
public final class ServiceType implements Comparable
{
- /**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
- */
- public static final ServiceType NULL = new ServiceType( 0, "Null" );
- public static final ServiceType RJE = new ServiceType( 5, "Remote job entry." );
- public static final ServiceType ECHO = new ServiceType( 7, "Echo" );
- public static final ServiceType DISCARD = new ServiceType( 9, "Discard" );
- public static final ServiceType USERS = new ServiceType( 11, "Active users." );
- public static final ServiceType DAYTIME = new ServiceType( 13, "Daytime" );
- public static final ServiceType QUOTE = new ServiceType( 17, "Quote of the day." );
- public static final ServiceType CHARGEN = new ServiceType( 19, "Character generator." );
- public static final ServiceType FTP_DATA = new ServiceType( 20, "File Transfer [Default Data]" );
- public static final ServiceType FTP = new ServiceType( 21, "File Transfer [Control]" );
- public static final ServiceType TELNET = new ServiceType( 23, "Telnet" );
- public static final ServiceType SMTP = new ServiceType( 25, "Simple Mail Transfer" );
- public static final ServiceType NSW_FE = new ServiceType( 27, "NSW User System FE" );
- public static final ServiceType MSG_ICP = new ServiceType( 29, "MSG ICP" );
- public static final ServiceType MSG_AUTH = new ServiceType( 31, "MSG Authentication" );
- public static final ServiceType DSP = new ServiceType( 33, "Display Support Protocol" );
- public static final ServiceType TIME = new ServiceType( 37, "Time" );
- public static final ServiceType RLP = new ServiceType( 39, "Resource Location Protocol" );
- public static final ServiceType GRAPHICS = new ServiceType( 41, "Graphics" );
- public static final ServiceType NAMESERVER = new ServiceType( 42, "Host Name Server" );
- public static final ServiceType NICKNAME = new ServiceType( 43, "Who Is" );
- public static final ServiceType MPM_FLAGS = new ServiceType( 44, "MPM FLAGS Protocol" );
- public static final ServiceType MPM = new ServiceType( 45, "Message Processing Module [recv]" );
- public static final ServiceType MPM_SND = new ServiceType( 46, "MPM [default send]" );
- public static final ServiceType NI_FTP = new ServiceType( 47, "NI FTP" );
- public static final ServiceType LOGIN = new ServiceType( 49, "Login Host Protocol" );
- public static final ServiceType LA_MAINT = new ServiceType( 51, "IMP Logical Address Maintenance" );
- public static final ServiceType DOMAIN = new ServiceType( 53, "Domain Name Server" );
- public static final ServiceType ISI_GL = new ServiceType( 55, "ISI Graphics Language" );
- public static final ServiceType NI_MAIL = new ServiceType( 61, "NI MAIL" );
- public static final ServiceType VIA_FTP = new ServiceType( 63, "VIA Systems - FTP" );
- public static final ServiceType TACACS_DS = new ServiceType( 65, "TACACS-Database Service" );
- public static final ServiceType BOOTPS = new ServiceType( 67, "Bootstrap Protocol Server" );
- public static final ServiceType BOOTPC = new ServiceType( 68, "Bootstrap Protocol Client" );
- public static final ServiceType TFTP = new ServiceType( 69, "Trivial File Transfer" );
- public static final ServiceType NETRJS_1 = new ServiceType( 71, "Remote Job Service" );
- public static final ServiceType NETRJS_2 = new ServiceType( 72, "Remote Job Service" );
- public static final ServiceType NETRJS_3 = new ServiceType( 73, "Remote Job Service" );
- public static final ServiceType NETRJS_4 = new ServiceType( 74, "Remote Job Service" );
- public static final ServiceType FINGER = new ServiceType( 79, "Finger" );
- public static final ServiceType HOSTS2_NS = new ServiceType( 81, "HOSTS2 Name Server" );
- public static final ServiceType SU_MIT_TG = new ServiceType( 89, "SU/MIT Telnet Gateway" );
- public static final ServiceType MIT_DOV = new ServiceType( 91, "MIT Dover Spooler" );
- public static final ServiceType DCP = new ServiceType( 93, "Device Control Protocol" );
- public static final ServiceType SUPDUP = new ServiceType( 95, "SUPDUP" );
- public static final ServiceType SWIFT_RVF = new ServiceType( 97, "Swift Remote Virtual File Protocol" );
- public static final ServiceType TACNEWS = new ServiceType( 98, "TAC News" );
- public static final ServiceType METAGRAM = new ServiceType( 99, "Metagram Relay" );
- public static final ServiceType HOSTNAME = new ServiceType( 101, "NIC Host Name Server" );
- public static final ServiceType ISO_TSAP = new ServiceType( 102, "ISO-TSAP" );
- public static final ServiceType X400 = new ServiceType( 103, "X400" );
- public static final ServiceType X400_SND = new ServiceType( 104, "X400-SND" );
- public static final ServiceType CSNET_NS = new ServiceType( 105, "Mailbox Name Nameserver" );
- public static final ServiceType RTELNET = new ServiceType( 107, "Remote Telnet Service" );
- public static final ServiceType POP_2 = new ServiceType( 109, "Post Office Protocol - Version 2" );
- public static final ServiceType SUNRPC = new ServiceType( 111, "SUN Remote Procedure Call" );
- public static final ServiceType AUTH = new ServiceType( 113, "Authentication Service" );
- public static final ServiceType SFTP = new ServiceType( 115, "Simple File Transfer Protocol" );
- public static final ServiceType UUCP_PATH = new ServiceType( 117, "UUCP Path Service" );
- public static final ServiceType NNTP = new ServiceType( 119, "Network News Transfer Protocol" );
- public static final ServiceType ERPC = new ServiceType( 121, "HYDRA Expedited Remote Procedure" );
- public static final ServiceType NTP = new ServiceType( 123, "Network Time Protocol" );
- public static final ServiceType LOCUS_MAP = new ServiceType( 125, "Locus PC-Interface Net Map Server" );
- public static final ServiceType LOCUS_CON = new ServiceType( 127, "Locus PC-Interface Conn Server" );
- public static final ServiceType PWDGEN = new ServiceType( 129, "Password Generator Protocol" );
- public static final ServiceType CISCO_FNA = new ServiceType( 130, "CISCO FNATIVE" );
- public static final ServiceType CISCO_TNA = new ServiceType( 131, "CISCO TNATIVE" );
- public static final ServiceType CISCO_SYS = new ServiceType( 132, "CISCO SYSMAINT" );
- public static final ServiceType STATSRV = new ServiceType( 133, "Statistics Service" );
- public static final ServiceType INGRES_NET = new ServiceType( 134, "INGRES-NET Service" );
- public static final ServiceType LOC_SRV = new ServiceType( 135, "Location Service" );
- public static final ServiceType PROFILE = new ServiceType( 136, "PROFILE Naming System" );
- public static final ServiceType NETBIOS_NS = new ServiceType( 137, "NETBIOS Name Service" );
- public static final ServiceType NETBIOS_DGM = new ServiceType( 138, "NETBIOS Datagram Service" );
- public static final ServiceType NETBIOS_SSN = new ServiceType( 139, "NETBIOS Session Service" );
- public static final ServiceType EMFIS_DATA = new ServiceType( 140, "EMFIS Data Service" );
- public static final ServiceType EMFIS_CNTL = new ServiceType( 141, "EMFIS Control Service" );
- public static final ServiceType BL_IDM = new ServiceType( 142, "Britton-Lee IDM" );
- public static final ServiceType SUR_MEAS = new ServiceType( 243, "Survey Measurement" );
- public static final ServiceType LINK = new ServiceType( 245, "LINK" );
-
- public String toString()
+ /**
+ * Enumeration elements are constructed once upon class loading.
+ * Order of appearance here determines the order of compareTo.
+ */
+ public static final ServiceType NULL = new ServiceType( 0, "Null" );
+ public static final ServiceType RJE = new ServiceType( 5, "Remote job entry." );
+ public static final ServiceType ECHO = new ServiceType( 7, "Echo" );
+ public static final ServiceType DISCARD = new ServiceType( 9, "Discard" );
+ public static final ServiceType USERS = new ServiceType( 11, "Active users." );
+ public static final ServiceType DAYTIME = new ServiceType( 13, "Daytime" );
+ public static final ServiceType QUOTE = new ServiceType( 17, "Quote of the day." );
+ public static final ServiceType CHARGEN = new ServiceType( 19, "Character generator." );
+ public static final ServiceType FTP_DATA = new ServiceType( 20, "File Transfer [Default Data]" );
+ public static final ServiceType FTP = new ServiceType( 21, "File Transfer [Control]" );
+ public static final ServiceType TELNET = new ServiceType( 23, "Telnet" );
+ public static final ServiceType SMTP = new ServiceType( 25, "Simple Mail Transfer" );
+ public static final ServiceType NSW_FE = new ServiceType( 27, "NSW User System FE" );
+ public static final ServiceType MSG_ICP = new ServiceType( 29, "MSG ICP" );
+ public static final ServiceType MSG_AUTH = new ServiceType( 31, "MSG Authentication" );
+ public static final ServiceType DSP = new ServiceType( 33, "Display Support Protocol" );
+ public static final ServiceType TIME = new ServiceType( 37, "Time" );
+ public static final ServiceType RLP = new ServiceType( 39, "Resource Location Protocol" );
+ public static final ServiceType GRAPHICS = new ServiceType( 41, "Graphics" );
+ public static final ServiceType NAMESERVER = new ServiceType( 42, "Host Name Server" );
+ public static final ServiceType NICKNAME = new ServiceType( 43, "Who Is" );
+ public static final ServiceType MPM_FLAGS = new ServiceType( 44, "MPM FLAGS Protocol" );
+ public static final ServiceType MPM = new ServiceType( 45, "Message Processing Module [recv]" );
+ public static final ServiceType MPM_SND = new ServiceType( 46, "MPM [default send]" );
+ public static final ServiceType NI_FTP = new ServiceType( 47, "NI FTP" );
+ public static final ServiceType LOGIN = new ServiceType( 49, "Login Host Protocol" );
+ public static final ServiceType LA_MAINT = new ServiceType( 51, "IMP Logical Address Maintenance" );
+ public static final ServiceType DOMAIN = new ServiceType( 53, "Domain Name Server" );
+ public static final ServiceType ISI_GL = new ServiceType( 55, "ISI Graphics Language" );
+ public static final ServiceType NI_MAIL = new ServiceType( 61, "NI MAIL" );
+ public static final ServiceType VIA_FTP = new ServiceType( 63, "VIA Systems - FTP" );
+ public static final ServiceType TACACS_DS = new ServiceType( 65, "TACACS-Database Service" );
+ public static final ServiceType BOOTPS = new ServiceType( 67, "Bootstrap Protocol Server" );
+ public static final ServiceType BOOTPC = new ServiceType( 68, "Bootstrap Protocol Client" );
+ public static final ServiceType TFTP = new ServiceType( 69, "Trivial File Transfer" );
+ public static final ServiceType NETRJS_1 = new ServiceType( 71, "Remote Job Service" );
+ public static final ServiceType NETRJS_2 = new ServiceType( 72, "Remote Job Service" );
+ public static final ServiceType NETRJS_3 = new ServiceType( 73, "Remote Job Service" );
+ public static final ServiceType NETRJS_4 = new ServiceType( 74, "Remote Job Service" );
+ public static final ServiceType FINGER = new ServiceType( 79, "Finger" );
+ public static final ServiceType HOSTS2_NS = new ServiceType( 81, "HOSTS2 Name Server" );
+ public static final ServiceType SU_MIT_TG = new ServiceType( 89, "SU/MIT Telnet Gateway" );
+ public static final ServiceType MIT_DOV = new ServiceType( 91, "MIT Dover Spooler" );
+ public static final ServiceType DCP = new ServiceType( 93, "Device Control Protocol" );
+ public static final ServiceType SUPDUP = new ServiceType( 95, "SUPDUP" );
+ public static final ServiceType SWIFT_RVF = new ServiceType( 97, "Swift Remote Virtual File Protocol" );
+ public static final ServiceType TACNEWS = new ServiceType( 98, "TAC News" );
+ public static final ServiceType METAGRAM = new ServiceType( 99, "Metagram Relay" );
+ public static final ServiceType HOSTNAME = new ServiceType( 101, "NIC Host Name Server" );
+ public static final ServiceType ISO_TSAP = new ServiceType( 102, "ISO-TSAP" );
+ public static final ServiceType X400 = new ServiceType( 103, "X400" );
+ public static final ServiceType X400_SND = new ServiceType( 104, "X400-SND" );
+ public static final ServiceType CSNET_NS = new ServiceType( 105, "Mailbox Name Nameserver" );
+ public static final ServiceType RTELNET = new ServiceType( 107, "Remote Telnet Service" );
+ public static final ServiceType POP_2 = new ServiceType( 109, "Post Office Protocol - Version 2" );
+ public static final ServiceType SUNRPC = new ServiceType( 111, "SUN Remote Procedure Call" );
+ public static final ServiceType AUTH = new ServiceType( 113, "Authentication Service" );
+ public static final ServiceType SFTP = new ServiceType( 115, "Simple File Transfer Protocol" );
+ public static final ServiceType UUCP_PATH = new ServiceType( 117, "UUCP Path Service" );
+ public static final ServiceType NNTP = new ServiceType( 119, "Network News Transfer Protocol" );
+ public static final ServiceType ERPC = new ServiceType( 121, "HYDRA Expedited Remote Procedure" );
+ public static final ServiceType NTP = new ServiceType( 123, "Network Time Protocol" );
+ public static final ServiceType LOCUS_MAP = new ServiceType( 125, "Locus PC-Interface Net Map Server" );
+ public static final ServiceType LOCUS_CON = new ServiceType( 127, "Locus PC-Interface Conn Server" );
+ public static final ServiceType PWDGEN = new ServiceType( 129, "Password Generator Protocol" );
+ public static final ServiceType CISCO_FNA = new ServiceType( 130, "CISCO FNATIVE" );
+ public static final ServiceType CISCO_TNA = new ServiceType( 131, "CISCO TNATIVE" );
+ public static final ServiceType CISCO_SYS = new ServiceType( 132, "CISCO SYSMAINT" );
+ public static final ServiceType STATSRV = new ServiceType( 133, "Statistics Service" );
+ public static final ServiceType INGRES_NET = new ServiceType( 134, "INGRES-NET Service" );
+ public static final ServiceType LOC_SRV = new ServiceType( 135, "Location Service" );
+ public static final ServiceType PROFILE = new ServiceType( 136, "PROFILE Naming System" );
+ public static final ServiceType NETBIOS_NS = new ServiceType( 137, "NETBIOS Name Service" );
+ public static final ServiceType NETBIOS_DGM = new ServiceType( 138, "NETBIOS Datagram Service" );
+ public static final ServiceType NETBIOS_SSN = new ServiceType( 139, "NETBIOS Session Service" );
+ public static final ServiceType EMFIS_DATA = new ServiceType( 140, "EMFIS Data Service" );
+ public static final ServiceType EMFIS_CNTL = new ServiceType( 141, "EMFIS Control Service" );
+ public static final ServiceType BL_IDM = new ServiceType( 142, "Britton-Lee IDM" );
+ public static final ServiceType SUR_MEAS = new ServiceType( 243, "Survey Measurement" );
+ public static final ServiceType LINK = new ServiceType( 245, "LINK" );
+
+ public String toString()
{
- return name;
- }
+ return name;
+ }
- public int compareTo( Object that )
+ public int compareTo( Object that )
{
- return ordinal - ( (ServiceType) that ).ordinal;
- }
+ return ordinal - ( (ServiceType) that ).ordinal;
+ }
- public static ServiceType getTypeByOrdinal( int type )
+ public static ServiceType getTypeByOrdinal( int type )
{
- for ( int ii = 0; ii < values.length; ii++ )
- if ( values[ ii ].ordinal == type )
- return values[ ii ];
- return NULL;
- }
-
- public int getOrdinal()
+ for ( int ii = 0; ii < values.length; ii++ )
+ if ( values[ ii ].ordinal == type ) return values[ ii ];
+ return NULL;
+ }
+
+ public int getOrdinal()
{
- return ordinal;
- }
+ return ordinal;
+ }
- /// PRIVATE /////
- private final String name;
- private final int ordinal;
-
- /**
- * Private constructor prevents construction outside of this class.
- */
- private ServiceType( int ordinal, String name )
+ /// PRIVATE /////
+ private final String name;
+ private final int ordinal;
+
+ /**
+ * Private constructor prevents construction outside of this class.
+ */
+ private ServiceType( int ordinal, String name )
{
this.ordinal = ordinal;
- this.name = name;
- }
+ this.name = name;
+ }
- /**
- * These two lines are all that's necessary to export a List of VALUES.
- */
- private static final ServiceType[] values = { NULL, RJE, ECHO, DISCARD, USERS, DAYTIME,
- QUOTE, CHARGEN, FTP_DATA, FTP, TELNET, SMTP, NSW_FE, MSG_ICP, MSG_AUTH, DSP,
- TIME, RLP, GRAPHICS, NAMESERVER, NICKNAME, MPM_FLAGS, MPM, MPM_SND, NI_FTP,
- LOGIN, LA_MAINT, DOMAIN, ISI_GL,NI_MAIL, VIA_FTP, TACACS_DS, BOOTPS, BOOTPC,
- TFTP, NETRJS_1, NETRJS_2, NETRJS_3, NETRJS_4, FINGER, HOSTS2_NS, SU_MIT_TG,
- MIT_DOV, DCP, SUPDUP, SWIFT_RVF, TACNEWS, METAGRAM, HOSTNAME, ISO_TSAP, X400,
- X400_SND, CSNET_NS, RTELNET, POP_2, SUNRPC, AUTH, SFTP, UUCP_PATH, NNTP, ERPC,
- NTP, LOCUS_MAP, LOCUS_CON, PWDGEN, CISCO_FNA, CISCO_TNA, CISCO_SYS, STATSRV,
- INGRES_NET, LOC_SRV, PROFILE, NETBIOS_NS, NETBIOS_DGM, NETBIOS_SSN, EMFIS_DATA,
- EMFIS_CNTL, BL_IDM, SUR_MEAS, LINK };
- // VALUES needs to be located here, otherwise illegal forward reference
- public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+ /**
+ * These two lines are all that's necessary to export a List of VALUES.
+ */
+ private static final ServiceType[] values = { NULL, RJE, ECHO, DISCARD, USERS, DAYTIME, QUOTE, CHARGEN, FTP_DATA,
+ FTP, TELNET, SMTP, NSW_FE, MSG_ICP, MSG_AUTH, DSP, TIME, RLP, GRAPHICS, NAMESERVER, NICKNAME, MPM_FLAGS,
+ MPM, MPM_SND, NI_FTP, LOGIN, LA_MAINT, DOMAIN, ISI_GL, NI_MAIL, VIA_FTP, TACACS_DS, BOOTPS, BOOTPC, TFTP,
+ NETRJS_1, NETRJS_2, NETRJS_3, NETRJS_4, FINGER, HOSTS2_NS, SU_MIT_TG, MIT_DOV, DCP, SUPDUP, SWIFT_RVF,
+ TACNEWS, METAGRAM, HOSTNAME, ISO_TSAP, X400, X400_SND, CSNET_NS, RTELNET, POP_2, SUNRPC, AUTH, SFTP,
+ UUCP_PATH, NNTP, ERPC, NTP, LOCUS_MAP, LOCUS_CON, PWDGEN, CISCO_FNA, CISCO_TNA, CISCO_SYS, STATSRV,
+ INGRES_NET, LOC_SRV, PROFILE, NETBIOS_NS, NETBIOS_DGM, NETBIOS_SSN, EMFIS_DATA, EMFIS_CNTL, BL_IDM,
+ SUR_MEAS, LINK };
+ // VALUES needs to be located here, otherwise illegal forward reference
+ public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/WellKnownServicesRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/WellKnownServicesRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/WellKnownServicesRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/internet/WellKnownServicesRecord.java Thu Sep 1 00:55:12 2005
@@ -67,29 +67,28 @@
*/
public class WellKnownServicesRecord extends InternetResource
{
- /**
- * Basic ResourceRecord constructor.
- */
- public WellKnownServicesRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.WKS, timeToLive, resourceData );
- }
-
+ /**
+ * Basic ResourceRecord constructor.
+ */
+ public WellKnownServicesRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.WKS, timeToLive, resourceData );
+ }
+
/**
* Static factory method, type-conversion operator.
*/
- public static ResourceRecord valueOf( String domainName, int timeToLive, int protocol, byte[] bitMap )
- {
- byte[] resourceData = new byte[ 1 + bitMap.length ];
-
- resourceData[0] = (byte)( protocol & 0xFF );
-
- for ( int ii = 0; ii < bitMap.length; ii++ )
- {
- resourceData[ ii + 1 ] = bitMap[ ii ];
- }
-
- return new WellKnownServicesRecord( domainName, timeToLive, resourceData );
- }
-}
+ public static ResourceRecord valueOf( String domainName, int timeToLive, int protocol, byte[] bitMap )
+ {
+ byte[] resourceData = new byte[ 1 + bitMap.length ];
+ resourceData[ 0 ] = (byte) ( protocol & 0xFF );
+
+ for ( int ii = 0; ii < bitMap.length; ii++ )
+ {
+ resourceData[ ii + 1 ] = bitMap[ ii ];
+ }
+
+ return new WellKnownServicesRecord( domainName, timeToLive, resourceData );
+ }
+}
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/CanonicalNameRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/CanonicalNameRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/CanonicalNameRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/CanonicalNameRecord.java Thu Sep 1 00:55:12 2005
@@ -40,28 +40,27 @@
*/
public class CanonicalNameRecord extends InternetResource
{
- /**
- * Basic ResourceRecord constructor.
- */
- public CanonicalNameRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.CNAME, timeToLive, resourceData );
- }
-
+ /**
+ * Basic ResourceRecord constructor.
+ */
+ public CanonicalNameRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.CNAME, timeToLive, resourceData );
+ }
+
/**
* Static factory method, type-conversion operator.
*/
- public static ResourceRecord valueOf( String domainName, int timeToLive, String canonicalName )
- {
- return new CanonicalNameRecord( domainName, timeToLive, domainNameToByteArray( canonicalName ) );
- }
-
- /**
- * Lazy accessor.
- */
- public String getCanonicalName()
- {
- return byteArrayToDomainName( resourceData );
- }
-}
+ public static ResourceRecord valueOf( String domainName, int timeToLive, String canonicalName )
+ {
+ return new CanonicalNameRecord( domainName, timeToLive, domainNameToByteArray( canonicalName ) );
+ }
+ /**
+ * Lazy accessor.
+ */
+ public String getCanonicalName()
+ {
+ return byteArrayToDomainName( resourceData );
+ }
+}
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/HostInformationRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/HostInformationRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/HostInformationRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/HostInformationRecord.java Thu Sep 1 00:55:12 2005
@@ -44,9 +44,8 @@
*/
public class HostInformationRecord extends InternetResource
{
- public HostInformationRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.HINFO, timeToLive, resourceData );
- }
+ public HostInformationRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.HINFO, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/MailExchangeRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/MailExchangeRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/MailExchangeRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/MailExchangeRecord.java Thu Sep 1 00:55:12 2005
@@ -46,55 +46,54 @@
*/
public class MailExchangeRecord extends InternetResource
{
- /**
- * Basic ResourceRecord constructor.
- */
- public MailExchangeRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.MX, timeToLive, resourceData );
- }
-
- /**
- * Static factory method, type-conversion operator.
- */
- public static ResourceRecord valueOf( String domainName, int timeToLive, int preference, String exchange )
- {
- byte[] exchangeBytes = exchange.getBytes();
-
- byte[] resourceData = new byte[ 2 + exchangeBytes.length ];
-
- resourceData[0] = (byte)( preference & 0x000000FF );
- resourceData[1] = (byte)( preference & 0x0000FF00 );
-
- for ( int ii = 0; ii < exchangeBytes.length; ii++ )
- {
- resourceData[ ii + 2 ] = exchangeBytes[ ii ];
- }
-
- return new MailExchangeRecord( domainName, timeToLive, resourceData );
- }
-
- /**
- * Lazy accessor for the MX preference.
- */
- public int getPreference()
- {
- return ( resourceData[1] * 256 ) + ( resourceData[0] * 1 );
- }
-
- /**
- * Lazy accessor for the MX domain name.
- */
- public String getMailExchange()
- {
- byte[] exchange = new byte[ resourceData.length - 2 ];
-
- for ( int ii = 0; ii < resourceData.length - 2; ii++ )
- {
- exchange[ ii ] = resourceData[ ii + 2 ];
- }
-
- return new String( exchange );
- }
-}
+ /**
+ * Basic ResourceRecord constructor.
+ */
+ public MailExchangeRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.MX, timeToLive, resourceData );
+ }
+
+ /**
+ * Static factory method, type-conversion operator.
+ */
+ public static ResourceRecord valueOf( String domainName, int timeToLive, int preference, String exchange )
+ {
+ byte[] exchangeBytes = exchange.getBytes();
+
+ byte[] resourceData = new byte[ 2 + exchangeBytes.length ];
+
+ resourceData[ 0 ] = (byte) ( preference & 0x000000FF );
+ resourceData[ 1 ] = (byte) ( preference & 0x0000FF00 );
+
+ for ( int ii = 0; ii < exchangeBytes.length; ii++ )
+ {
+ resourceData[ ii + 2 ] = exchangeBytes[ ii ];
+ }
+ return new MailExchangeRecord( domainName, timeToLive, resourceData );
+ }
+
+ /**
+ * Lazy accessor for the MX preference.
+ */
+ public int getPreference()
+ {
+ return ( resourceData[ 1 ] * 256 ) + ( resourceData[ 0 ] * 1 );
+ }
+
+ /**
+ * Lazy accessor for the MX domain name.
+ */
+ public String getMailExchange()
+ {
+ byte[] exchange = new byte[ resourceData.length - 2 ];
+
+ for ( int ii = 0; ii < resourceData.length - 2; ii++ )
+ {
+ exchange[ ii ] = resourceData[ ii + 2 ];
+ }
+
+ return new String( exchange );
+ }
+}
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/MailInformationRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/MailInformationRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/MailInformationRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/MailInformationRecord.java Thu Sep 1 00:55:12 2005
@@ -52,9 +52,8 @@
*/
public class MailInformationRecord extends InternetResource
{
- public MailInformationRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.MINFO, timeToLive, resourceData );
- }
+ public MailInformationRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.MINFO, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/NameServerRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/NameServerRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/NameServerRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/NameServerRecord.java Thu Sep 1 00:55:12 2005
@@ -47,28 +47,27 @@
*/
public class NameServerRecord extends InternetResource
{
- /**
- * Basic ResourceRecord constructor.
- */
- public NameServerRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.NS, timeToLive, resourceData );
- }
-
+ /**
+ * Basic ResourceRecord constructor.
+ */
+ public NameServerRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.NS, timeToLive, resourceData );
+ }
+
/**
* Static factory method, type-conversion operator.
*/
- public static ResourceRecord valueOf( String domainName, int timeToLive, String nameServer )
- {
- return new NameServerRecord( domainName, timeToLive, domainNameToByteArray( nameServer ) );
- }
-
- /**
- * Lazy accessor.
- */
- public String getNameServer()
- {
- return byteArrayToDomainName( resourceData );
- }
-}
+ public static ResourceRecord valueOf( String domainName, int timeToLive, String nameServer )
+ {
+ return new NameServerRecord( domainName, timeToLive, domainNameToByteArray( nameServer ) );
+ }
+ /**
+ * Lazy accessor.
+ */
+ public String getNameServer()
+ {
+ return byteArrayToDomainName( resourceData );
+ }
+}
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/PointerRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/PointerRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/PointerRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/PointerRecord.java Thu Sep 1 00:55:12 2005
@@ -41,28 +41,27 @@
*/
public class PointerRecord extends InternetResource
{
- /**
- * Basic ResourceRecord constructor.
- */
- public PointerRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.PTR, timeToLive, resourceData );
- }
-
+ /**
+ * Basic ResourceRecord constructor.
+ */
+ public PointerRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.PTR, timeToLive, resourceData );
+ }
+
/**
* Static factory method, type-conversion operator.
*/
- public static ResourceRecord valueOf( String domainName, int timeToLive, String pointer )
- {
- return new PointerRecord( domainName, timeToLive, domainNameToByteArray( pointer ) );
- }
-
- /**
- * Lazy accessor.
- */
- public String getPointer()
- {
- return byteArrayToDomainName( resourceData );
- }
-}
+ public static ResourceRecord valueOf( String domainName, int timeToLive, String pointer )
+ {
+ return new PointerRecord( domainName, timeToLive, domainNameToByteArray( pointer ) );
+ }
+ /**
+ * Lazy accessor.
+ */
+ public String getPointer()
+ {
+ return byteArrayToDomainName( resourceData );
+ }
+}
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/StartOfAuthorityRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/StartOfAuthorityRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/StartOfAuthorityRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/StartOfAuthorityRecord.java Thu Sep 1 00:55:12 2005
@@ -88,9 +88,8 @@
*/
public class StartOfAuthorityRecord extends InternetResource
{
- public StartOfAuthorityRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.SOA, timeToLive, resourceData );
- }
+ public StartOfAuthorityRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.SOA, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/TextRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/TextRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/TextRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/standard/TextRecord.java Thu Sep 1 00:55:12 2005
@@ -37,28 +37,27 @@
*/
public class TextRecord extends InternetResource
{
- /**
- * Basic ResourceRecord constructor.
- */
- public TextRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.TXT, timeToLive, resourceData );
- }
-
- /**
- * Static factory method, type-conversion operator.
- */
- public static ResourceRecord valueOf( String domainName, int timeToLive, String text )
- {
- return new TextRecord( domainName, timeToLive, text.getBytes() );
- }
-
- /**
- * Lazy accessor.
- */
- public String getText()
- {
- return new String( resourceData );
- }
-}
+ /**
+ * Basic ResourceRecord constructor.
+ */
+ public TextRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.TXT, timeToLive, resourceData );
+ }
+
+ /**
+ * Static factory method, type-conversion operator.
+ */
+ public static ResourceRecord valueOf( String domainName, int timeToLive, String text )
+ {
+ return new TextRecord( domainName, timeToLive, text.getBytes() );
+ }
+ /**
+ * Lazy accessor.
+ */
+ public String getText()
+ {
+ return new String( resourceData );
+ }
+}
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/A6Record.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/A6Record.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/A6Record.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/A6Record.java Thu Sep 1 00:55:12 2005
@@ -54,9 +54,8 @@
*/
public class A6Record extends InternetResource
{
- public A6Record( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.A6, timeToLive, resourceData );
- }
+ public A6Record( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.A6, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/CertificateRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/CertificateRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/CertificateRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/CertificateRecord.java Thu Sep 1 00:55:12 2005
@@ -59,9 +59,8 @@
*/
public class CertificateRecord extends InternetResource
{
- public CertificateRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.CERT, timeToLive, resourceData );
- }
+ public CertificateRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.CERT, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/DnameRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/DnameRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/DnameRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/DnameRecord.java Thu Sep 1 00:55:12 2005
@@ -64,9 +64,8 @@
*/
public class DnameRecord extends InternetResource
{
- public DnameRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.DNAME, timeToLive, resourceData );
- }
+ public DnameRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.DNAME, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/Inet6AddressRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/Inet6AddressRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/Inet6AddressRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/Inet6AddressRecord.java Thu Sep 1 00:55:12 2005
@@ -76,9 +76,8 @@
*/
public class Inet6AddressRecord extends InternetResource
{
- public Inet6AddressRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.AAAA, timeToLive, resourceData );
- }
+ public Inet6AddressRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.AAAA, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/KeyExchangeRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/KeyExchangeRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/KeyExchangeRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/KeyExchangeRecord.java Thu Sep 1 00:55:12 2005
@@ -50,9 +50,8 @@
*/
public class KeyExchangeRecord extends InternetResource
{
- public KeyExchangeRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.KX, timeToLive, resourceData );
- }
+ public KeyExchangeRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.KX, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/KeyRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/KeyRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/KeyRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/KeyRecord.java Thu Sep 1 00:55:12 2005
@@ -57,9 +57,8 @@
*/
public class KeyRecord extends InternetResource
{
- public KeyRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.KEY, timeToLive, resourceData );
- }
+ public KeyRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.KEY, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/LocationRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/LocationRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/LocationRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/LocationRecord.java Thu Sep 1 00:55:12 2005
@@ -114,9 +114,8 @@
*/
public class LocationRecord extends InternetResource
{
- public LocationRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.LOC, timeToLive, resourceData );
- }
+ public LocationRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.LOC, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/NameAuthorityPointer.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/NameAuthorityPointer.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/NameAuthorityPointer.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/NameAuthorityPointer.java Thu Sep 1 00:55:12 2005
@@ -131,9 +131,8 @@
*/
public class NameAuthorityPointer extends InternetResource
{
- public NameAuthorityPointer( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.NAPTR, timeToLive, resourceData );
- }
+ public NameAuthorityPointer( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.NAPTR, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/NextNameRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/NextNameRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/NextNameRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/NextNameRecord.java Thu Sep 1 00:55:12 2005
@@ -53,9 +53,8 @@
*/
public class NextNameRecord extends InternetResource
{
- public NextNameRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.NXT, timeToLive, resourceData );
- }
+ public NextNameRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.NXT, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/ServerSelectionRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/ServerSelectionRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/ServerSelectionRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/ServerSelectionRecord.java Thu Sep 1 00:55:12 2005
@@ -121,9 +121,8 @@
*/
public class ServerSelectionRecord extends InternetResource
{
- public ServerSelectionRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.SRV, timeToLive, resourceData );
- }
+ public ServerSelectionRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.SRV, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/SignatureRecord.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/SignatureRecord.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/SignatureRecord.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/records/zone/SignatureRecord.java Thu Sep 1 00:55:12 2005
@@ -175,9 +175,8 @@
*/
public class SignatureRecord extends InternetResource
{
- public SignatureRecord( String domainName, int timeToLive, byte[] resourceData )
- {
- super( domainName, RecordType.SIG, timeToLive, resourceData );
- }
+ public SignatureRecord( String domainName, int timeToLive, byte[] resourceData )
+ {
+ super( domainName, RecordType.SIG, timeToLive, resourceData );
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/service/DomainNameServiceImpl.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/service/DomainNameServiceImpl.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/service/DomainNameServiceImpl.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/service/DomainNameServiceImpl.java Thu Sep 1 00:55:12 2005
@@ -20,12 +20,10 @@
import org.apache.dns.DomainNameService;
import org.apache.dns.messages.DnsMessage;
-
public class DomainNameServiceImpl implements DomainNameService
{
- public DnsMessage getReplyFor( DnsMessage request )
- {
- return request;
- }
+ public DnsMessage getReplyFor( DnsMessage request )
+ {
+ return request;
+ }
}
-
Modified: directory/protocol-providers/dns/trunk/src/java/org/apache/dns/store/DnsRecordStateFactory.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/java/org/apache/dns/store/DnsRecordStateFactory.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/java/org/apache/dns/store/DnsRecordStateFactory.java (original)
+++ directory/protocol-providers/dns/trunk/src/java/org/apache/dns/store/DnsRecordStateFactory.java Thu Sep 1 00:55:12 2005
@@ -35,7 +35,6 @@
import javax.naming.directory.BasicAttribute;
import java.util.Hashtable;
-
/**
* A state factory which produces the state to be stored in an entry of a DNS record
* of any type.
@@ -45,9 +44,10 @@
*/
public class DnsRecordStateFactory implements DirStateFactory
{
- public Result getStateToBind( Object obj, Name name, Context nameCtx, Hashtable environment, Attributes inAttrs ) throws NamingException
+ public Result getStateToBind( Object obj, Name name, Context nameCtx, Hashtable environment, Attributes inAttrs )
+ throws NamingException
{
- ResourceRecord rec = ( ResourceRecord ) obj;
+ ResourceRecord rec = (ResourceRecord) obj;
Attributes outAttrs = new BasicAttributes();
@@ -57,9 +57,9 @@
while ( list.hasMore() )
{
- String id = ( String ) list.next();
+ String id = (String) list.next();
- outAttrs.put( ( Attribute ) inAttrs.get( id ).clone() );
+ outAttrs.put( (Attribute) inAttrs.get( id ).clone() );
}
}
@@ -74,7 +74,7 @@
outAttrs.put( attr );
}
- if ( ! attr.contains( "top" ) )
+ if ( !attr.contains( "top" ) )
{
attr.add( "top" );
}
@@ -84,46 +84,50 @@
if ( outAttrs.get( "apacheDNSTTL" ) == null )
{
// cap this off after the getters are setup on the objects
-// outAttrs.put( "apacheDNSTTL", rec. );
+ // outAttrs.put( "apacheDNSTTL", rec. );
}
if ( rec instanceof AddressRecord )
{
- if ( ! attr.contains( "apacheAddressRecord" ) )
+ if ( !attr.contains( "apacheAddressRecord" ) )
{
attr.add( "apacheAddressRecord" );
}
}
- else if ( rec instanceof PointerRecord )
- {
- if ( ! attr.contains( "apachePointerRecord" ) )
- {
- attr.add( "apachePointerRecord" );
- }
- }
- else if ( rec instanceof NameServerRecord )
- {
- if ( ! attr.contains( "apacheNameServerRecord" ) )
- {
- attr.add( "apacheNameServerRecord" );
- }
- }
- else if ( rec instanceof StartOfAuthorityRecord )
- {
- if ( ! attr.contains( "apacheStartOfAuthorityRecord" ) )
+ else
+ if ( rec instanceof PointerRecord )
{
- attr.add( "apacheStartOfAuthorityRecord" );
+ if ( !attr.contains( "apachePointerRecord" ) )
+ {
+ attr.add( "apachePointerRecord" );
+ }
}
- }
+ else
+ if ( rec instanceof NameServerRecord )
+ {
+ if ( !attr.contains( "apacheNameServerRecord" ) )
+ {
+ attr.add( "apacheNameServerRecord" );
+ }
+ }
+ else
+ if ( rec instanceof StartOfAuthorityRecord )
+ {
+ if ( !attr.contains( "apacheStartOfAuthorityRecord" ) )
+ {
+ attr.add( "apacheStartOfAuthorityRecord" );
+ }
+ }
Result r = new Result( obj, outAttrs );
return r;
}
-
- public Object getStateToBind( Object obj, Name name, Context nameCtx, Hashtable environment ) throws NamingException
+ public Object getStateToBind( Object obj, Name name, Context nameCtx, Hashtable environment )
+ throws NamingException
{
- throw new UnsupportedOperationException( "Structural objectClass needed for safehausProfile within additional attributes!" );
+ throw new UnsupportedOperationException(
+ "Structural objectClass needed for safehausProfile within additional attributes!" );
}
}
Modified: directory/protocol-providers/dns/trunk/src/test/org/apache/dns/AbstractDnsTestCase.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/dns/trunk/src/test/org/apache/dns/AbstractDnsTestCase.java?rev=265668&r1=265667&r2=265668&view=diff
==============================================================================
--- directory/protocol-providers/dns/trunk/src/test/org/apache/dns/AbstractDnsTestCase.java (original)
+++ directory/protocol-providers/dns/trunk/src/test/org/apache/dns/AbstractDnsTestCase.java Thu Sep 1 00:55:12 2005
@@ -27,67 +27,65 @@
import org.apache.dns.records.QuestionRecord;
import org.apache.dns.records.ResourceRecord;
-
public abstract class AbstractDnsTestCase extends TestCase
{
- private static final int MINIMUM_DNS_DATAGRAM_SIZE = 576;
-
- protected void print( DnsMessage message )
- {
- System.out.println( message.getTransactionId() );
- System.out.println( message.getMessageType() );
- System.out.println( message.getOpCode() );
- System.out.println( message.isAuthoritativeAnswer() );
- System.out.println( message.isTruncated() );
- System.out.println( message.isRecursionDesired() );
- System.out.println( message.isRecursionAvailable() );
- System.out.println( message.getResponseCode() );
-
- QuestionRecord[] questions = message.getQuestionRecords();
- printQuestionRecords( questions );
-
- ResourceRecord[] records = message.getAnswerRecords();
- printResourceRecords( records );
-
- records = message.getAuthorityRecords();
- printResourceRecords( records );
-
- records = message.getAdditionalRecords();
- printResourceRecords( records );
- }
-
- protected void printQuestionRecords( QuestionRecord[] records )
- {
- for ( int ii = 0; ii < records.length; ii++ )
- {
- System.out.println( records[ ii ] );
- }
- }
-
- protected void printResourceRecords( ResourceRecord[] records )
- {
- for ( int ii = 0; ii < records.length; ii++ )
- {
- System.out.println( records[ ii ] );
- }
- }
-
+ private static final int MINIMUM_DNS_DATAGRAM_SIZE = 576;
+
+ protected void print( DnsMessage message )
+ {
+ System.out.println( message.getTransactionId() );
+ System.out.println( message.getMessageType() );
+ System.out.println( message.getOpCode() );
+ System.out.println( message.isAuthoritativeAnswer() );
+ System.out.println( message.isTruncated() );
+ System.out.println( message.isRecursionDesired() );
+ System.out.println( message.isRecursionAvailable() );
+ System.out.println( message.getResponseCode() );
+
+ QuestionRecord[] questions = message.getQuestionRecords();
+ printQuestionRecords( questions );
+
+ ResourceRecord[] records = message.getAnswerRecords();
+ printResourceRecords( records );
+
+ records = message.getAuthorityRecords();
+ printResourceRecords( records );
+
+ records = message.getAdditionalRecords();
+ printResourceRecords( records );
+ }
+
+ protected void printQuestionRecords( QuestionRecord[] records )
+ {
+ for ( int ii = 0; ii < records.length; ii++ )
+ {
+ System.out.println( records[ ii ] );
+ }
+ }
+
+ protected void printResourceRecords( ResourceRecord[] records )
+ {
+ for ( int ii = 0; ii < records.length; ii++ )
+ {
+ System.out.println( records[ ii ] );
+ }
+ }
+
protected ByteBuffer getByteBufferFromFile( String file ) throws IOException
- {
+ {
InputStream is = getClass().getResourceAsStream( file );
-
+
byte[] bytes = new byte[ MINIMUM_DNS_DATAGRAM_SIZE ];
-
+
int offset = 0;
int numRead = 0;
- while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0)
+ while ( offset < bytes.length && ( numRead = is.read( bytes, offset, bytes.length - offset ) ) >= 0 )
{
offset += numRead;
}
-
+
is.close();
-
+
return ByteBuffer.wrap( bytes );
}
}
-