Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 49912 invoked from network); 5 Jul 2010 20:25:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Jul 2010 20:25:59 -0000 Received: (qmail 93698 invoked by uid 500); 5 Jul 2010 20:25:59 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 93644 invoked by uid 500); 5 Jul 2010 20:25:59 -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 93637 invoked by uid 99); 5 Jul 2010 20:25:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 20:25:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 20:25:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 816C723889E5; Mon, 5 Jul 2010 20:24:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r960682 - in /directory: apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/ shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/ shared/trunk/ldap/src/main/java/org/apache/directory/... Date: Mon, 05 Jul 2010 20:24:33 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100705202433.816C723889E5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Mon Jul 5 20:24:33 2010 New Revision: 960682 URL: http://svn.apache.org/viewvc?rev=960682&view=rev Log: o Added a constant in SchemaConstants for the 'administrativeRole' AT o Used it in the server Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=960682&r1=960681&r2=960682&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Mon Jul 5 20:24:33 2010 @@ -418,10 +418,12 @@ public class SubentryInterceptor extends // get the name of the administrative point and its administrativeRole attributes DN apName = name.getParent(); Entry ap = addContext.lookup( apName, ByPassConstants.LOOKUP_BYPASS ); - EntryAttribute administrativeRole = ap.get( "administrativeRole" ); + + // The administrativeRole AT must exist and not be null + EntryAttribute administrativeRole = ap.get( SchemaConstants.ADMINISTRATIVE_ROLE_AT ); // check that administrativeRole has something valid in it for us - if ( administrativeRole == null || administrativeRole.size() <= 0 ) + if ( ( administrativeRole == null ) || ( administrativeRole.size() <= 0 ) ) { throw new LdapNoSuchAttributeException( I18n.err( I18n.ERR_306, apName ) ); } @@ -680,7 +682,7 @@ public class SubentryInterceptor extends */ private boolean hasAdministrativeDescendant( OperationContext opContext, DN name ) throws LdapException { - ExprNode filter = new PresenceNode( "administrativeRole" ); + ExprNode filter = new PresenceNode( SchemaConstants.ADMINISTRATIVE_ROLE_AT ); SearchControls controls = new SearchControls(); controls.setSearchScope( SearchControls.SUBTREE_SCOPE ); Modified: directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java?rev=960682&r1=960681&r2=960682&view=diff ============================================================================== --- directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java (original) +++ directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java Mon Jul 5 20:24:33 2010 @@ -291,6 +291,10 @@ public interface SchemaConstants String MODIFIERS_NAME_AT = "modifiersName"; String MODIFIERS_NAME_AT_OID = "2.5.18.4"; + // AdministrativeRole + String ADMINISTRATIVE_ROLE_AT = "administrativeRole"; + String ADMINISTRATIVE_ROLE_AT_OID = "2.5.18.5"; + // SubtreeSpecification String SUBTREE_SPECIFICATION_AT = "subtreeSpecification"; String SUBTREE_SPECIFICATION_AT_OID = "2.5.18.6"; Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java?rev=960682&r1=960681&r2=960682&view=diff ============================================================================== --- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java (original) +++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java Mon Jul 5 20:24:33 2010 @@ -40,7 +40,6 @@ import org.apache.directory.shared.ldap. */ public class TriggerUtils { - public static final String ADMINISTRATIVE_ROLE_ATTR = "administrativeRole"; public static final String TRIGGER_EXECUTION_SPECIFIC_AREA_ATTR_VALUE = "triggerExecutionSpecificArea"; public static final String TRIGGER_EXECUTION_SUBENTRY_OC = "triggerExecutionSubentry"; public static final String ENTRY_TRIGGER_SPECIFICATION_ATTR = "entryTriggerSpecification"; @@ -49,12 +48,12 @@ public class TriggerUtils public static void defineTriggerExecutionSpecificPoint( LdapContext apCtx ) throws NamingException { - Attributes ap = apCtx.getAttributes( "", new String[] { ADMINISTRATIVE_ROLE_ATTR } ); - Attribute administrativeRole = ap.get( ADMINISTRATIVE_ROLE_ATTR ); + Attributes ap = apCtx.getAttributes( "", new String[] { SchemaConstants.ADMINISTRATIVE_ROLE_AT } ); + Attribute administrativeRole = ap.get( SchemaConstants.ADMINISTRATIVE_ROLE_AT ); if ( administrativeRole == null || !AttributeUtils.containsValueCaseIgnore( administrativeRole, TRIGGER_EXECUTION_SPECIFIC_AREA_ATTR_VALUE ) ) { - Attributes changes = new BasicAttributes( ADMINISTRATIVE_ROLE_ATTR, TRIGGER_EXECUTION_SPECIFIC_AREA_ATTR_VALUE, true ); + Attributes changes = new BasicAttributes( SchemaConstants.ADMINISTRATIVE_ROLE_AT, TRIGGER_EXECUTION_SPECIFIC_AREA_ATTR_VALUE, true ); apCtx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, changes ); } }