blob: 9a69d40e59975c3dafb4578eee4dbf4281df94ff [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_65) on Fri Mar 04 17:58:56 EST 2016 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
JndiLdapContextFactory (Apache Shiro 1.2.4 API)
</TITLE>
<META NAME="date" CONTENT="2016-03-04">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="JndiLdapContextFactory (Apache Shiro 1.2.4 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JndiLdapContextFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/shiro/realm/ldap/DefaultLdapContextFactory.html" title="class in org.apache.shiro.realm.ldap"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapRealm.html" title="class in org.apache.shiro.realm.ldap"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/shiro/realm/ldap/JndiLdapContextFactory.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="JndiLdapContextFactory.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.shiro.realm.ldap</FONT>
<BR>
Class JndiLdapContextFactory</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.shiro.realm.ldap.JndiLdapContextFactory</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../org/apache/shiro/realm/ldap/LdapContextFactory.html" title="interface in org.apache.shiro.realm.ldap">LdapContextFactory</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.79"><B>JndiLdapContextFactory</B></A><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="../../../../../org/apache/shiro/realm/ldap/LdapContextFactory.html" title="interface in org.apache.shiro.realm.ldap">LdapContextFactory</A></DL>
</PRE>
<P>
<A HREF="../../../../../org/apache/shiro/realm/ldap/LdapContextFactory.html" title="interface in org.apache.shiro.realm.ldap"><CODE>LdapContextFactory</CODE></A> implementation using the default Sun/Oracle JNDI Ldap API, utilizing JNDI
environment properties and an <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/InitialContext.html?is-external=true" title="class or interface in javax.naming"><CODE>InitialContext</CODE></A>.
<h2>Configuration</h2>
This class basically wraps a default template JNDI environment properties Map. This properties map is the base
configuration template used to acquire JNDI <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap"><CODE>LdapContext</CODE></A> connections at runtime. The
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> method implementation merges this default template with other properties
accessible at runtime only (for example per-method principals and credentials). The constructed runtime map is the
one used to acquire the <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap"><CODE>LdapContext</CODE></A>.
<p/>
The template can be configured directly via the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getEnvironment()"><CODE>getEnvironment()</CODE></A>/<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setEnvironment(java.util.Map)"><CODE>setEnvironment(java.util.Map)</CODE></A>
properties directly if necessary, but it is usually more convenient to use the supporting wrapper get/set methods
for various environment properties. These wrapper methods interact with the environment
template on your behalf, leaving your configuration cleaner and easier to understand.
<p/>
For example, consider the following two identical configurations:
<pre>
[main]
ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm
ldapRealm.contextFactory.url = ldap://localhost:389
ldapRealm.contextFactory.authenticationMechanism = DIGEST-MD5
</pre>
and
<pre>
[main]
ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm
ldapRealm.contextFactory.environment[java.naming.provider.url] = ldap://localhost:389
ldapRealm.contextFactory.environment[java.naming.security.authentication] = DIGEST-MD5
</pre>
As you can see, the 2nd configuration block is a little more difficult to read and also requires knowledge
of the underlying JNDI Context property keys. The first is easier to read and understand.
<p/>
Note that occasionally it will be necessary to use the latter configuration style to set environment properties
where no corresponding wrapper method exists. In this case, the hybrid approach is still a little easier to read.
For example:
<pre>
[main]
ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm
ldapRealm.contextFactory.url = ldap://localhost:389
ldapRealm.contextFactory.authenticationMechanism = DIGEST-MD5
ldapRealm.contextFactory.environment[some.other.obscure.jndi.key] = some value
</pre>
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>1.1</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#DEFAULT_CONTEXT_FACTORY_CLASS_NAME">DEFAULT_CONTEXT_FACTORY_CLASS_NAME</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#DEFAULT_REFERRAL">DEFAULT_REFERRAL</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#SIMPLE_AUTHENTICATION_MECHANISM_NAME">SIMPLE_AUTHENTICATION_MECHANISM_NAME</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#SUN_CONNECTION_POOLING_PROPERTY">SUN_CONNECTION_POOLING_PROPERTY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The Sun LDAP property used to enable connection pooling.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#JndiLdapContextFactory()">JndiLdapContextFactory</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default no-argument constructor that initializes the backing <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getEnvironment()"><CODE>environment template</CODE></A> with
the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setContextFactoryClassName(java.lang.String)"><CODE>contextFactoryClassName</CODE></A> equal to
<code>com.sun.jndi.ldap.LdapCtxFactory</code> (the Sun/Oracle default) and the default
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setReferral(java.lang.String)"><CODE>referral</CODE></A> behavior to <code>follow</code>.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap">LdapContext</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#createLdapContext(java.util.Hashtable)">createLdapContext</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html?is-external=true" title="class or interface in java.util">Hashtable</A>&nbsp;env)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates and returns a new <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/InitialLdapContext.html?is-external=true" title="class or interface in javax.naming.ldap"><CODE>InitialLdapContext</CODE></A> instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getAuthenticationMechanism()">getAuthenticationMechanism</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the type of LDAP authentication mechanism to use when connecting to the LDAP server.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getContextFactoryClassName()">getContextFactoryClassName</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the name of the ContextFactory class to use.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getEnvironment()">getEnvironment</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the base JNDI environment template to use when acquiring an LDAP connection (an <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap"><CODE>LdapContext</CODE></A>).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap">LdapContext</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)">getLdapContext</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;principal,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;credentials)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This implementation returns an LdapContext based on the configured JNDI/LDAP environment configuration.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap">LdapContext</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.String, java.lang.String)">getLdapContext</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;username,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> method should be used in all cases to ensure more than
String principals and credentials can be used. Shiro no longer calls this method - it will be
removed before the 2.0 release.</I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getReferral()">getReferral</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the LDAP referral behavior when creating a connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap">LdapContext</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemLdapContext()">getSystemLdapContext</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This implementation delegates to <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> using the
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemUsername()"><CODE>systemUsername</CODE></A> and <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemPassword()"><CODE>systemPassword</CODE></A> properties as
arguments.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemPassword()">getSystemPassword</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the password of the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setSystemUsername(java.lang.String)"><CODE>systemUsername</CODE></A> that will be used when creating an
LDAP connection used for authorization queries.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemUsername()">getSystemUsername</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the system username that will be used when creating an LDAP connection used for authorization queries.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getUrl()">getUrl</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the LDAP url to connect to.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#isPoolingConnections(java.lang.Object)">isPoolingConnections</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;principal)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if LDAP connection pooling should be used when acquiring a connection based on the specified
account principal, <code>false</code> otherwise.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#isPoolingEnabled()">isPoolingEnabled</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns whether or not connection pooling should be used when possible and appropriate.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setAuthenticationMechanism(java.lang.String)">setAuthenticationMechanism</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;authenticationMechanism)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the type of LDAP authentication mechanism to use when connecting to the LDAP server.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setContextFactoryClassName(java.lang.String)">setContextFactoryClassName</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;contextFactoryClassName)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The name of the ContextFactory class to use.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setEnvironment(java.util.Map)">setEnvironment</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&nbsp;env)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the base JNDI environment template to use when acquiring LDAP connections.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setPoolingEnabled(boolean)">setPoolingEnabled</A></B>(boolean&nbsp;poolingEnabled)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets whether or not connection pooling should be used when possible and appropriate.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setReferral(java.lang.String)">setReferral</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;referral)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the LDAP referral behavior when creating a connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setSystemPassword(java.lang.String)">setSystemPassword</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;systemPassword)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the password of the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setSystemUsername(java.lang.String)"><CODE>systemUsername</CODE></A> that will be used when creating an
LDAP connection used for authorization queries.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setSystemUsername(java.lang.String)">setSystemUsername</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;systemUsername)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the system username that will be used when creating an LDAP connection used for authorization queries.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setUrl(java.lang.String)">setUrl</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;url)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The LDAP url to connect to.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#validateAuthenticationInfo(java.util.Hashtable)">validateAuthenticationInfo</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html?is-external=true" title="class or interface in java.util">Hashtable</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;&nbsp;environment)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Validates the configuration in the JNDI <code>environment</code> settings and throws an exception if a problem
exists.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="SUN_CONNECTION_POOLING_PROPERTY"><!-- --></A><H3>
SUN_CONNECTION_POOLING_PROPERTY</H3>
<PRE>
protected static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.88"><B>SUN_CONNECTION_POOLING_PROPERTY</B></A></PRE>
<DL>
<DD>The Sun LDAP property used to enable connection pooling. This is used in the default implementation
to enable LDAP connection pooling.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.shiro.realm.ldap.JndiLdapContextFactory.SUN_CONNECTION_POOLING_PROPERTY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_CONTEXT_FACTORY_CLASS_NAME"><!-- --></A><H3>
DEFAULT_CONTEXT_FACTORY_CLASS_NAME</H3>
<PRE>
protected static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.89"><B>DEFAULT_CONTEXT_FACTORY_CLASS_NAME</B></A></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.shiro.realm.ldap.JndiLdapContextFactory.DEFAULT_CONTEXT_FACTORY_CLASS_NAME">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="SIMPLE_AUTHENTICATION_MECHANISM_NAME"><!-- --></A><H3>
SIMPLE_AUTHENTICATION_MECHANISM_NAME</H3>
<PRE>
protected static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.90"><B>SIMPLE_AUTHENTICATION_MECHANISM_NAME</B></A></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.shiro.realm.ldap.JndiLdapContextFactory.SIMPLE_AUTHENTICATION_MECHANISM_NAME">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_REFERRAL"><!-- --></A><H3>
DEFAULT_REFERRAL</H3>
<PRE>
protected static final <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.91"><B>DEFAULT_REFERRAL</B></A></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.shiro.realm.ldap.JndiLdapContextFactory.DEFAULT_REFERRAL">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="JndiLdapContextFactory()"><!-- --></A><H3>
JndiLdapContextFactory</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.113"><B>JndiLdapContextFactory</B></A>()</PRE>
<DL>
<DD>Default no-argument constructor that initializes the backing <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getEnvironment()"><CODE>environment template</CODE></A> with
the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setContextFactoryClassName(java.lang.String)"><CODE>contextFactoryClassName</CODE></A> equal to
<code>com.sun.jndi.ldap.LdapCtxFactory</code> (the Sun/Oracle default) and the default
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setReferral(java.lang.String)"><CODE>referral</CODE></A> behavior to <code>follow</code>.
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="setAuthenticationMechanism(java.lang.String)"><!-- --></A><H3>
setAuthenticationMechanism</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.139"><B>setAuthenticationMechanism</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;authenticationMechanism)</PRE>
<DL>
<DD>Sets the type of LDAP authentication mechanism to use when connecting to the LDAP server.
This is a wrapper method for setting the JNDI <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getEnvironment()"><CODE>environment template</CODE></A>'s
<A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/Context.html?is-external=true#SECURITY_AUTHENTICATION" title="class or interface in javax.naming"><CODE>Context.SECURITY_AUTHENTICATION</CODE></A> property.
<p/>
"none" (i.e. anonymous) and "simple" authentications are supported automatically and don't need to be configured
via this property. However, if you require a different mechanism, such as a SASL or External mechanism, you
must configure that explicitly via this property. See the
<a href="http://download-llnw.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html">JNDI LDAP
Authentication Mechanisms</a> for more information.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>authenticationMechanism</CODE> - the type of LDAP authentication to perform.<DT><B>See Also:</B><DD><a href="http://download-llnw.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html">
http://download-llnw.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html</a></DL>
</DD>
</DL>
<HR>
<A NAME="getAuthenticationMechanism()"><!-- --></A><H3>
getAuthenticationMechanism</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.159"><B>getAuthenticationMechanism</B></A>()</PRE>
<DL>
<DD>Returns the type of LDAP authentication mechanism to use when connecting to the LDAP server.
This is a wrapper method for getting the JNDI <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getEnvironment()"><CODE>environment template</CODE></A>'s
<A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/Context.html?is-external=true#SECURITY_AUTHENTICATION" title="class or interface in javax.naming"><CODE>Context.SECURITY_AUTHENTICATION</CODE></A> property.
<p/>
If this property remains un-configured (i.e. <code>null</code> indicating the
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setAuthenticationMechanism(java.lang.String)"><CODE>setAuthenticationMechanism(String)</CODE></A> method wasn't used), this indicates that the default JNDI
"none" (anonymous) and "simple" authentications are supported automatically. Any non-null value returned
represents an explicitly configured mechanism (e.g. a SASL or external mechanism). See the
<a href="http://download-llnw.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html">JNDI LDAP
Authentication Mechanisms</a> for more information.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the type of LDAP authentication mechanism to use when connecting to the LDAP server.<DT><B>See Also:</B><DD><a href="http://download-llnw.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html">
http://download-llnw.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html</a></DL>
</DD>
</DL>
<HR>
<A NAME="setContextFactoryClassName(java.lang.String)"><!-- --></A><H3>
setContextFactoryClassName</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.171"><B>setContextFactoryClassName</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;contextFactoryClassName)</PRE>
<DL>
<DD>The name of the ContextFactory class to use. This defaults to the SUN LDAP JNDI implementation
but can be overridden to use custom LDAP factories.
<p/>
This is a wrapper method for setting the JNDI environment's <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/Context.html?is-external=true#INITIAL_CONTEXT_FACTORY" title="class or interface in javax.naming"><CODE>Context.INITIAL_CONTEXT_FACTORY</CODE></A> property.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>contextFactoryClassName</CODE> - the context factory that should be used.</DL>
</DD>
</DL>
<HR>
<A NAME="getContextFactoryClassName()"><!-- --></A><H3>
getContextFactoryClassName</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.183"><B>getContextFactoryClassName</B></A>()</PRE>
<DL>
<DD>Sets the name of the ContextFactory class to use. This defaults to the SUN LDAP JNDI implementation
but can be overridden to use custom LDAP factories.
<p/>
This is a wrapper method for getting the JNDI environment's <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/Context.html?is-external=true#INITIAL_CONTEXT_FACTORY" title="class or interface in javax.naming"><CODE>Context.INITIAL_CONTEXT_FACTORY</CODE></A> property.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the name of the ContextFactory class to use.</DL>
</DD>
</DL>
<HR>
<A NAME="getEnvironment()"><!-- --></A><H3>
getEnvironment</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.200"><B>getEnvironment</B></A>()</PRE>
<DL>
<DD>Returns the base JNDI environment template to use when acquiring an LDAP connection (an <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap"><CODE>LdapContext</CODE></A>).
This property is the base configuration template to use for all connections. This template is then
merged with appropriate runtime values as necessary in the
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> implementation. The merged environment instance is what is used to
acquire the <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap"><CODE>LdapContext</CODE></A> at runtime.
<p/>
Most other get/set methods in this class act as thin proxy wrappers that interact with this property. The
benefit of using them is you have an easier-to-use configuration mechanism compared to setting map properties
based on JNDI context keys.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the base JNDI environment template to use when acquiring an LDAP connection (an <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap"><CODE>LdapContext</CODE></A>)</DL>
</DD>
</DL>
<HR>
<A NAME="setEnvironment(java.util.Map)"><!-- --></A><H3>
setEnvironment</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.217"><B>setEnvironment</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A>&nbsp;env)</PRE>
<DL>
<DD>Sets the base JNDI environment template to use when acquiring LDAP connections. It is typically more common
to use the other get/set methods in this class to set individual environment settings rather than use
this method, but it is available for advanced users that want full control over the base JNDI environment
settings.
<p/>
Note that this template only represents the base/default environment settings. It is then merged with
appropriate runtime values as necessary in the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> implementation.
The merged environment instance is what is used to acquire the connection (<A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap"><CODE>LdapContext</CODE></A>) at runtime.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>env</CODE> - the base JNDI environment template to use when acquiring LDAP connections.</DL>
</DD>
</DL>
<HR>
<A NAME="isPoolingEnabled()"><!-- --></A><H3>
isPoolingEnabled</H3>
<PRE>
public boolean <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.265"><B>isPoolingEnabled</B></A>()</PRE>
<DL>
<DD>Returns whether or not connection pooling should be used when possible and appropriate. This property is NOT
backed by the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getEnvironment()"><CODE>environment template</CODE></A> like most other properties in this class. It
is a flag to indicate that pooling is preferred. The default value is <code>true</code>.
<p/>
However, pooling will only actually be enabled if this property is <code>true</code> <em>and</em> the connection
being created is for the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemUsername()"><CODE>systemUsername</CODE></A> user. Connection pooling is not used for
general authentication attempts by application end-users because the probability of re-use for that same
user-specific connection after an authentication attempt is extremely low.
<p/>
If this attribute is <code>true</code> and it has been determined that the connection is being made with the
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemUsername()"><CODE>systemUsername</CODE></A>, the
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> implementation will set the Sun/Oracle-specific
<code>com.sun.jndi.ldap.connect.pool</code> environment property to &quot;<code>true</code>&quot;. This means setting
this property is only likely to work if using the Sun/Oracle default context factory class (i.e. not using
a custom <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getContextFactoryClassName()"><CODE>contextFactoryClassName</CODE></A>).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>whether or not connection pooling should be used when possible and appropriate</DL>
</DD>
</DL>
<HR>
<A NAME="setPoolingEnabled(boolean)"><!-- --></A><H3>
setPoolingEnabled</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.288"><B>setPoolingEnabled</B></A>(boolean&nbsp;poolingEnabled)</PRE>
<DL>
<DD>Sets whether or not connection pooling should be used when possible and appropriate. This property is NOT
a wrapper to the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getEnvironment()"><CODE>environment template</CODE></A> like most other properties in this class. It
is a flag to indicate that pooling is preferred. The default value is <code>true</code>.
<p/>
However, pooling will only actually be enabled if this property is <code>true</code> <em>and</em> the connection
being created is for the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemUsername()"><CODE>systemUsername</CODE></A> user. Connection pooling is not used for
general authentication attempts by application end-users because the probability of re-use for that same
user-specific connection after an authentication attempt is extremely low.
<p/>
If this attribute is <code>true</code> and it has been determined that the connection is being made with the
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemUsername()"><CODE>systemUsername</CODE></A>, the
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> implementation will set the Sun/Oracle-specific
<code>com.sun.jndi.ldap.connect.pool</code> environment property to &quot;<code>true</code>&quot;. This means setting
this property is only likely to work if using the Sun/Oracle default context factory class (i.e. not using
a custom <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getContextFactoryClassName()"><CODE>contextFactoryClassName</CODE></A>).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>poolingEnabled</CODE> - whether or not connection pooling should be used when possible and appropriate</DL>
</DD>
</DL>
<HR>
<A NAME="setReferral(java.lang.String)"><!-- --></A><H3>
setReferral</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.299"><B>setReferral</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;referral)</PRE>
<DL>
<DD>Sets the LDAP referral behavior when creating a connection. Defaults to <code>follow</code>. See the Sun/Oracle LDAP
<a href="http://java.sun.com/products/jndi/tutorial/ldap/referral/jndi.html">referral documentation</a> for more.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>referral</CODE> - the referral property.<DT><B>See Also:</B><DD><a href="http://java.sun.com/products/jndi/tutorial/ldap/referral/jndi.html">Referrals in JNDI</a></DL>
</DD>
</DL>
<HR>
<A NAME="getReferral()"><!-- --></A><H3>
getReferral</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.311"><B>getReferral</B></A>()</PRE>
<DL>
<DD>Returns the LDAP referral behavior when creating a connection. Defaults to <code>follow</code>.
See the Sun/Oracle LDAP
<a href="http://java.sun.com/products/jndi/tutorial/ldap/referral/jndi.html">referral documentation</a> for more.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the LDAP referral behavior when creating a connection.<DT><B>See Also:</B><DD><a href="http://java.sun.com/products/jndi/tutorial/ldap/referral/jndi.html">Referrals in JNDI</a></DL>
</DD>
</DL>
<HR>
<A NAME="setUrl(java.lang.String)"><!-- --></A><H3>
setUrl</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.320"><B>setUrl</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;url)</PRE>
<DL>
<DD>The LDAP url to connect to. (e.g. ldap://&lt;ldapDirectoryHostname&gt;:&lt;port&gt;). This must be configured.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>url</CODE> - the LDAP url to connect to. (e.g. ldap://&lt;ldapDirectoryHostname&gt;:&lt;port&gt;)</DL>
</DD>
</DL>
<HR>
<A NAME="getUrl()"><!-- --></A><H3>
getUrl</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.330"><B>getUrl</B></A>()</PRE>
<DL>
<DD>Returns the LDAP url to connect to. (e.g. ldap://&lt;ldapDirectoryHostname&gt;:&lt;port&gt;).
This must be configured.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the LDAP url to connect to. (e.g. ldap://&lt;ldapDirectoryHostname&gt;:&lt;port&gt;)</DL>
</DD>
</DL>
<HR>
<A NAME="setSystemPassword(java.lang.String)"><!-- --></A><H3>
setSystemPassword</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.344"><B>setSystemPassword</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;systemPassword)</PRE>
<DL>
<DD>Sets the password of the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setSystemUsername(java.lang.String)"><CODE>systemUsername</CODE></A> that will be used when creating an
LDAP connection used for authorization queries.
<p/>
Note that setting this property is not required if the calling LDAP Realm does not perform authorization
checks.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>systemPassword</CODE> - the password of the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setSystemUsername(java.lang.String)"><CODE>systemUsername</CODE></A> that will be used
when creating an LDAP connection used for authorization queries.</DL>
</DD>
</DL>
<HR>
<A NAME="getSystemPassword()"><!-- --></A><H3>
getSystemPassword</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.358"><B>getSystemPassword</B></A>()</PRE>
<DL>
<DD>Returns the password of the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setSystemUsername(java.lang.String)"><CODE>systemUsername</CODE></A> that will be used when creating an
LDAP connection used for authorization queries.
<p/>
Note that setting this property is not required if the calling LDAP Realm does not perform authorization
checks.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the password of the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#setSystemUsername(java.lang.String)"><CODE>systemUsername</CODE></A> that will be used when creating an
LDAP connection used for authorization queries.</DL>
</DD>
</DL>
<HR>
<A NAME="setSystemUsername(java.lang.String)"><!-- --></A><H3>
setSystemUsername</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.372"><B>setSystemUsername</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;systemUsername)</PRE>
<DL>
<DD>Sets the system username that will be used when creating an LDAP connection used for authorization queries.
The user must have the ability to query for authorization data for any application user.
<p/>
Note that setting this property is not required if the calling LDAP Realm does not perform authorization
checks.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>systemUsername</CODE> - the system username that will be used when creating an LDAP connection used for
authorization queries.</DL>
</DD>
</DL>
<HR>
<A NAME="getSystemUsername()"><!-- --></A><H3>
getSystemUsername</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.385"><B>getSystemUsername</B></A>()</PRE>
<DL>
<DD>Returns the system username that will be used when creating an LDAP connection used for authorization queries.
The user must have the ability to query for authorization data for any application user.
<p/>
Note that setting this property is not required if the calling LDAP Realm does not perform authorization
checks.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the system username that will be used when creating an LDAP connection used for authorization queries.</DL>
</DD>
</DL>
<HR>
<A NAME="getSystemLdapContext()"><!-- --></A><H3>
getSystemLdapContext</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap">LdapContext</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.401"><B>getSystemLdapContext</B></A>()
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD>This implementation delegates to <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> using the
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemUsername()"><CODE>systemUsername</CODE></A> and <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemPassword()"><CODE>systemPassword</CODE></A> properties as
arguments.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/realm/ldap/LdapContextFactory.html#getSystemLdapContext()">getSystemLdapContext</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/shiro/realm/ldap/LdapContextFactory.html" title="interface in org.apache.shiro.realm.ldap">LdapContextFactory</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the system LdapContext
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - if there is a problem connecting to the LDAP directory</DL>
</DD>
</DL>
<HR>
<A NAME="getLdapContext(java.lang.String, java.lang.String)"><!-- --></A><H3>
getLdapContext</H3>
<PRE>
<FONT SIZE="-1"><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
</FONT>public <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap">LdapContext</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.417"><B>getLdapContext</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;username,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;password)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<I>the <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> method should be used in all cases to ensure more than
String principals and credentials can be used. Shiro no longer calls this method - it will be
removed before the 2.0 release.</I>
<P>
<DD>Deprecated - use <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)"><CODE>getLdapContext(Object, Object)</CODE></A> instead. This will be removed before Apache Shiro 2.0.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/realm/ldap/LdapContextFactory.html#getLdapContext(java.lang.String, java.lang.String)">getLdapContext</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/shiro/realm/ldap/LdapContextFactory.html" title="interface in org.apache.shiro.realm.ldap">LdapContextFactory</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>username</CODE> - the username to use when creating the connection.<DD><CODE>password</CODE> - the password to use when creating the connection.
<DT><B>Returns:</B><DD>a <code>LdapContext</code> bound using the given username and password.
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - if there is an error creating the context.</DL>
</DD>
</DL>
<HR>
<A NAME="isPoolingConnections(java.lang.Object)"><!-- --></A><H3>
isPoolingConnections</H3>
<PRE>
protected boolean <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.434"><B>isPoolingConnections</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;principal)</PRE>
<DL>
<DD>Returns <code>true</code> if LDAP connection pooling should be used when acquiring a connection based on the specified
account principal, <code>false</code> otherwise.
<p/>
This implementation returns <code>true</code> only if <A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#isPoolingEnabled()"><CODE>isPoolingEnabled()</CODE></A> and the principal equals the
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getSystemUsername()"><CODE>getSystemUsername()</CODE></A>. The reasoning behind this is that connection pooling is not desirable for
general authentication attempts by application end-users because the probability of re-use for that same
user-specific connection after an authentication attempt is extremely low.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>principal</CODE> - the principal under which the connection will be made
<DT><B>Returns:</B><DD><code>true</code> if LDAP connection pooling should be used when acquiring a connection based on the specified
account principal, <code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="getLdapContext(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
getLdapContext</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap">LdapContext</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.454"><B>getLdapContext</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;principal,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;credentials)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A>,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></PRE>
<DL>
<DD>This implementation returns an LdapContext based on the configured JNDI/LDAP environment configuration.
The environnmet (Map) used at runtime is created by merging the default/configured
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#getEnvironment()"><CODE>environment template</CODE></A> with some runtime values as necessary (e.g. a principal and
credential available at runtime only).
<p/>
After the merged Map instance is created, the LdapContext connection is
<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#createLdapContext(java.util.Hashtable)"><CODE>created</CODE></A> and returned.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/realm/ldap/LdapContextFactory.html#getLdapContext(java.lang.Object, java.lang.Object)">getLdapContext</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/shiro/realm/ldap/LdapContextFactory.html" title="interface in org.apache.shiro.realm.ldap">LdapContextFactory</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>principal</CODE> - the principal to use when acquiring a connection to the LDAP directory<DD><CODE>credentials</CODE> - the credentials (password, X.509 certificate, etc) to use when acquiring a connection to the
LDAP directory
<DT><B>Returns:</B><DD>the acquired <code>LdapContext</code> connection bound using the specified principal and credentials.
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="createLdapContext(java.util.Hashtable)"><!-- --></A><H3>
createLdapContext</H3>
<PRE>
protected <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/LdapContext.html?is-external=true" title="class or interface in javax.naming.ldap">LdapContext</A> <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.507"><B>createLdapContext</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html?is-external=true" title="class or interface in java.util">Hashtable</A>&nbsp;env)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD>Creates and returns a new <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/ldap/InitialLdapContext.html?is-external=true" title="class or interface in javax.naming.ldap"><CODE>InitialLdapContext</CODE></A> instance. This method exists primarily
to support testing where a mock LdapContext can be returned instead of actually creating a connection, but
subclasses are free to provide a different implementation if necessary.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>env</CODE> - the JNDI environment settings used to create the LDAP connection
<DT><B>Returns:</B><DD>an LdapConnection
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - if a problem occurs creating the connection</DL>
</DD>
</DL>
<HR>
<A NAME="validateAuthenticationInfo(java.util.Hashtable)"><!-- --></A><H3>
validateAuthenticationInfo</H3>
<PRE>
protected void <A HREF="../../../../../src-html/org/apache/shiro/realm/ldap/JndiLdapContextFactory.html#line.523"><B>validateAuthenticationInfo</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html?is-external=true" title="class or interface in java.util">Hashtable</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&gt;&nbsp;environment)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/AuthenticationException.html?is-external=true" title="class or interface in javax.naming">AuthenticationException</A></PRE>
<DL>
<DD>Validates the configuration in the JNDI <code>environment</code> settings and throws an exception if a problem
exists.
<p/>
This implementation will throw a <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/AuthenticationException.html?is-external=true" title="class or interface in javax.naming"><CODE>AuthenticationException</CODE></A> if the authentication mechanism is set to
'simple', the principal is non-empty, and the credentials are empty (as per
<a href="http://tools.ietf.org/html/rfc4513#section-5.1.2">rfc4513 section-5.1.2</a>).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>environment</CODE> - the JNDI environment settings to be validated
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/AuthenticationException.html?is-external=true" title="class or interface in javax.naming">AuthenticationException</A></CODE> - if a configuration problem is detected</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JndiLdapContextFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/shiro/realm/ldap/DefaultLdapContextFactory.html" title="class in org.apache.shiro.realm.ldap"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/shiro/realm/ldap/JndiLdapRealm.html" title="class in org.apache.shiro.realm.ldap"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/shiro/realm/ldap/JndiLdapContextFactory.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="JndiLdapContextFactory.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2004-2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>