directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r519079 - in /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core: authz/AuthorizationService.java schema/SchemaService.java subtree/SubentryService.java trigger/TriggerService.java
Date Fri, 16 Mar 2007 18:20:54 GMT
Author: elecharny
Date: Fri Mar 16 11:20:53 2007
New Revision: 519079

URL: http://svn.apache.org/viewvc?view=rev&rev=519079
Log:
Use the shared-ldap-constants project to replace the "subentry" ObjectClass from the code
by a declared constant

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java?view=diff&rev=519079&r1=519078&r2=519079
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
Fri Mar 16 11:20:53 2007
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core.authz;
 
 
+
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.authz.support.ACDFEngine;
@@ -42,6 +43,7 @@
 import org.apache.directory.shared.ldap.aci.ACIItemParser;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
@@ -181,7 +183,7 @@
         
         // look up some constant information
         objectClassOid = oidRegistry.getOid( "objectClass" );
-        subentryOid = oidRegistry.getOid( "subentry" );
+        subentryOid = oidRegistry.getOid( SchemaConstants.SUBENTRY_OC );
         acSubentryOid = oidRegistry.getOid( AC_SUBENTRY_ATTR );
         objectClassType = attrRegistry.lookup( objectClassOid );
         acSubentryType = attrRegistry.lookup( acSubentryOid );
@@ -235,7 +237,8 @@
          * to be in the same naming context as their access point so the subentries
          * effecting their parent entry applies to them as well.
          */
-        if ( AttributeUtils.containsValue( oc, "subentry", objectClassType ) || oc.contains(
subentryOid ) )
+        if ( AttributeUtils.containsValue( oc, SchemaConstants.SUBENTRY_OC, objectClassType
) || 
+             AttributeUtils.containsValue( oc, subentryOid, objectClassType ) )
         {
             LdapDN parentDn = ( LdapDN ) dn.clone();
             parentDn.remove( dn.size() - 1 );
@@ -305,7 +308,7 @@
         throws NamingException
     {
         // only perform this for subentries
-        if ( !entry.get( "objectClass" ).contains( "subentry" ) )
+        if ( !entry.get( "objectClass" ).contains( SchemaConstants.SUBENTRY_OC ) )
         {
             return;
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=519079&r1=519078&r2=519079
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Fri Mar 16 11:20:53 2007
@@ -55,6 +55,7 @@
 import org.apache.directory.server.schema.registries.ObjectClassRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeIdentifierException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
@@ -726,7 +727,7 @@
             attr = new AttributeImpl( "objectClass" );
             attr.add( "top" );
             attr.add( "subschema" );
-            attr.add( "subentry" );
+            attr.add( SchemaConstants.SUBENTRY_OC );
             attr.add( "apacheSubschema" );
             attrs.put( attr );
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?view=diff&rev=519079&r1=519078&r2=519079
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
Fri Mar 16 11:20:53 2007
@@ -37,6 +37,7 @@
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
@@ -82,8 +83,6 @@
 {
     /** the subentry control OID */
     private static final String SUBENTRY_CONTROL = SubentriesControl.CONTROL_OID;
-    /** the objectClass value for a subentry */
-    private static final String SUBENTRY_OBJECTCLASS = "subentry";
     /** the objectClass OID for a subentry */
     private static final String SUBENTRY_OBJECTCLASS_OID = "2.5.17.0";
 
@@ -142,7 +141,7 @@
 
         // prepare to find all subentries in all namingContexts
         Iterator suffixes = this.nexus.listSuffixes();
-        ExprNode filter = new SimpleNode( "objectclass", "subentry", AssertionEnum.EQUALITY
);
+        ExprNode filter = new SimpleNode( "objectclass", SchemaConstants.SUBENTRY_OC, AssertionEnum.EQUALITY
);
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         controls.setReturningAttributes( new String[] { "subtreeSpecification", "objectClass"
} );
@@ -373,7 +372,7 @@
     {
         Attribute objectClasses = entry.get( "objectClass" );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, "subentry" ) )
+        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) )
         {
             // get the name of the administrative point and its administrativeRole attributes
             LdapDN apName = ( LdapDN ) normName.clone();
@@ -528,7 +527,7 @@
         Attributes entry = nexus.lookup( name );
         Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, "subentry" ) )
+        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) )
         {
             SubtreeSpecification ss = subentryCache.removeSubentry( name.toNormName() ).getSubtreeSpecification();
             next.delete( name );
@@ -680,7 +679,7 @@
         Attributes entry = nexus.lookup( name );
         Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, "subentry" ) )
+        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) )
         {
             Subentry subentry = subentryCache.getSubentry( name.toNormName() );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
@@ -751,7 +750,7 @@
         Attributes entry = nexus.lookup( oriChildName );
         Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, "subentry" ) )
+        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) )
         {
             Subentry subentry = subentryCache.getSubentry( oriChildName.toNormName() );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
@@ -822,7 +821,7 @@
         Attributes entry = nexus.lookup( oriChildName );
         Attribute objectClasses = entry.get( "objectClass" );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, "subentry" ) )
+        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) )
         {
             Subentry subentry = subentryCache.getSubentry( oriChildName.toString() );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
@@ -966,7 +965,7 @@
         Attributes oldEntry = (Attributes) entry.clone();
         Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, "subentry" )  &&
mods.get( "subtreeSpecification" ) != null )
+        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
)  && mods.get( "subtreeSpecification" ) != null )
         {
             SubtreeSpecification ssOld = subentryCache.removeSubentry( name.toNormName()
).getSubtreeSpecification();
             SubtreeSpecification ssNew;
@@ -1032,7 +1031,7 @@
         {
             next.modify( name, modOp, mods );
             
-            if ( !AttributeUtils.containsValueCaseIgnore( objectClasses, "subentry" ) )
+            if ( !AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) )
             {
 	            Attributes newEntry = nexus.lookup( name );
 	            
@@ -1063,7 +1062,7 @@
             }
         }
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, "subentry" ) &&
isSubtreeSpecificationModification )
+        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) && isSubtreeSpecificationModification )
         {
             SubtreeSpecification ssOld = subentryCache.removeSubentry( name.toString() ).getSubtreeSpecification();
             SubtreeSpecification ssNew;
@@ -1129,7 +1128,7 @@
         {
             next.modify( name, mods );
             
-            if ( !AttributeUtils.containsValueCaseIgnore( objectClasses, "subentry" ) )
+            if ( !AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) )
             {
 	            Attributes newEntry = nexus.lookup( name );
 	            
@@ -1392,7 +1391,7 @@
             Attribute objectClasses = result.getAttributes().get( "objectClass" );
             if ( objectClasses != null )
             {
-                if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SUBENTRY_OBJECTCLASS
) )
+                if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) )
                 {
                     return false;
                 }
@@ -1405,7 +1404,7 @@
                 for ( int ii = 0; ii < objectClasses.size(); ii++ )
                 {
                     String oc = ( String ) objectClasses.get( ii );
-                    if ( oc.equalsIgnoreCase( SUBENTRY_OBJECTCLASS ) )
+                    if ( oc.equalsIgnoreCase( SchemaConstants.SUBENTRY_OC ) )
                     {
                         return false;
                     }
@@ -1453,7 +1452,7 @@
             Attribute objectClasses = result.getAttributes().get( "objectClass" );
             if ( objectClasses != null )
             {
-                if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SUBENTRY_OBJECTCLASS
) )
+                if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC
) )
                 {
                     return true;
                 }
@@ -1466,7 +1465,7 @@
                 for ( int ii = 0; ii < objectClasses.size(); ii++ )
                 {
                     String oc = ( String ) objectClasses.get( ii );
-                    if ( oc.equalsIgnoreCase( SUBENTRY_OBJECTCLASS ) )
+                    if ( oc.equalsIgnoreCase( SchemaConstants.SUBENTRY_OC ) )
                     {
                         return true;
                     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java?view=diff&rev=519079&r1=519078&r2=519079
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
Fri Mar 16 11:20:53 2007
@@ -47,6 +47,7 @@
 import org.apache.directory.server.core.sp.LdapClassLoader;
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -124,7 +125,7 @@
          * to be in the same naming context as their access point so the subentries
          * effecting their parent entry applies to them as well.
          */
-        if ( entry.get( "objectClass" ).contains( "subentry" ) )
+        if ( entry.get( "objectClass" ).contains( SchemaConstants.SUBENTRY_OC ) )
         {
             LdapDN parentDn = ( LdapDN ) dn.clone();
             parentDn.remove( dn.size() - 1 );



Mime
View raw message