Source Code Cross Referenced for ProviderConstants.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » jndi » provider » dns » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » org package » org.apache.harmony.jndi.provider.dns 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         */
018:
019:        /**
020:         * @author Alexei Y. Zakharov
021:         * @version $Revision: 1.1.2.4 $
022:         */package org.apache.harmony.jndi.provider.dns;
023:
024:        import javax.naming.InvalidNameException;
025:
026:        /**
027:         * Contains various constants that are used in the provider classes.
028:         *
029:         * @see RFC 1035
030:         */
031:        public class ProviderConstants {
032:
033:            // Constants that should be used as possible values for the header QR field 
034:            public static final boolean QR_QUERY = false;
035:            public static final boolean QR_RESPONSE = true;
036:
037:            // Message header masks
038:            public static final int QR_MASK = 0x8000;
039:            public static final int OPCODE_MASK = 0x7800;
040:            public static final int AA_MASK = 0x400;
041:            public static final int TC_MASK = 0x200;
042:            public static final int RD_MASK = 0x100;
043:            public static final int RA_MASK = 0x80;
044:            public static final int Z_MASK = 0x70;
045:            public static final int RCODE_MASK = 0xf;
046:
047:            // Message header fields shifts
048:            public static final int OPCODE_SHIFT = 11;
049:            public static final int RCODE_SHIFT = 0;
050:
051:            // Constants that can be used as OPCODEs in the header
052:            public static final int QUERY = 0;
053:            public static final int IQUERY = 1;
054:            public static final int STATUS = 2;
055:
056:            // Constants that can be used as RCODEs in the header
057:            public static final int NO_ERROR = 0;
058:            public static final int FORMAT_ERROR = 1;
059:            public static final int SERVER_FAILURE = 2;
060:            public static final int NAME_ERROR = 3;
061:            public static final int NOT_IMPLEMENTED = 4;
062:            public static final int REFUSED = 5;
063:
064:            // Possible TYPE values
065:            public static final int A_TYPE = 1;
066:            public static final int NS_TYPE = 2;
067:            public static final int MD_TYPE = 3;
068:            public static final int MF_TYPE = 4;
069:            public static final int CNAME_TYPE = 5;
070:            public static final int SOA_TYPE = 6;
071:            public static final int MB_TYPE = 7;
072:            public static final int MG_TYPE = 8;
073:            public static final int MR_TYPE = 9;
074:            public static final int NULL_TYPE = 10;
075:            public static final int WKS_TYPE = 11;
076:            public static final int PTR_TYPE = 12;
077:            public static final int HINFO_TYPE = 13;
078:            public static final int MINFO_TYPE = 14;
079:            public static final int MX_TYPE = 15;
080:            public static final int TXT_TYPE = 16;
081:            public static final int AAAA_TYPE = 28;
082:            public static final int SRV_TYPE = 33;
083:
084:            // Possible QTYPE values
085:            public static final int AXFR_QTYPE = 252;
086:            public static final int MAILB_QTYPE = 253;
087:            public static final int MAILA_QTYPE = 254;
088:            public static final int ANY_QTYPE = 255;
089:
090:            public static String[] rrTypeNames;
091:            public static String[] rrClassNames;
092:
093:            // Possible CLASS values
094:            public static final int IN_CLASS = 1;
095:            public static final int CS_CLASS = 2;
096:            public static final int CH_CLASS = 3;
097:            public static final int HS_CLASS = 4;
098:
099:            // Possible QCLASS values
100:            public static final int ANY_QCLASS = 255;
101:
102:            // Maximum lengths
103:            public static final int LABEL_MAX_CHARS = 63;
104:            public static final int NAME_MAX_CHARS = 255;
105:
106:            // default DNS port
107:            public static final int DEFAULT_DNS_PORT = 53;
108:
109:            // Resolver settings
110:            public static final int DEFAULT_INITIAL_TIMEOUT = 1000;
111:            public static final int DEFAULT_TIMEOUT_RETRIES = 4;
112:            public static final boolean DEFAULT_AUTHORITATIVE = false;
113:            public static final boolean DEFAULT_RECURSION = true;
114:            public static final int DEFAULT_LOOKUP_ATTR_TYPE = TXT_TYPE;
115:            public static final int DEFAULT_LOOKUP_ATTR_CLASS = IN_CLASS;
116:            public static final int DEFAULT_MAX_THREADS = 7;
117:
118:            public static DNSName ROOT_ZONE_NAME_OBJ = null;
119:
120:            // public static final String LOGGER_NAME =
121:            //        "org.apache.harmony.jndi.provider.dns";
122:
123:            static {
124:                // Resource Record types
125:                // commented out types are not supported
126:                rrTypeNames = new String[256];
127:                for (int i = 0; i < 256; i++) {
128:                    rrTypeNames[i] = String.valueOf(i);
129:                }
130:                rrTypeNames[A_TYPE] = "A"; //$NON-NLS-1$
131:                rrTypeNames[NS_TYPE] = "NS"; //$NON-NLS-1$
132:                //rrTypeNames[MD_TYPE] = "MD";
133:                //rrTypeNames[MF_TYPE] = "MF";
134:                rrTypeNames[CNAME_TYPE] = "CNAME"; //$NON-NLS-1$
135:                rrTypeNames[SOA_TYPE] = "SOA"; //$NON-NLS-1$
136:                //rrTypeNames[MB_TYPE] = "MB";
137:                //rrTypeNames[MG_TYPE] = "MG";
138:                //rrTypeNames[MR_TYPE] = "MR";
139:                //rrTypeNames[NULL_TYPE] = "NULL";
140:                //rrTypeNames[WKS_TYPE] = "WKS";
141:                rrTypeNames[PTR_TYPE] = "PTR"; //$NON-NLS-1$
142:                rrTypeNames[HINFO_TYPE] = "HINFO"; //$NON-NLS-1$
143:                //rrTypeNames[MINFO_TYPE] = "MINFO";
144:                rrTypeNames[MX_TYPE] = "MX"; //$NON-NLS-1$
145:                rrTypeNames[TXT_TYPE] = "TXT"; //$NON-NLS-1$
146:                rrTypeNames[AAAA_TYPE] = "AAAA"; //$NON-NLS-1$
147:                rrTypeNames[SRV_TYPE] = "SRV"; //$NON-NLS-1$
148:                //rrTypeNames[AXFR_QTYPE] = "AXFR";
149:                //rrTypeNames[MAILB_QTYPE] = "MAILB";
150:                //rrTypeNames[MAILA_QTYPE] = "MAILA";
151:                rrTypeNames[ANY_QTYPE] = "*"; //$NON-NLS-1$
152:
153:                // Resource Record classes
154:                rrClassNames = new String[256];
155:                for (int i = 0; i < 256; i++) {
156:                    rrClassNames[i] = String.valueOf(i);
157:                }
158:                rrClassNames[IN_CLASS] = "IN"; //$NON-NLS-1$
159:                rrClassNames[HS_CLASS] = "HS"; //$NON-NLS-1$
160:                rrClassNames[ANY_QCLASS] = "*"; //$NON-NLS-1$
161:
162:                // Root zone name
163:                try {
164:                    ROOT_ZONE_NAME_OBJ = (DNSName) ((new DNSNameParser())
165:                            .parse(".")); //$NON-NLS-1$
166:                } catch (InvalidNameException e) {
167:                    // ignore
168:                }
169:            }
170:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.