Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 49323 invoked from network); 15 Oct 2007 03:51:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Oct 2007 03:51:26 -0000 Received: (qmail 11283 invoked by uid 500); 15 Oct 2007 03:51:14 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 11232 invoked by uid 500); 15 Oct 2007 03:51:14 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 11221 invoked by uid 99); 15 Oct 2007 03:51:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Oct 2007 20:51:14 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Oct 2007 03:51:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A4B931A9838; Sun, 14 Oct 2007 20:51:05 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r584662 - in /directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap: filter/ScopeNode.java message/DerefAliasesEnum.java Date: Mon, 15 Oct 2007 03:51:05 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071015035105.A4B931A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: akarasulu Date: Sun Oct 14 20:51:04 2007 New Revision: 584662 URL: http://svn.apache.org/viewvc?rev=584662&view=rev Log: Adding capability to extract value from a JNDI environment. Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/DerefAliasesEnum.java Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java?rev=584662&r1=584661&r2=584662&view=diff ============================================================================== --- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java (original) +++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/ScopeNode.java Sun Oct 14 20:51:04 2007 @@ -20,8 +20,6 @@ package org.apache.directory.shared.ldap.filter; -import java.util.Map; - import javax.naming.directory.SearchControls; import org.apache.directory.shared.ldap.message.DerefAliasesEnum; @@ -53,29 +51,12 @@ * @param baseDn the search base * @param scope the search scope */ - public ScopeNode(DerefAliasesEnum derefAliases, String baseDn, int scope) + public ScopeNode( DerefAliasesEnum derefAliases, String baseDn, int scope ) { super(); this.scope = scope; this.baseDn = baseDn; this.derefAliases = derefAliases; - } - - - /** - * Creates a new ScopeNode object. - * - * @param env the JNDI environment from which to extract the alias - * dereferencing mode - * @param baseDn the search base - * @param scope the search scope - */ - public ScopeNode( Map env, String baseDn, int scope ) - { - super(); - this.scope = scope; - this.baseDn = baseDn; - derefAliases = DerefAliasesEnum.getEnum( env ); } Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/DerefAliasesEnum.java URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/DerefAliasesEnum.java?rev=584662&r1=584661&r2=584662&view=diff ============================================================================== --- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/DerefAliasesEnum.java (original) +++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/message/DerefAliasesEnum.java Sun Oct 14 20:51:04 2007 @@ -81,9 +81,9 @@ * java.naming.ldap.derefAliases property * @return the enumeration for the environment */ - public static DerefAliasesEnum getEnum( Map env ) + public static DerefAliasesEnum getEnum( Map env ) { - DerefAliasesEnum property = env.get( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES ); + String property = ( String ) env.get( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES ); if ( null == property ) { @@ -91,7 +91,28 @@ } else { - return property; + if ( property.trim().equalsIgnoreCase( "always" ) ) + { + return DEREF_ALWAYS; + } + else if ( property.trim().equalsIgnoreCase( "never" ) ) + { + return NEVER_DEREF_ALIASES; + } + else if ( property.trim().equalsIgnoreCase( "finding" ) ) + { + return DEREF_FINDING_BASE_OBJ; + } + else if ( property.trim().equalsIgnoreCase( "searching" ) ) + { + return DEREF_IN_SEARCHING; + } + else + { + throw new IllegalArgumentException( "Unrecogniced value '" + property + "' for " + + JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES + " JNDI property.\n" + + "Expected a value of either always, never, searching, or finding." ); + } } }