⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ldapmanager.html

📁 开源软件openfire的API文件。进行openfire的二次开发所必需的工具。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 lookups and searches using the default base DN. The alternate DN will be used in case there is a <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/NamingException.html" title="class or interface in javax.naming"><CODE>NamingException</CODE></A> using base DN. The context uses the admin login that is defined by <tt>adminDN</tt> and <tt>adminPassword</tt>.<P><DD><DL><DT><B>Returns:</B><DD>a connection to the LDAP server.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/NamingException.html" title="class or interface in javax.naming">NamingException</A></CODE> - if there is an error making the LDAP connection.</DL></DD></DL><HR><A NAME="getContext(java.lang.String)"><!-- --></A><H3>getContext</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/ldap/LdapContext.html" title="class or interface in javax.naming.ldap">LdapContext</A> <B>getContext</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;baseDN)                       throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/NamingException.html" title="class or interface in javax.naming">NamingException</A></PRE><DL><DD>Returns a DirContext for the LDAP server that can be used to perform lookups and searches using the specified base DN. The context uses the admin login that is defined by <tt>adminDN</tt> and <tt>adminPassword</tt>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>baseDN</CODE> - the base DN to use for the context.<DT><B>Returns:</B><DD>a connection to the LDAP server.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/NamingException.html" title="class or interface in javax.naming">NamingException</A></CODE> - if there is an error making the LDAP connection.</DL></DD></DL><HR><A NAME="checkAuthentication(java.lang.String, java.lang.String)"><!-- --></A><H3>checkAuthentication</H3><PRE>public boolean <B>checkAuthentication</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;userDN,                                   <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;password)</PRE><DL><DD>Returns true if the user is able to successfully authenticate against the LDAP server. The "simple" authentication protocol is used.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>userDN</CODE> - the user's dn to authenticate (relative to <tt>baseDN</tt>).<DD><CODE>password</CODE> - the user's password.<DT><B>Returns:</B><DD>true if the user successfully authenticates.</DL></DD></DL><HR><A NAME="findUserDN(java.lang.String)"><!-- --></A><H3>findUserDN</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>findUserDN</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;username)                  throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Finds a user's dn using their username. Normally, this search will be performed using the field "uid", but this can be changed by setting the <tt>usernameField</tt> property.<p> Searches are performed over all subtrees relative to the <tt>baseDN</tt>. If the search fails in the <tt>baseDN</tt> then another search will be performed in the <tt>alternateBaseDN</tt>. For example, if the <tt>baseDN</tt> is "o=jivesoftware, o=com" and we do a search for "mtucker", then we might find a userDN of "uid=mtucker,ou=People". This kind of searching is a good thing since it doesn't make the assumption that all user records are stored in a flat structure. However, it does add the requirement that "uid" field (or the other field specified) must be unique over the entire subtree from the <tt>baseDN</tt>. For example, it's entirely possible to create two dn's in your LDAP directory with the same uid: "uid=mtucker,ou=People" and "uid=mtucker,ou=Administrators". In such a case, it's not possible to uniquely identify a user, so this method will throw an error.<p> The dn that's returned is relative to the default <tt>baseDN</tt>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - the username to lookup the dn for.<DT><B>Returns:</B><DD>the dn associated with <tt>username</tt>.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE> - if the search for the dn fails.</DL></DD></DL><HR><A NAME="findUserDN(java.lang.String, java.lang.String)"><!-- --></A><H3>findUserDN</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>findUserDN</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;username,                         <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;baseDN)                  throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Finds a user's dn using their username in the specified baseDN. Normally, this search will be performed using the field "uid", but this can be changed by setting the <tt>usernameField</tt> property.<p> Searches are performed over all sub-trees relative to the <tt>baseDN</tt> unless sub-tree searching has been disabled. For example, if the <tt>baseDN</tt> is "o=jivesoftware, o=com" and we do a search for "mtucker", then we might find a userDN of "uid=mtucker,ou=People". This kind of searching is a good thing since it doesn't make the assumption that all user records are stored in a flat structure. However, it does add the requirement that "uid" field (or the other field specified) must be unique over the entire subtree from the <tt>baseDN</tt>. For example, it's entirely possible to create two dn's in your LDAP directory with the same uid: "uid=mtucker,ou=People" and "uid=mtucker,ou=Administrators". In such a case, it's not possible to uniquely identify a user, so this method will throw an error.<p> The DN that's returned is relative to the <tt>baseDN</tt>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - the username to lookup the dn for.<DD><CODE>baseDN</CODE> - the base DN to use for this search.<DT><B>Returns:</B><DD>the dn associated with <tt>username</tt>.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE> - if the search for the dn fails.<DT><B>See Also:</B><DD><A HREF="../../../../org/jivesoftware/openfire/ldap/LdapManager.html#findUserDN(java.lang.String)"><CODE>to search using the default baseDN and alternateBaseDN.</CODE></A></DL></DD></DL><HR><A NAME="findGroupDN(java.lang.String)"><!-- --></A><H3>findGroupDN</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>findGroupDN</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;groupname)                   throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Finds a groups's dn using it's group name. Normally, this search will be performed using the field "cn", but this can be changed by setting the <tt>groupNameField</tt> property.<p> Searches are performed over all subtrees relative to the <tt>baseDN</tt>. If the search fails in the <tt>baseDN</tt> then another search will be performed in the <tt>alternateBaseDN</tt>. For example, if the <tt>baseDN</tt> is "o=jivesoftware, o=com" and we do a search for "managers", then we might find a groupDN of "uid=managers,ou=Groups". This kind of searching is a good thing since it doesn't make the assumption that all user records are stored in a flat structure. However, it does add the requirement that "cn" field (or the other field specified) must be unique over the entire subtree from the <tt>baseDN</tt>. For example, it's entirely possible to create two dn's in your LDAP directory with the same cn: "cn=managers,ou=Financial" and "cn=managers,ou=Engineers". In such a case, it's not possible to uniquely identify a group, so this method will throw an error.<p> The dn that's returned is relative to the default <tt>baseDN</tt>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>groupname</CODE> - the groupname to lookup the dn for.<DT><B>Returns:</B><DD>the dn associated with <tt>groupname</tt>.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE> - if the search for the dn fails.</DL></DD></DL><HR><A NAME="findGroupDN(java.lang.String, java.lang.String)"><!-- --></A><H3>findGroupDN</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>findGroupDN</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;groupname,                          <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;baseDN)                   throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Finds a groups's dn using it's group name. Normally, this search will be performed using the field "cn", but this can be changed by setting the <tt>groupNameField</tt> property.<p> Searches are performed over all subtrees relative to the <tt>baseDN</tt>. If the search fails in the <tt>baseDN</tt> then another search will be performed in the <tt>alternateBaseDN</tt>. For example, if the <tt>baseDN</tt> is "o=jivesoftware, o=com" and we do a search for "managers", then we might find a groupDN of "uid=managers,ou=Groups". This kind of searching is a good thing since it doesn't make the assumption that all user records are stored in a flat structure. However, it does add the requirement that "cn" field (or the other field specified) must be unique over the entire subtree from the <tt>baseDN</tt>. For example, it's entirely possible to create two dn's in your LDAP directory with the same cn: "cn=managers,ou=Financial" and "cn=managers,ou=Engineers". In such a case, it's not possible to uniquely identify a group, so this method will throw an error.<p> The dn that's returned is relative to the default <tt>baseDN</tt>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>groupname</CODE> - the groupname to lookup the dn for.<DD><CODE>baseDN</CODE> - the base DN to use for this search.<DT><B>Returns:</B><DD>the dn associated with <tt>groupname</tt>.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE> - if the search for the dn fails.<DT><B>See Also:</B><DD><A HREF="../../../../org/jivesoftware/openfire/ldap/LdapManager.html#findGroupDN(java.lang.String)"><CODE>to search using the default baseDN and alternateBaseDN.</CODE></A></DL></DD></DL><HR><A NAME="getHosts()"><!-- --></A><H3>getHosts</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&gt; <B>getHosts</B>()</PRE><DL><DD>Returns the LDAP servers hosts; e.g. <tt>localhost</tt> or <tt>machine.example.com</tt>, etc. This value is stored as the Jive Property <tt>ldap.host</tt>.<P><DD><DL><DT><B>Returns:</B><DD>the LDAP server host name.</DL></DD></DL><HR><A NAME="setHosts(java.util.Collection)"><!-- --></A><H3>setHosts</H3><PRE>public void <B>setHosts</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&gt;&nbsp;hosts)</PRE><DL><DD>Sets the list of LDAP servers host; e.g., <tt>localhost</tt> or <tt>machine.example.com</tt>, etc. This value is store as the Jive Property <tt>ldap.host</tt> using a comma as a delimiter for each host.<p> Note that all LDAP servers have to share the same configuration.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>hosts</CODE> - the LDAP servers host names.</DL></DD></DL><HR><A NAME="getPort()"><!-- --></A><H3>getPort</H3><PRE>public int <B>getPort</B>()</PRE><DL><DD>Returns the LDAP server port number. The default is 389. This value is stored as the Jive Property <tt>ldap.port</tt>.<P><DD><DL><DT><B>Returns:</B><DD>the LDAP server port number.</DL></DD></DL><HR><A NAME="setPort(int)"><!-- --></A><H3>setPort</H3><PRE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -