APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.jndi.ldap

pack-priv final Class LdapSchemaCtx

extends HierMemDirCtx
Class Inheritance
Imports
javax.naming.*, javax.naming.directory.*, java.util.Hashtable, java.util.concurrent.locks.ReentrantLock, com.sun.jndi.toolkit.dir.HierMemDirCtx

This is the class used to implement LDAP's GetSchema call. It subclasses HierMemDirContext for most of the functionality. It overrides functions that cause the schema definitions to change. In such a case, it write the schema to the LdapServer and (assuming there are no errors), calls it's superclass's equivalent function. Thus, the schema tree and the LDAP server's schema attributes are always in sync.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
private static final boolean
private LdapSchemaCtx.SchemaInfo
private static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
private int
private static final int
private boolean
pack-priv static final int
pack-priv static final int
Inherited from com.sun.jndi.toolkit.dir.HierMemDirCtx:
attrsbindingsignoreCasemyEnvmyParserreadOnlyEx

Constructor Summary

AccessConstructor and Description
private
LdapSchemaCtx(int objectType, Hashtable<String, Object> environment, LdapSchemaCtx.SchemaInfo info)

Method Summary

Modifier and TypeMethod and Description
private final void
public final void
bind(Name name, Object obj, Attributes attrs)

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.bind.

Implements javax.naming.directory.DirContext.bind.

Binds a name to an object, along with associated attributes.

public void
protected final HierMemDirCtx
pack-priv static DirContext
createSchemaTree(Hashtable<String, Object> env, String subschemasubentry, LdapCtx schemaEntry, Attributes schemaAttrs, boolean netscapeBug)

private static final Attributes
private final void
deleteServerSchema(Attributes origAttrs)

When we delete an entry, we use the original to make sure that any formatting inconsistencies are eliminated.

protected final void
doBind(Name name, Object obj, Attributes attrs, boolean useFactory)

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.doBind.

protected final DirContext
protected final void
protected final void
protected final void
doRebind(Name name, Object obj, Attributes attrs, boolean useFactory)

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.doRebind.

protected final void
protected final void
private final void
modifyServerSchema(Attributes origAttrs, Attributes newAttrs)

When we modify an entry, we use the original attribute value in the schema to make sure that any formatting inconsistencies are eliminated.

public final void
rebind(Name name, Object obj, Attributes attrs)

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.rebind.

Implements javax.naming.directory.DirContext.rebind.

Binds a name to an object, along with associated attributes, overwriting any existing binding.

pack-priv final LdapSchemaCtx
setup(int objectType, String name, Attributes attrs)

Inherited from com.sun.jndi.toolkit.dir.HierMemDirCtx:
addToEnvironmentapplyModsbindbindbindcanonizeNamecomposeNamecomposeNamecreateSubcontextcreateSubcontextcreateSubcontextcreateSubcontextdestroySubcontextdestroySubcontextdoBindAuxdoGetAttributesdoGetAttributesdoListdoListBindingsdoLookupdoRebindAuxgetAttributesgetAttributesgetAttributesgetAttributesgetEnvironmentgetInternalNamegetLeafNamegetNameInNamespacegetNameParsergetNameParsergetSchemagetSchemagetSchemaClassDefinitiongetSchemaClassDefinitionlistlistlistBindingslistBindingslookuplookuplookupLinklookupLinkmodifyAttributesmodifyAttributesmodifyAttributesmodifyAttributesrebindrebindrebindremoveFromEnvironmentrenamerenamesearchsearchsearchsearchsearchsearchsearchsearchsetIgnoreCasesetNameParsersetReadOnlyunbindunbind

Field Detail

ATTRIBUTEback to summary
pack-priv static final int ATTRIBUTE
ATTRIBUTE_ROOTback to summary
pack-priv static final int ATTRIBUTE_ROOT
debugback to summary
private static final boolean debug

Hides com.sun.jndi.toolkit.dir.HierMemDirCtx.debug.

infoback to summary
private LdapSchemaCtx.SchemaInfo info
LEAFback to summary
private static final int LEAF
MATCHRULEback to summary
pack-priv static final int MATCHRULE
MATCHRULE_ROOTback to summary
pack-priv static final int MATCHRULE_ROOT
OBJECTCLASSback to summary
pack-priv static final int OBJECTCLASS
OBJECTCLASS_ROOTback to summary
pack-priv static final int OBJECTCLASS_ROOT
objectTypeback to summary
private int objectType
SCHEMA_ROOTback to summary
private static final int SCHEMA_ROOT
setupModeback to summary
private boolean setupMode
SYNTAXback to summary
pack-priv static final int SYNTAX
SYNTAX_ROOTback to summary
pack-priv static final int SYNTAX_ROOT

Constructor Detail

LdapSchemaCtxback to summary
private LdapSchemaCtx(int objectType, Hashtable<String, Object> environment, LdapSchemaCtx.SchemaInfo info)

Method Detail

addServerSchemaback to summary
private final void addServerSchema(Attributes attrs) throws NamingException
bindback to summary
public final void bind(Name name, Object obj, Attributes attrs) throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.bind.

Implements javax.naming.directory.DirContext.bind.

Doc from javax.naming.directory.DirContext.bind.

Binds a name to an object, along with associated attributes. If attrs is null, the resulting binding will have the attributes associated with obj if obj is a DirContext, and no attributes otherwise. If attrs is non-null, the resulting binding will have attrs as its attributes; any attributes associated with obj are ignored.

Exceptions
NamingException:
if a naming exception is encountered
closeback to summary
public void close() throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.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.

Exceptions
NamingException:
if a naming exception is encountered
createNewCtxback to summary
protected final HierMemDirCtx createNewCtx()

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.createNewCtx.

createSchemaTreeback to summary
pack-priv static DirContext createSchemaTree(Hashtable<String, Object> env, String subschemasubentry, LdapCtx schemaEntry, Attributes schemaAttrs, boolean netscapeBug) throws NamingException
deepCloneback to summary
private static final Attributes deepClone(Attributes orig) throws NamingException
deleteServerSchemaback to summary
private final void deleteServerSchema(Attributes origAttrs) throws NamingException

When we delete an entry, we use the original to make sure that any formatting inconsistencies are eliminated. This is because we're just deleting a value from an attribute on the server and there might not be any checks for extra spaces or parens.

doBindback to summary
protected final void doBind(Name name, Object obj, Attributes attrs, boolean useFactory) throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.doBind.

doCreateSubcontextback to summary
protected final DirContext doCreateSubcontext(Name name, Attributes attrs) throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.doCreateSubcontext.

doDestroySubcontextback to summary
protected final void doDestroySubcontext(Name name) throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.doDestroySubcontext.

doModifyAttributesback to summary
protected final void doModifyAttributes(ModificationItem[] mods) throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.doModifyAttributes.

doRebindback to summary
protected final void doRebind(Name name, Object obj, Attributes attrs, boolean useFactory) throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.doRebind.

doRenameback to summary
protected final void doRename(Name oldname, Name newname) throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.doRename.

doUnbindback to summary
protected final void doUnbind(Name name) throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.doUnbind.

modifyServerSchemaback to summary
private final void modifyServerSchema(Attributes origAttrs, Attributes newAttrs) throws NamingException

When we modify an entry, we use the original attribute value in the schema to make sure that any formatting inconsistencies are eliminated. A modification is done by deleting the original value and adding a new value with the modification.

rebindback to summary
public final void rebind(Name name, Object obj, Attributes attrs) throws NamingException

Overrides com.sun.jndi.toolkit.dir.HierMemDirCtx.rebind.

Implements javax.naming.directory.DirContext.rebind.

Doc from javax.naming.directory.DirContext.rebind.

Binds a name to an object, along with associated attributes, overwriting any existing binding. If attrs is null and obj is a DirContext, the attributes from obj are used. If attrs is null and obj is not a DirContext, any existing attributes associated with the object already bound in the directory remain unchanged. If attrs is non-null, any existing attributes associated with the object already bound in the directory are removed and attrs is associated with the named object. If obj is a DirContext and attrs is non-null, the attributes of obj are ignored.

Exceptions
NamingException:
if a naming exception is encountered
setupback to summary
pack-priv final LdapSchemaCtx setup(int objectType, String name, Attributes attrs) throws NamingException
com.sun.jndi.ldap back to summary

private final Class LdapSchemaCtx.SchemaInfo

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
private String
private final ReentrantLock
pack-priv LdapSchemaParser
private int
private LdapCtx
private String

Constructor Summary

AccessConstructor and Description
pack-priv
SchemaInfo(String schemaEntryName, LdapCtx schemaEntry, LdapSchemaParser parser)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv void
modifyAttributes(Hashtable<?, ?> env, int mod, Attributes attrs)

private LdapCtx
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hasLdapsSchemeback to summary
private boolean hasLdapsScheme
hostback to summary
private String host
lockback to summary
private final ReentrantLock lock
parserback to summary
pack-priv LdapSchemaParser parser
portback to summary
private int port
schemaEntryback to summary
private LdapCtx schemaEntry
schemaEntryNameback to summary
private String schemaEntryName

Constructor Detail

SchemaInfoback to summary
pack-priv SchemaInfo(String schemaEntryName, LdapCtx schemaEntry, LdapSchemaParser parser)

Method Detail

closeback to summary
pack-priv void close() throws NamingException
modifyAttributesback to summary
pack-priv void modifyAttributes(Hashtable<?, ?> env, ModificationItem[] mods) throws NamingException
modifyAttributesback to summary
pack-priv void modifyAttributes(Hashtable<?, ?> env, int mod, Attributes attrs) throws NamingException
reopenEntryback to summary
private LdapCtx reopenEntry(Hashtable<?, ?> env) throws NamingException