📄 dircontext.html
字号:
<PRE>public void <B>bind</B>(<A HREF="../../../java/lang/String.html">String</A> name, <A HREF="../../../java/lang/Object.html">Object</A> obj, <A HREF="../../../javax/naming/directory/Attributes.html">Attributes</A> attrs) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Binds a name to an object, along with associated attributes. See <A HREF="../../../javax/naming/directory/DirContext.html#bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)"><CODE>bind(Name, Object, Attributes)</CODE></A> for details.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to bind; may not be empty<DD><CODE>obj</CODE> - the object to bind; possibly null<DD><CODE>attrs</CODE> - the attributes to associate with the binding<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/NameAlreadyBoundException.html">NameAlreadyBoundException</A></CODE> - if name is already bound<DD><CODE><A HREF="../../../javax/naming/directory/InvalidAttributesException.html">InvalidAttributesException</A></CODE> - if some "mandatory" attributes of the binding are not supplied<DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)"><!-- --></A><H3>rebind</H3><PRE>public void <B>rebind</B>(<A HREF="../../../javax/naming/Name.html">Name</A> name, <A HREF="../../../java/lang/Object.html">Object</A> obj, <A HREF="../../../javax/naming/directory/Attributes.html">Attributes</A> attrs) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Binds a name to an object, along with associated attributes, overwriting any existing binding. If <tt>attrs</tt> is null and <tt>obj</tt> is a <tt>DirContext</tt>, the attributes from <tt>obj</tt> are used. If <tt>attrs</tt> is null and <tt>obj</tt> is not a <tt>DirContext</tt>, any existing attributes associated with the object already bound in the directory remain unchanged. If <tt>attrs</tt> is non-null, any existing attributes associated with the object already bound in the directory are removed and <tt>attrs</tt> is associated with the named object. If <tt>obj</tt> is a <tt>DirContext</tt> and <tt>attrs</tt> is non-null, the attributes of <tt>obj</tt> are ignored.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to bind; may not be empty<DD><CODE>obj</CODE> - the object to bind; possibly null<DD><CODE>attrs</CODE> - the attributes to associate with the binding<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/directory/InvalidAttributesException.html">InvalidAttributesException</A></CODE> - if some "mandatory" attributes of the binding are not supplied<DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered<DT><B>See Also: </B><DD><A HREF="../../../javax/naming/Context.html#bind(javax.naming.Name, java.lang.Object)"><CODE>Context.bind(Name, Object)</CODE></A>, <A HREF="../../../javax/naming/directory/DirContext.html#bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)"><CODE>bind(Name, Object, Attributes)</CODE></A></DL></DD></DL><HR><A NAME="rebind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes)"><!-- --></A><H3>rebind</H3><PRE>public void <B>rebind</B>(<A HREF="../../../java/lang/String.html">String</A> name, <A HREF="../../../java/lang/Object.html">Object</A> obj, <A HREF="../../../javax/naming/directory/Attributes.html">Attributes</A> attrs) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Binds a name to an object, along with associated attributes, overwriting any existing binding. See <A HREF="../../../javax/naming/directory/DirContext.html#rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes)"><CODE>rebind(Name, Object, Attributes)</CODE></A> for details.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name to bind; may not be empty<DD><CODE>obj</CODE> - the object to bind; possibly null<DD><CODE>attrs</CODE> - the attributes to associate with the binding<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/directory/InvalidAttributesException.html">InvalidAttributesException</A></CODE> - if some "mandatory" attributes of the binding are not supplied<DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="createSubcontext(javax.naming.Name, javax.naming.directory.Attributes)"><!-- --></A><H3>createSubcontext</H3><PRE>public <A HREF="../../../javax/naming/directory/DirContext.html">DirContext</A> <B>createSubcontext</B>(<A HREF="../../../javax/naming/Name.html">Name</A> name, <A HREF="../../../javax/naming/directory/Attributes.html">Attributes</A> attrs) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Creates and binds a new context, along with associated attributes. This method creates a new subcontext with the given name, binds it in the target context (that named by all but terminal atomic component of the name), and associates the supplied attributes with the newly created object. All intermediate and target contexts must already exist. If <tt>attrs</tt> is null, this method is equivalent to <tt>Context.createSubcontext()</tt>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the context to create; may not be empty<DD><CODE>attrs</CODE> - the attributes to associate with the newly created context<DT><B>Returns:</B><DD>the newly created context<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/NameAlreadyBoundException.html">NameAlreadyBoundException</A></CODE> - if the name is already bound<DD><CODE><A HREF="../../../javax/naming/directory/InvalidAttributesException.html">InvalidAttributesException</A></CODE> - if <code>attrs</code> does not contain all the mandatory attributes required for creation<DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered<DT><B>See Also: </B><DD><A HREF="../../../javax/naming/Context.html#createSubcontext(javax.naming.Name)"><CODE>Context.createSubcontext(Name)</CODE></A></DL></DD></DL><HR><A NAME="createSubcontext(java.lang.String, javax.naming.directory.Attributes)"><!-- --></A><H3>createSubcontext</H3><PRE>public <A HREF="../../../javax/naming/directory/DirContext.html">DirContext</A> <B>createSubcontext</B>(<A HREF="../../../java/lang/String.html">String</A> name, <A HREF="../../../javax/naming/directory/Attributes.html">Attributes</A> attrs) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Creates and binds a new context, along with associated attributes. See <A HREF="../../../javax/naming/directory/DirContext.html#createSubcontext(javax.naming.Name, javax.naming.directory.Attributes)"><CODE>createSubcontext(Name, Attributes)</CODE></A> for details.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the context to create; may not be empty<DD><CODE>attrs</CODE> - the attributes to associate with the newly created context<DT><B>Returns:</B><DD>the newly created context<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/NameAlreadyBoundException.html">NameAlreadyBoundException</A></CODE> - if the name is already bound<DD><CODE><A HREF="../../../javax/naming/directory/InvalidAttributesException.html">InvalidAttributesException</A></CODE> - if <code>attrs</code> does not contain all the mandatory attributes required for creation<DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="getSchema(javax.naming.Name)"><!-- --></A><H3>getSchema</H3><PRE>public <A HREF="../../../javax/naming/directory/DirContext.html">DirContext</A> <B>getSchema</B>(<A HREF="../../../javax/naming/Name.html">Name</A> name) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Retrieves the schema associated with the named object. The schema describes rules regarding the structure of the namespace and the attributes stored within it. The schema specifies what types of objects can be added to the directory and where they can be added; what mandatory and optional attributes an object can have. The range of support for schemas is directory-specific. <p> This method returns the root of the schema information tree that is applicable to the named object. Several named objects (or even an entire directory) might share the same schema. <p> Issues such as structure and contents of the schema tree, permission to modify to the contents of the schema tree, and the effect of such modifications on the directory are dependent on the underlying directory.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the object whose schema is to be retrieved<DT><B>Returns:</B><DD>the schema associated with the context; never null<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/OperationNotSupportedException.html">OperationNotSupportedException</A></CODE> - if schema not supported<DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="getSchema(java.lang.String)"><!-- --></A><H3>getSchema</H3><PRE>public <A HREF="../../../javax/naming/directory/DirContext.html">DirContext</A> <B>getSchema</B>(<A HREF="../../../java/lang/String.html">String</A> name) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Retrieves the schema associated with the named object. See <A HREF="../../../javax/naming/directory/DirContext.html#getSchema(javax.naming.Name)"><CODE>getSchema(Name)</CODE></A> for details.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the object whose schema is to be retrieved<DT><B>Returns:</B><DD>the schema associated with the context; never null<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/OperationNotSupportedException.html">OperationNotSupportedException</A></CODE> - if schema not supported<DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="getSchemaClassDefinition(javax.naming.Name)"><!-- --></A><H3>getSchemaClassDefinition</H3><PRE>public <A HREF="../../../javax/naming/directory/DirContext.html">DirContext</A> <B>getSchemaClassDefinition</B>(<A HREF="../../../javax/naming/Name.html">Name</A> name) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Retrieves a context containing the schema objects of the named object's class definitions.<p> One category of information found in directory schemas is <em>class definitions</em>. An "object class" definition specifies the object's <em>type</em> and what attributes (mandatory and optional) the object must/can have. Note that the term "object class" being referred to here is in the directory sense rather than in the Java sense. For example, if the named object is a directory object of "Person" class, <tt>getSchemaClassDefinition()</tt> would return a <tt>DirContext</tt> representing the (directory's) object class definition of "Person".<p> The information that can be retrieved from an object class definition is directory-dependent.<p> Prior to JNDI 1.2, this method returned a single schema object representing the class definition of the named object. Since JNDI 1.2, this method returns a <tt>DirContext</tt> containing all of the named object's class definitions.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the object whose object class definition is to be retrieved<DT><B>Returns:</B><DD>the <tt>DirContext</tt> containing the named object's class definitions; never null<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/naming/OperationNotSupportedException.html">OperationNotSupportedException</A></CODE> - if schema not supported<DD><CODE><A HREF="../../../javax/naming/NamingException.html">NamingException</A></CODE> - if a naming exception is encountered</DL></DD></DL><HR><A NAME="getSchemaClassDefinition(java.lang.String)"><!-- --></A><H3>getSchemaClassDefinition</H3><PRE>public <A HREF="../../../javax/naming/directory/DirContext.html">DirContext</A> <B>getSchemaClassDefinition</B>(<A HREF="../../../java/lang/String.html">String</A> name) throws <A HREF="../../../javax/naming/NamingException.html">NamingException</A></PRE><DL><DD>Retrieves a context containing the schema objects of the named object's class definitions. See <A HREF="../../../javax/naming/directory/DirContext.html#getSchemaClassDefinition(javax.naming.Name)"><CODE>getSchemaClassDefinition(Name)</CODE></A> for details.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the object whose object class definition is to be retrieved<DT><B>Returns:</B><DD>the <tt>DirContext</tt> containing the named object's class definitions; never null<DT><B>Throws:</B><DD><CODE><
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -