21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.sun.jndi.cosnaming;
27
28 import javax.naming.Name;
29 import javax.naming.NamingException;
30
31 import java.net.MalformedURLException;
32 import java.util.Vector;
33 import java.util.StringTokenizer;
34 import com.sun.jndi.toolkit.url.UrlUtil;
35
36 /**
37 * Extract components of an "iiop" or "iiopname" URL.
38 *
39 * The format of an iiopname URL is defined in INS 98-10-11 as follows:
40 *
41 * iiopname url = "iiopname://" [addr_list]["/" string_name]
42 * addr_list = [address ","]* address
43 * address = [version host [":" port]]
44 * host = DNS style host name | IP address
45 * version = major "." minor "@" | empty_string
46 * port = number
47 * major = number
48 * minor = number
49 * string_name = stringified name | empty_string
50 *
51 * The default port is 9999. The default version is "1.0"
52 * US-ASCII alphanumeric characters are not escaped. Any characters outside
53 * of this range are escaped except for the following:
54 * ; / : ? : @ & = + $ , - _ . ! ~ * ' ( )
55 * Escaped characters is escaped by using a % followed by its 2 hexadecimal
56 * numbers representing the octet.
57 *
58 * For backward compatibility, the "iiop" URL as defined in INS 97-6-6
59 * is also supported:
60 *
61 * iiop url = "iiop://" [host [":" port]] ["/" string_name]
62 * The default port is 900.
63 *
64 * @author Rosanna Lee
65 */
66
67 public final class IiopUrl {
68 static final private int DEFAULT_IIOPNAME_PORT = 9999;
69 static final private int DEFAULT_IIOP_PORT = 900;
70 static final private String DEFAULT_HOST = "localhost";
71 private Vector<Address> addresses;
72 private String stringName;
73
74 public static class Address {
75 public int port = -1;
76 public int major, minor;
77 public String host;
78
79 public Address(String hostPortVers, boolean oldFormat)
80 throws MalformedURLException {
81 // [version host [":" port]]
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.sun.jndi.cosnaming;
27
28 import javax.naming.Name;
29 import javax.naming.NamingException;
30
31 import java.net.MalformedURLException;
32 import java.util.Vector;
33 import java.util.StringTokenizer;
34 import com.sun.jndi.toolkit.url.UrlUtil;
35
36 /**
37 * Extract components of an "iiop" or "iiopname" URL.
38 *
39 * The format of an iiopname URL is defined in INS 98-10-11 as follows:
40 *
41 * <pre>
42 * iiopname url = "iiopname://" [addr_list]["/" string_name]
43 * addr_list = [address ","]* address
44 * address = [version host [":" port]]
45 * host = DNS style host name | IP address
46 * version = major "." minor "@" | empty_string
47 * port = number
48 * major = number
49 * minor = number
50 * string_name = stringified name | empty_string
51 * </pre>
52 *
53 * The default port is 9999. The default version is "1.0"
54 * US-ASCII alphanumeric characters are not escaped. Any characters outside
55 * of this range are escaped except for the following:
56 * <pre>{@code
57 * ; / : ? : @ & = + $ , - _ . ! ~ * ' ( )
58 * }</pre>
59 * Escaped characters is escaped by using a % followed by its 2 hexadecimal
60 * numbers representing the octet.
61 *
62 * For backward compatibility, the "iiop" URL as defined in INS 97-6-6
63 * is also supported:
64 * <pre>{@code
65 * iiop url = "iiop://" [host [":" port]] ["/" string_name]
66 * }</pre>
67 * The default port is 900.
68 *
69 * @author Rosanna Lee
70 */
71
72 public final class IiopUrl {
73 static final private int DEFAULT_IIOPNAME_PORT = 9999;
74 static final private int DEFAULT_IIOP_PORT = 900;
75 static final private String DEFAULT_HOST = "localhost";
76 private Vector<Address> addresses;
77 private String stringName;
78
79 public static class Address {
80 public int port = -1;
81 public int major, minor;
82 public String host;
83
84 public Address(String hostPortVers, boolean oldFormat)
85 throws MalformedURLException {
86 // [version host [":" port]]
|