Source Code Cross Referenced for SOARecord.java in  » Net » dnsjava » org » xbill » 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 » Net » dnsjava » org.xbill.DNS 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)
002:
003:        package org.xbill.DNS;
004:
005:        import java.io.*;
006:
007:        /**
008:         * Start of Authority - describes properties of a zone.
009:         *
010:         * @author Brian Wellington
011:         */
012:
013:        public class SOARecord extends Record {
014:
015:            private Name host, admin;
016:            private long serial, refresh, retry, expire, minimum;
017:
018:            SOARecord() {
019:            }
020:
021:            Record getObject() {
022:                return new SOARecord();
023:            }
024:
025:            /**
026:             * Creates an SOA Record from the given data
027:             * @param host The primary name server for the zone
028:             * @param admin The zone administrator's address
029:             * @param serial The zone's serial number
030:             * @param refresh The amount of time until a secondary checks for a new serial
031:             * number
032:             * @param retry The amount of time between a secondary's checks for a new
033:             * serial number
034:             * @param expire The amount of time until a secondary expires a zone
035:             * @param minimum The minimum TTL for records in the zone
036:             */
037:            public SOARecord(Name name, int dclass, long ttl, Name host,
038:                    Name admin, long serial, long refresh, long retry,
039:                    long expire, long minimum) {
040:                super (name, Type.SOA, dclass, ttl);
041:                this .host = checkName("host", host);
042:                this .admin = checkName("admin", admin);
043:                this .serial = checkU32("serial", serial);
044:                this .refresh = checkU32("refresh", refresh);
045:                this .retry = checkU32("retry", retry);
046:                this .expire = checkU32("expire", expire);
047:                this .minimum = checkU32("minimum", minimum);
048:            }
049:
050:            void rrFromWire(DNSInput in) throws IOException {
051:                host = new Name(in);
052:                admin = new Name(in);
053:                serial = in.readU32();
054:                refresh = in.readU32();
055:                retry = in.readU32();
056:                expire = in.readU32();
057:                minimum = in.readU32();
058:            }
059:
060:            void rdataFromString(Tokenizer st, Name origin) throws IOException {
061:                host = st.getName(origin);
062:                admin = st.getName(origin);
063:                serial = st.getUInt32();
064:                refresh = st.getTTLLike();
065:                retry = st.getTTLLike();
066:                expire = st.getTTLLike();
067:                minimum = st.getTTLLike();
068:            }
069:
070:            /** Convert to a String */
071:            String rrToString() {
072:                StringBuffer sb = new StringBuffer();
073:                sb.append(host);
074:                sb.append(" ");
075:                sb.append(admin);
076:                if (Options.check("multiline")) {
077:                    sb.append(" (\n\t\t\t\t\t");
078:                    sb.append(serial);
079:                    sb.append("\t; serial\n\t\t\t\t\t");
080:                    sb.append(refresh);
081:                    sb.append("\t; refresh\n\t\t\t\t\t");
082:                    sb.append(retry);
083:                    sb.append("\t; retry\n\t\t\t\t\t");
084:                    sb.append(expire);
085:                    sb.append("\t; expire\n\t\t\t\t\t");
086:                    sb.append(minimum);
087:                    sb.append(" )\t; minimum");
088:                } else {
089:                    sb.append(" ");
090:                    sb.append(serial);
091:                    sb.append(" ");
092:                    sb.append(refresh);
093:                    sb.append(" ");
094:                    sb.append(retry);
095:                    sb.append(" ");
096:                    sb.append(expire);
097:                    sb.append(" ");
098:                    sb.append(minimum);
099:                }
100:                return sb.toString();
101:            }
102:
103:            /** Returns the primary name server */
104:            public Name getHost() {
105:                return host;
106:            }
107:
108:            /** Returns the zone administrator's address */
109:            public Name getAdmin() {
110:                return admin;
111:            }
112:
113:            /** Returns the zone's serial number */
114:            public long getSerial() {
115:                return serial;
116:            }
117:
118:            /** Returns the zone refresh interval */
119:            public long getRefresh() {
120:                return refresh;
121:            }
122:
123:            /** Returns the zone retry interval */
124:            public long getRetry() {
125:                return retry;
126:            }
127:
128:            /** Returns the time until a secondary expires a zone */
129:            public long getExpire() {
130:                return expire;
131:            }
132:
133:            /** Returns the minimum TTL for records in the zone */
134:            public long getMinimum() {
135:                return minimum;
136:            }
137:
138:            void rrToWire(DNSOutput out, Compression c, boolean canonical) {
139:                host.toWire(out, c, canonical);
140:                admin.toWire(out, c, canonical);
141:                out.writeU32(serial);
142:                out.writeU32(refresh);
143:                out.writeU32(retry);
144:                out.writeU32(expire);
145:                out.writeU32(minimum);
146:            }
147:
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.