Source Code Cross Referenced for SRVRecord.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:         * Server Selection Record  - finds hosts running services in a domain.  An
009:         * SRV record will normally be named <service>.<protocol>.domain - an
010:         * example would be http.tcp.example.com (if HTTP used SRV records)
011:         *
012:         * @author Brian Wellington
013:         */
014:
015:        public class SRVRecord extends Record {
016:
017:            private int priority, weight, port;
018:            private Name target;
019:
020:            SRVRecord() {
021:            }
022:
023:            Record getObject() {
024:                return new SRVRecord();
025:            }
026:
027:            /**
028:             * Creates an SRV Record from the given data
029:             * @param priority The priority of this SRV.  Records with lower priority
030:             * are preferred.
031:             * @param weight The weight, used to select between records at the same
032:             * priority.
033:             * @param port The TCP/UDP port that the service uses
034:             * @param target The host running the service
035:             */
036:            public SRVRecord(Name name, int dclass, long ttl, int priority,
037:                    int weight, int port, Name target) {
038:                super (name, Type.SRV, dclass, ttl);
039:                this .priority = checkU16("priority", priority);
040:                this .weight = checkU16("weight", weight);
041:                this .port = checkU16("port", port);
042:                this .target = checkName("target", target);
043:            }
044:
045:            void rrFromWire(DNSInput in) throws IOException {
046:                priority = in.readU16();
047:                weight = in.readU16();
048:                port = in.readU16();
049:                target = new Name(in);
050:            }
051:
052:            void rdataFromString(Tokenizer st, Name origin) throws IOException {
053:                priority = st.getUInt16();
054:                weight = st.getUInt16();
055:                port = st.getUInt16();
056:                target = st.getName(origin);
057:            }
058:
059:            /** Converts rdata to a String */
060:            String rrToString() {
061:                StringBuffer sb = new StringBuffer();
062:                sb.append(priority + " ");
063:                sb.append(weight + " ");
064:                sb.append(port + " ");
065:                sb.append(target);
066:                return sb.toString();
067:            }
068:
069:            /** Returns the priority */
070:            public int getPriority() {
071:                return priority;
072:            }
073:
074:            /** Returns the weight */
075:            public int getWeight() {
076:                return weight;
077:            }
078:
079:            /** Returns the port that the service runs on */
080:            public int getPort() {
081:                return port;
082:            }
083:
084:            /** Returns the host running that the service */
085:            public Name getTarget() {
086:                return target;
087:            }
088:
089:            void rrToWire(DNSOutput out, Compression c, boolean canonical) {
090:                out.writeU16(priority);
091:                out.writeU16(weight);
092:                out.writeU16(port);
093:                target.toWire(out, null, canonical);
094:            }
095:
096:            public Name getAdditionalName() {
097:                return target;
098:            }
099:
100:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.