Top Description Fields Constructors Methods
com.sun.jndi.dns

public Class DnsUrl

extends Uri
Class Inheritance
Imports
java.net.MalformedURLException, .URI, .URISyntaxException, java.security.AccessController, .PrivilegedAction, java.util.Locale, .StringTokenizer, com.sun.jndi.toolkit.url.Uri, .UrlUtil

A DnsUrl represents a DNS pseudo-URL of the form
  dns://[host][:port][/[domain]]
or
  dns:[/][domain]
The host names a DNS server. If the host is not provided, it indicates that the underlying platform's DNS server(s) should be used if possible, or that "localhost" should be used otherwise. If the port is not provided, the DNS default port 53 will be used. The domain indicates the domain name of the context, and is not necessarily related to the domain of the server; if it is not provided, the root domain "." is used. Special characters in the domain name must be %-escaped as described in RFC 2396.
Author
Scott Seligman

Field Summary

Modifier and TypeField and Description
private static final Uri.ParseMode
private String
public static final Uri.ParseMode
private static final String
Inherited from com.sun.jndi.toolkit.url.Uri:
fragmenthasAuthorityhostpathportqueryschemeuri

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
checkSchemeOnly(String
the URI
uri
,
String
the scheme
scheme
)

Overrides com.sun.jndi.toolkit.url.Uri.checkSchemeOnly.

Checks whether the given uri string should be considered as a scheme-only URI.

public static DnsUrl[]
fromList(String urlList)

Given a space-separated list of DNS URLs, returns an array of DnsUrl objects.

public String
getDomain()

Returns the domain of this URL, or "." if none is provided.

private static boolean
protected final boolean
isSchemeOnly(String
An URI string
uri
)

Overrides com.sun.jndi.toolkit.url.Uri.isSchemeOnly.

A subclass of Uri that supports scheme only URIs can override this method and return true in the case where the URI string is a scheme-only URI that the subclass supports.

protected final MalformedURLException
newInvalidURISchemeException(String
the URI string
uri
)

Overrides com.sun.jndi.toolkit.url.Uri.newInvalidURISchemeException.

Creates a MalformedURLException to be thrown when the URI scheme is not supported.

protected Uri.ParseMode
parseMode()

Overrides com.sun.jndi.toolkit.url.Uri.parseMode.

The parse mode for parsing this URI.

private static String
Inherited from com.sun.jndi.toolkit.url.Uri:
acceptsFragmentgetHostgetPathgetPortgetQuerygetSchemeinittoString

Field Detail

DEFAULT_PARSE_MODEback to summary
private static final Uri.ParseMode DEFAULT_PARSE_MODE
domainback to summary
private String domain
PARSE_MODEback to summary
public static final Uri.ParseMode PARSE_MODE
PARSE_MODE_PROPback to summary
private static final String PARSE_MODE_PROP

Constructor Detail

DnsUrlback to summary
public DnsUrl(String url) throws MalformedURLException

Method Detail

checkSchemeOnlyback to summary
protected boolean checkSchemeOnly(String uri, String scheme)

Overrides com.sun.jndi.toolkit.url.Uri.checkSchemeOnly.

Doc from com.sun.jndi.toolkit.url.Uri.checkSchemeOnly.

Checks whether the given uri string should be considered as a scheme-only URI. For some protocols - e.g. DNS, we might accept "dns://" as a valid URL denoting default DNS. For others - we might only accept "scheme:".

Parameters
uri:String

the URI

scheme:String

the scheme

Returns:boolean

true if the URI should be considered as a scheme-only URI supported by this URI scheme.

Annotations
@Override
fromListback to summary
public static DnsUrl[] fromList(String urlList) throws MalformedURLException

Given a space-separated list of DNS URLs, returns an array of DnsUrl objects.

getDomainback to summary
public String getDomain()

Returns the domain of this URL, or "." if none is provided. Never null.

isDnsSchemeOnlyback to summary
private static boolean isDnsSchemeOnly(String uri)
isSchemeOnlyback to summary
protected final boolean isSchemeOnly(String uri)

Overrides com.sun.jndi.toolkit.url.Uri.isSchemeOnly.

Doc from com.sun.jndi.toolkit.url.Uri.isSchemeOnly.

A subclass of Uri that supports scheme only URIs can override this method and return true in the case where the URI string is a scheme-only URI that the subclass supports.

Parameters
uri:String

An URI string

Returns:boolean

if this is a scheme-only URI supported by the subclass

Annotations
@Override
newInvalidURISchemeExceptionback to summary
protected final MalformedURLException newInvalidURISchemeException(String uri)

Overrides com.sun.jndi.toolkit.url.Uri.newInvalidURISchemeException.

Doc from com.sun.jndi.toolkit.url.Uri.newInvalidURISchemeException.

Creates a MalformedURLException to be thrown when the URI scheme is not supported.

Parameters
uri:String

the URI string

Returns:MalformedURLException

a MalformedURLException

Annotations
@Override
parseModeback to summary
protected Uri.ParseMode parseMode()

Overrides com.sun.jndi.toolkit.url.Uri.parseMode.

Doc from com.sun.jndi.toolkit.url.Uri.parseMode.

The parse mode for parsing this URI. The default is ParseMode#COMPAT.

Returns:Uri.ParseMode

the parse mode for parsing this URI.

Annotations
@Override
validateURIback to summary
private static String validateURI(String uri) throws URISyntaxException