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

public Class DnsContext

Additional top-level classes in compilation unit: CT, BaseNameClassPairEnumeration, NameClassPairEnumeration, BindingEnumeration.

extends ComponentDirContext
Class Inheritance
Imports
java.util.Enumeration, .Hashtable, javax.naming.*, javax.naming.directory.*, javax.naming.spi.DirectoryManager, com.sun.jndi.toolkit.ctx.*

A DnsContext is a directory context representing a DNS node.
Author
Scott Seligman

Field Summary

Modifier and TypeField and Description
private static final int
private boolean
private static final boolean
private static final int
private static final int
pack-priv DnsName
pack-priv Hashtable<Object, Object>
private boolean
private static final String
private static final String
private CT
pack-priv static final NameParser
private boolean
private boolean
private static final String
private Resolver
private int
private static final String
private String[]
private int
private static final ZoneNode

Constructor Summary

AccessConstructor and Description
public
DnsContext(String domain, String[] servers, Hashtable<?, ?> environment)

Returns a DNS context for a given domain and servers.

pack-priv
private

Method Summary

Modifier and TypeMethod and Description
public Object
addToEnvironment(String
the name of the environment property to add; may not be null
propName
,
Object
the value of the property to add; may not be null
propVal
)

Implements javax.naming.Context.addToEnvironment.

Adds a new environment property to the environment of this context.

private static CT[]
public void
public void
public Context
public DirContext
public void
public Attributes
public NameParser
public DirContext
public DirContext
public NamingEnumeration<NameClassPair>
public NamingEnumeration<Binding>
public Object
public void
public void
public void
public void
public void
public NamingEnumeration<SearchResult>
c_search(Name name, Attributes matchingAttributes, String[] attributesToReturn, Continuation cont)

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_search.

public NamingEnumeration<SearchResult>
public NamingEnumeration<SearchResult>
c_search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons, Continuation cont)

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_search.

public void
private static boolean
classAndTypeMatch(int rrclass, int rrtype, CT[] cts)

public void
close()

Implements javax.naming.Context.close.

Closes this context.

public Name
composeName(Name
a name relative to this context
name
,
Name
the name of this context relative to one of its ancestors
prefix
)

Overrides com.sun.jndi.toolkit.ctx.PartialCompositeContext.composeName.

Implements javax.naming.Context.composeName.

Composes the name of this context with a name relative to this context.

private static final void
private static CT
pack-priv DnsName
private static CT
public Hashtable<?, ?>
getEnvironment()

Implements javax.naming.Context.getEnvironment.

Retrieves the environment in effect for this context.

private CT
public String
getNameInNamespace()

Implements javax.naming.Context.getNameInNamespace.

Retrieves the full name of this context within its own namespace.

private NameNode
private synchronized Resolver
private void
private boolean
protected Hashtable<?, ?>
p_getEnvironment()

Overrides com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_getEnvironment.

A cheap way of getting the environment.

private NameNode
public Object
removeFromEnvironment(String
the name of the environment property to remove; may not be null
propName
)

Implements javax.naming.Context.removeFromEnvironment.

Removes an environment property from the environment of this context.

private static Attributes
pack-priv void
private static String
toAttrId(int rrclass, int rrtype)

Inherited from com.sun.jndi.toolkit.ctx.ComponentDirContext:
c_bind_nnsc_createSubcontext_nnsc_getAttributes_nnsc_getSchema_nnsc_getSchemaClassDefinition_nnsc_modifyAttributes_nnsc_modifyAttributes_nnsc_rebind_nnsc_search_nnsc_search_nnsc_search_nnsp_bindp_createSubcontextp_getAttributesp_getSchemap_getSchemaClassDefinitionp_modifyAttributesp_modifyAttributesp_rebindp_searchp_searchp_search

Field Detail

ANYback to summary
private static final int ANY
authoritativeback to summary
private boolean authoritative
debugback to summary
private static final boolean debug

Hides com.sun.jndi.toolkit.ctx.AtomicContext.debug.

DEFAULT_INIT_TIMEOUTback to summary
private static final int DEFAULT_INIT_TIMEOUT
DEFAULT_RETRIESback to summary
private static final int DEFAULT_RETRIES
domainback to summary
pack-priv DnsName domain
environmentback to summary
pack-priv Hashtable<Object, Object> environment
envSharedback to summary
private boolean envShared
INIT_TIMEOUTback to summary
private static final String INIT_TIMEOUT
LOOKUP_ATTRback to summary
private static final String LOOKUP_ATTR
lookupCTback to summary
private CT lookupCT
nameParserback to summary
pack-priv static final NameParser nameParser
parentIsDnsback to summary
private boolean parentIsDns
recursionback to summary
private boolean recursion
RECURSIONback to summary
private static final String RECURSION
resolverback to summary
private Resolver resolver
retriesback to summary
private int retries
RETRIESback to summary
private static final String RETRIES
serversback to summary
private String[] servers
timeoutback to summary
private int timeout
zoneTreeback to summary
private static final ZoneNode zoneTree

Constructor Detail

DnsContextback to summary
public DnsContext(String domain, String[] servers, Hashtable<?, ?> environment) throws NamingException

Returns a DNS context for a given domain and servers. Each server is of the form "server[:port]". IPv6 literal host names include delimiting brackets. There must be at least one server. The environment must not be null; it is cloned before being stored.

Annotations
@SuppressWarnings:unchecked
DnsContextback to summary
pack-priv DnsContext(DnsContext ctx, DnsName domain)
DnsContextback to summary
private DnsContext(DnsContext ctx)

Method Detail

addToEnvironmentback to summary
public Object addToEnvironment(String propName, Object propVal) throws NamingException

Implements javax.naming.Context.addToEnvironment.

Doc from javax.naming.Context.addToEnvironment.

Adds a new environment property to the environment of this context. If the property already exists, its value is overwritten. See class description for more details on environment properties.

Parameters
propName:String

the name of the environment property to add; may not be null

propVal:Object

the value of the property to add; may not be null

Returns:Object

the previous value of the property, or null if the property was not in the environment before

Annotations
@SuppressWarnings:unchecked
Exceptions
NamingException:
if a naming exception is encountered
attrIdsToClassesAndTypesback to summary
private static CT[] attrIdsToClassesAndTypes(String[] attrIds) throws InvalidAttributeIdentifierException
c_bindback to summary
public void c_bind(Name name, Object obj, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_bind.

c_bindback to summary
public void c_bind(Name name, Object obj, Attributes attrs, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_bind.

c_createSubcontextback to summary
public Context c_createSubcontext(Name name, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_createSubcontext.

c_createSubcontextback to summary
public DirContext c_createSubcontext(Name name, Attributes attrs, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_createSubcontext.

c_destroySubcontextback to summary
public void c_destroySubcontext(Name name, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_destroySubcontext.

c_getAttributesback to summary
public Attributes c_getAttributes(Name name, String[] attrIds, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_getAttributes.

c_getNameParserback to summary
public NameParser c_getNameParser(Name name, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_getNameParser.

c_getSchemaback to summary
public DirContext c_getSchema(Name name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_getSchema.

c_getSchemaClassDefinitionback to summary
public DirContext c_getSchemaClassDefinition(Name name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_getSchemaClassDefinition.

c_listback to summary
public NamingEnumeration<NameClassPair> c_list(Name name, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_list.

c_listBindingsback to summary
public NamingEnumeration<Binding> c_listBindings(Name name, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_listBindings.

c_lookupback to summary
public Object c_lookup(Name name, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_lookup.

c_modifyAttributesback to summary
public void c_modifyAttributes(Name name, int mod_op, Attributes attrs, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_modifyAttributes.

c_modifyAttributesback to summary
public void c_modifyAttributes(Name name, ModificationItem[] mods, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_modifyAttributes.

c_rebindback to summary
public void c_rebind(Name name, Object obj, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_rebind.

c_rebindback to summary
public void c_rebind(Name name, Object obj, Attributes attrs, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_rebind.

c_renameback to summary
public void c_rename(Name oldname, Name newname, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_rename.

c_searchback to summary
public NamingEnumeration<SearchResult> c_search(Name name, Attributes matchingAttributes, String[] attributesToReturn, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_search.

c_searchback to summary
public NamingEnumeration<SearchResult> c_search(Name name, String filter, SearchControls cons, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_search.

c_searchback to summary
public NamingEnumeration<SearchResult> c_search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.ComponentDirContext.c_search.

c_unbindback to summary
public void c_unbind(Name name, Continuation cont) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.AtomicContext.c_unbind.

classAndTypeMatchback to summary
private static boolean classAndTypeMatch(int rrclass, int rrtype, CT[] cts)
closeback to summary
public void close()

Implements javax.naming.Context.close.

Doc from javax.naming.Context.close.

Closes this context. This method releases this context's resources immediately, instead of waiting for them to be released automatically by the garbage collector.

This method is idempotent: invoking it on a context that has already been closed has no effect. Invoking any other method on a closed context is not allowed, and results in undefined behaviour.

composeNameback to summary
public Name composeName(Name name, Name prefix) throws NamingException

Overrides com.sun.jndi.toolkit.ctx.PartialCompositeContext.composeName.

Implements javax.naming.Context.composeName.

Doc from javax.naming.Context.composeName.

Composes the name of this context with a name relative to this context. Given a name (name) relative to this context, and the name (prefix) of this context relative to one of its ancestors, this method returns the composition of the two names using the syntax appropriate for the naming system(s) involved. That is, if name names an object relative to this context, the result is the name of the same object, but relative to the ancestor context. None of the names may be null.

For example, if this context is named "wiz.com" relative to the initial context, then

 composeName("east", "wiz.com")  
might return "east.wiz.com". If instead this context is named "org/research", then
 composeName("user/jane", "org/research")        
might return "org/research/user/jane" while
 composeName("user/jane", "research")    
returns "research/user/jane".
Parameters
name:Name

a name relative to this context

prefix:Name

the name of this context relative to one of its ancestors

Returns:Name

the composition of prefix and name

Exceptions
NamingException:
if a naming exception is encountered
dprintback to summary
private static final void dprint(String msg)
fromAttrIdback to summary
private static CT fromAttrId(String attrId) throws InvalidAttributeIdentifierException
fullyQualifyback to summary
pack-priv DnsName fullyQualify(Name name) throws NamingException
getClassAndTypeToQueryback to summary
private static CT getClassAndTypeToQuery(CT[] cts)
getEnvironmentback to summary
public Hashtable<?, ?> getEnvironment() throws NamingException

Implements javax.naming.Context.getEnvironment.

Doc from javax.naming.Context.getEnvironment.

Retrieves the environment in effect for this context. See class description for more details on environment properties.

The caller should not make any changes to the object returned: their effect on the context is undefined. The environment of this context may be changed using addToEnvironment() and removeFromEnvironment().

Returns:Hashtable<?, ?>

the environment of this context; never null

Exceptions
NamingException:
if a naming exception is encountered
getLookupCTback to summary
private CT getLookupCT(String attrId) throws InvalidAttributeIdentifierException
getNameInNamespaceback to summary
public String getNameInNamespace()

Implements javax.naming.Context.getNameInNamespace.

Doc from javax.naming.Context.getNameInNamespace.

Retrieves the full name of this context within its own namespace.

Many naming services have a notion of a "full name" for objects in their respective namespaces. For example, an LDAP entry has a distinguished name, and a DNS record has a fully qualified name. This method allows the client application to retrieve this name. The string returned by this method is not a JNDI composite name and should not be passed directly to context methods. In naming systems for which the notion of full name does not make sense, OperationNotSupportedException is thrown.

Returns:String

this context's name in its own namespace; never null

getNameNodeback to summary
private NameNode getNameNode(DnsName fqdn) throws NamingException
getResolverback to summary
private synchronized Resolver getResolver() throws NamingException
initFromEnvironmentback to summary
private void initFromEnvironment() throws InvalidAttributeIdentifierException
isZoneCurrentback to summary
private boolean isZoneCurrent(ZoneNode znode, DnsName zone) throws NamingException
p_getEnvironmentback to summary
protected Hashtable<?, ?> p_getEnvironment()

Overrides com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_getEnvironment.

Doc from com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_getEnvironment.

A cheap way of getting the environment. Default implementation is NOT cheap because it simply calls getEnvironment(), which most implementations clone before returning. Subclass should ALWAYS override this with the cheapest possible way. The toolkit knows to clone when necessary.

Returns:Hashtable<?, ?>

The possibly null environment of the context.

populateZoneback to summary
private NameNode populateZone(ZoneNode znode, DnsName zone) throws NamingException
removeFromEnvironmentback to summary
public Object removeFromEnvironment(String propName) throws NamingException

Implements javax.naming.Context.removeFromEnvironment.

Doc from javax.naming.Context.removeFromEnvironment.

Removes an environment property from the environment of this context. See class description for more details on environment properties.

Parameters
propName:String

the name of the environment property to remove; may not be null

Returns:Object

the previous value of the property, or null if the property was not in the environment

Annotations
@SuppressWarnings:unchecked
Exceptions
NamingException:
if a naming exception is encountered
rrsToAttrsback to summary
private static Attributes rrsToAttrs(ResourceRecords rrs, CT[] cts)
setProviderUrlback to summary
pack-priv void setProviderUrl(String url)
toAttrIdback to summary
private static String toAttrId(int rrclass, int rrtype)