public class AliasDirContext extends BaseDirContext
Modifier and Type | Field and Description |
---|---|
protected Map<String,DirContext> |
aliases |
cached, cacheMaxSize, cacheObjectMaxSize, cacheTTL, docBase, env, nameParser
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
Constructor and Description |
---|
AliasDirContext() |
AliasDirContext(Hashtable env) |
Modifier and Type | Method and Description |
---|---|
void |
addAlias(String path,
BaseDirContext dirContext)
Add an alias.
|
void |
bind(String name,
Object obj,
Attributes attrs)
Binds a name to an object, along with associated attributes.
|
DirContext |
createSubcontext(String name,
Attributes attrs)
Creates and binds a new context, along with associated attributes.
|
void |
destroySubcontext(String name)
Destroys the named context and removes it from the namespace.
|
String |
getAliases()
Get the current alias configuration in String form.
|
Attributes |
getAttributes(Name name,
String[] attrIds)
Retrieves selected attributes associated with a named object.
|
Attributes |
getAttributes(String name,
String[] attrIds)
Retrieves selected attributes associated with a named object.
|
String |
getNameInNamespace()
Retrieves the full name of this context within its own namespace.
|
DirContext |
getSchema(String name)
Retrieves the schema associated with the named object.
|
DirContext |
getSchemaClassDefinition(String name)
Retrieves a context containing the schema objects of the named
object's class definitions.
|
NamingEnumeration |
list(Name name)
Enumerates the names bound in the named context, along with the class
names of objects bound to them.
|
NamingEnumeration |
list(String name)
Enumerates the names bound in the named context, along with the class
names of objects bound to them.
|
NamingEnumeration |
listBindings(Name name)
Enumerates the names bound in the named context, along with the
objects bound to them.
|
NamingEnumeration |
listBindings(String name)
Enumerates the names bound in the named context, along with the
objects bound to them.
|
Object |
lookup(Name name)
Retrieves the named object.
|
Object |
lookup(String name)
Retrieves the named object.
|
Object |
lookupLink(String name)
Retrieves the named object, following links except for the terminal
atomic component of the name.
|
void |
modifyAttributes(String name,
int mod_op,
Attributes attrs)
Modifies the attributes associated with a named object.
|
void |
modifyAttributes(String name,
ModificationItem[] mods)
Modifies the attributes associated with a named object using an an
ordered list of modifications.
|
void |
rebind(String name,
Object obj,
Attributes attrs)
Binds a name to an object, along with associated attributes,
overwriting any existing binding.
|
void |
release()
Release any resources allocated for this directory context.
|
void |
removeAlias(String path)
Remove an alias.
|
void |
rename(String oldName,
String newName)
Binds a new name to the object bound to an old name, and unbinds the
old name.
|
NamingEnumeration |
search(String name,
Attributes matchingAttributes)
Searches in a single context for objects that contain a specified set
of attributes.
|
NamingEnumeration |
search(String name,
Attributes matchingAttributes,
String[] attributesToReturn)
Searches in a single context for objects that contain a specified set
of attributes, and retrieves selected attributes.
|
NamingEnumeration |
search(String name,
String filterExpr,
Object[] filterArgs,
SearchControls cons)
Searches in the named context or object for entries that satisfy the
given search filter.
|
NamingEnumeration |
search(String name,
String filter,
SearchControls cons)
Searches in the named context or object for entries that satisfy the
given search filter.
|
void |
setAliases(String theAliases)
Set the current alias configuration from a String.
|
void |
unbind(String name)
Unbinds the named object.
|
addToEnvironment, allocate, bind, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, createSubcontext, destroySubcontext, getAttributes, getAttributes, getCacheMaxSize, getCacheObjectMaxSize, getCacheTTL, getDocBase, getEnvironment, getNameParser, getNameParser, getSchema, getSchemaClassDefinition, isCached, lookupLink, modifyAttributes, modifyAttributes, rebind, rebind, rebind, removeFromEnvironment, rename, search, search, search, search, setCached, setCacheMaxSize, setCacheObjectMaxSize, setCacheTTL, setDocBase, unbind
protected Map<String,DirContext> aliases
public AliasDirContext()
public AliasDirContext(Hashtable env)
public void addAlias(String path, BaseDirContext dirContext)
public void removeAlias(String path)
public String getAliases()
public void setAliases(String theAliases)
public void release()
BaseDirContext
release
in class BaseDirContext
public Object lookup(String name) throws NamingException
BaseDirContext
lookup
in interface Context
lookup
in class BaseDirContext
name
- the name of the object to look upNamingException
- if a naming exception is encounteredpublic Object lookup(Name name) throws NamingException
BaseDirContext
lookup
in interface Context
lookup
in class BaseDirContext
name
- the name of the object to look upNamingException
- if a naming exception is encounteredpublic void unbind(String name) throws NamingException
BaseDirContext
unbind
in interface Context
unbind
in class BaseDirContext
name
- the name to bind; may not be emptyNamingException
- if a naming exception is encounteredpublic void rename(String oldName, String newName) throws NamingException
BaseDirContext
rename
in interface Context
rename
in class BaseDirContext
oldName
- the name of the existing binding; may not be emptynewName
- the name of the new binding; may not be emptyNamingException
- if a naming exception is encounteredpublic NamingEnumeration list(String name) throws NamingException
BaseDirContext
list
in interface Context
list
in class BaseDirContext
name
- the name of the context to listNamingException
- if a naming exception is encounteredpublic NamingEnumeration list(Name name) throws NamingException
BaseDirContext
If a binding is added to or removed from this context, its effect on an enumeration previously returned is undefined.
list
in interface Context
list
in class BaseDirContext
name
- the name of the context to listNamingException
- if a naming exception is encounteredpublic NamingEnumeration listBindings(String name) throws NamingException
BaseDirContext
listBindings
in interface Context
listBindings
in class BaseDirContext
name
- the name of the context to listNamingException
- if a naming exception is encounteredpublic NamingEnumeration listBindings(Name name) throws NamingException
BaseDirContext
If a binding is added to or removed from this context, its effect on an enumeration previously returned is undefined.
listBindings
in interface Context
listBindings
in class BaseDirContext
name
- the name of the context to listNamingException
- if a naming exception is encounteredpublic void destroySubcontext(String name) throws NamingException
BaseDirContext
destroySubcontext
in interface Context
destroySubcontext
in class BaseDirContext
name
- the name of the context to be destroyed; may not be emptyNamingException
public Object lookupLink(String name) throws NamingException
BaseDirContext
lookupLink
in interface Context
lookupLink
in class BaseDirContext
name
- the name of the object to look upNamingException
- if a naming exception is encounteredpublic String getNameInNamespace() throws NamingException
BaseDirContext
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.
getNameInNamespace
in interface Context
getNameInNamespace
in class BaseDirContext
NamingException
- if a naming exception is encounteredpublic Attributes getAttributes(String name, String[] attrIds) throws NamingException
BaseDirContext
getAttributes
in interface DirContext
getAttributes
in class BaseDirContext
name
- the name of the object from which to retrieve attributesattrIds
- the identifiers of the attributes to retrieve. null
indicates that all attributes should be retrieved; an empty array
indicates that none should be retrievedNamingException
- if a naming exception is encounteredpublic Attributes getAttributes(Name name, String[] attrIds) throws NamingException
BaseDirContext
getAttributes
in interface DirContext
getAttributes
in class BaseDirContext
name
- the name of the object from which to retrieve attributesattrIds
- the identifiers of the attributes to retrieve. null
indicates that all attributes should be retrieved; an empty array
indicates that none should be retrievedNamingException
- if a naming exception is encounteredpublic void modifyAttributes(String name, int mod_op, Attributes attrs) throws NamingException
BaseDirContext
modifyAttributes
in interface DirContext
modifyAttributes
in class BaseDirContext
name
- the name of the object whose attributes will be updatedmod_op
- the modification operation, one of: ADD_ATTRIBUTE,
REPLACE_ATTRIBUTE, REMOVE_ATTRIBUTEattrs
- the attributes to be used for the modification; may not
be nullNamingException
- if a naming exception is encounteredpublic void modifyAttributes(String name, ModificationItem[] mods) throws NamingException
BaseDirContext
modifyAttributes
in interface DirContext
modifyAttributes
in class BaseDirContext
name
- the name of the object whose attributes will be updatedmods
- an ordered sequence of modifications to be performed; may
not be nullNamingException
- if a naming exception is encounteredpublic void bind(String name, Object obj, Attributes attrs) throws NamingException
BaseDirContext
bind
in interface DirContext
bind
in class BaseDirContext
name
- the name to bind; may not be emptyobj
- the object to bind; possibly nullattrs
- the attributes to associate with the bindingNamingException
- if a naming exception is encounteredpublic void rebind(String name, Object obj, Attributes attrs) throws NamingException
BaseDirContext
rebind
in interface DirContext
rebind
in class BaseDirContext
name
- the name to bind; may not be emptyobj
- the object to bind; possibly nullattrs
- the attributes to associate with the bindingNamingException
- if a naming exception is encounteredpublic DirContext createSubcontext(String name, Attributes attrs) throws NamingException
BaseDirContext
createSubcontext
in interface DirContext
createSubcontext
in class BaseDirContext
name
- the name of the context to create; may not be emptyattrs
- the attributes to associate with the newly created contextNamingException
- if a naming exception is encounteredpublic DirContext getSchema(String name) throws NamingException
BaseDirContext
getSchema
in interface DirContext
getSchema
in class BaseDirContext
name
- the name of the object whose schema is to be retrievedNamingException
- if a naming exception is encounteredpublic DirContext getSchemaClassDefinition(String name) throws NamingException
BaseDirContext
getSchemaClassDefinition
in interface DirContext
getSchemaClassDefinition
in class BaseDirContext
name
- the name of the object whose object class definition is to
be retrievedNamingException
- if a naming exception is encounteredpublic NamingEnumeration search(String name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException
BaseDirContext
search
in interface DirContext
search
in class BaseDirContext
name
- the name of the context to searchmatchingAttributes
- the attributes to search for. If empty or
null, all objects in the target context are returned.attributesToReturn
- the attributes to return. null indicates
that all attributes are to be returned; an empty array indicates that
none are to be returned.NamingException
- if a naming exception is encounteredpublic NamingEnumeration search(String name, Attributes matchingAttributes) throws NamingException
BaseDirContext
search
in interface DirContext
search
in class BaseDirContext
name
- the name of the context to searchmatchingAttributes
- the attributes to search for. If empty or
null, all objects in the target context are returned.NamingException
- if a naming exception is encounteredpublic NamingEnumeration search(String name, String filter, SearchControls cons) throws NamingException
BaseDirContext
search
in interface DirContext
search
in class BaseDirContext
name
- the name of the context or object to searchfilter
- the filter expression to use for the search; may not be
nullcons
- the search controls that control the search. If null,
the default search controls are used (equivalent to
(new SearchControls())).NamingException
- if a naming exception is encounteredpublic NamingEnumeration search(String name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException
BaseDirContext
search
in interface DirContext
search
in class BaseDirContext
name
- the name of the context or object to searchfilterExpr
- the filter expression to use for the search.
The expression may contain variables of the form "{i}" where i is a
nonnegative integer. May not be null.filterArgs
- the array of arguments to substitute for the
variables in filterExpr. The value of filterArgs[i] will replace each
occurrence of "{i}". If null, equivalent to an empty array.cons
- the search controls that control the search. If null, the
default search controls are used (equivalent to (new SearchControls())).NamingException
- if a naming exception is encounteredCopyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.