Java Doc for DnsName.java in  » 6.0-JDK-Modules-com.sun » jndi » com » sun » jndi » 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 » 6.0 JDK Modules com.sun » jndi » com.sun.jndi.dns 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.jndi.dns.DnsName

DnsName
final public class DnsName implements Name(Code)
DnsName implements compound names for DNS as specified by RFCs 1034 and 1035, and as updated and clarified by RFCs 1123 and 2181.

The labels in a domain name correspond to JNDI atomic names. Each label must be less than 64 octets in length, and only the optional root label at the end of the name may be 0 octets long. The sum of the lengths of all labels in a name, plus the number of non-root labels plus 1, must be less than 256. The textual representation of a domain name consists of the labels, escaped as needed, dot-separated, and ordered right-to-left.

A label consists of a sequence of octets, each of which may have any value from 0 to 255.

Host names are a subset of domain names. Their labels contain only ASCII letters, digits, and hyphens, and none may begin or end with a hyphen. While names not conforming to these rules may be valid domain names, they will not be usable by a number of DNS applications, and should in most cases be avoided.

DNS does not specify an encoding (such as UTF-8) to use for octets with non-ASCII values. As of this writing there is some work going on in this area, but it is not yet finalized. DnsName currently converts any non-ASCII octets into characters using ISO-LATIN-1 encoding, in effect taking the value of each octet and storing it directly into the low-order byte of a Java character and vice versa. As a consequence, no character in a DNS name will ever have a non-zero high-order byte. When the work on internationalizing domain names has stabilized (see for example draft-ietf-idn-idna-10.txt), DnsName may be updated to conform to that work.

Backslash (\) is used as the escape character in the textual representation of a domain name. The character sequence `\DDD', where DDD is a 3-digit decimal number (with leading zeros if needed), represents the octet whose value is DDD. The character sequence `\C', where C is a character other than '0' through '9', represents the octet whose value is that of C (again using ISO-LATIN-1 encoding); this is particularly useful for escaping '.' or backslash itself. Backslash is otherwise not allowed in a domain name. Note that escape characters are interpreted when a name is parsed. So, for example, the character sequences `S', `\S', and `\083' each represent the same one-octet name. The toString() method does not generally insert escape sequences except where necessary. If, however, the DnsName was constructed using unneeded escapes, those escapes may appear in the toString result.

Atomic names passed as parameters to methods of DnsName, and those returned by them, are unescaped. So, for example, (new DnsName()).add("a.b") creates an object representing the one-label domain name a\.b, and calling get(0) on this object returns "a.b".

While DNS names are case-preserving, comparisons between them are case-insensitive. When comparing names containing non-ASCII octets, DnsName uses case-insensitive comparison between pairs of ASCII values, and exact binary comparison otherwise.

A DnsName instance is not synchronized against concurrent access by multiple threads.
author:
   Scott Seligman
version:
   1.15 07/05/05




Constructor Summary
public  DnsName()
     Constructs a DnsName representing the empty domain name.
public  DnsName(String name)
     Constructs a DnsName representing a given domain name.

Method Summary
public  Nameadd(String comp)
    
public  Nameadd(int pos, String comp)
    
public  NameaddAll(Name suffix)
    
public  NameaddAll(int pos, Name n)
    
public  Objectclone()
    
public  intcompareTo(Object obj)
    
public  booleanendsWith(Name n)
    
public  booleanequals(Object obj)
    
public  Stringget(int pos)
    
public  EnumerationgetAll()
    
 StringgetKey(int i)
    
public  shortgetOctets()
    
public  NamegetPrefix(int pos)
    
public  NamegetSuffix(int pos)
    
 booleanhasRootLabel()
    
public  inthashCode()
    
public  booleanisEmpty()
    
public  booleanisHostName()
    
public  Objectremove(int pos)
    
public  intsize()
    
public  booleanstartsWith(Name n)
    
public  StringtoString()
    


Constructor Detail
DnsName
public DnsName()(Code)
Constructs a DnsName representing the empty domain name.



DnsName
public DnsName(String name) throws InvalidNameException(Code)
Constructs a DnsName representing a given domain name.
Parameters:
  name - the domain name to parse
throws:
  InvalidNameException - if name does not conformto DNS syntax.




Method Detail
add
public Name add(String comp) throws InvalidNameException(Code)



add
public Name add(int pos, String comp) throws InvalidNameException(Code)



addAll
public Name addAll(Name suffix) throws InvalidNameException(Code)



addAll
public Name addAll(int pos, Name n) throws InvalidNameException(Code)



clone
public Object clone()(Code)



compareTo
public int compareTo(Object obj)(Code)



endsWith
public boolean endsWith(Name n)(Code)



equals
public boolean equals(Object obj)(Code)



get
public String get(int pos)(Code)



getAll
public Enumeration getAll()(Code)



getKey
String getKey(int i)(Code)



getOctets
public short getOctets()(Code)



getPrefix
public Name getPrefix(int pos)(Code)



getSuffix
public Name getSuffix(int pos)(Code)



hasRootLabel
boolean hasRootLabel()(Code)



hashCode
public int hashCode()(Code)



isEmpty
public boolean isEmpty()(Code)



isHostName
public boolean isHostName()(Code)
Does this domain name follow host name syntax?



remove
public Object remove(int pos)(Code)



size
public int size()(Code)



startsWith
public boolean startsWith(Name n)(Code)



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.