directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r519685 - in /directory: apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core/op...
Date Sun, 18 Mar 2007 20:22:43 GMT
Author: elecharny
Date: Sun Mar 18 13:22:42 2007
New Revision: 519685

URL: http://svn.apache.org/viewvc?view=rev&rev=519685
Log:
Created OID constants for existing constants
Fixed a bug in a trigger test : a ';' was necessary at the end of the trigger call
Fixed some potential bugs in SchemaService by working with OID instead of names

Modified:
    directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.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/schema/SchemaSubentryModifier.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractBackingStoreTest.java
    directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
    directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
    directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java
    directory/shared/trunk/ldap/src/main/antlr/ACIItem.g
    directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g

Modified: directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java
(original)
+++ directory/apacheds/trunk/constants/src/main/java/org/apache/directory/server/constants/CoreSchemaConstants.java
Sun Mar 18 13:22:42 2007
@@ -31,5 +31,4 @@
     String SCHEMA_NAME = "core";
 
     String OU_AT = "ou";
-    //String ORGANIZATIONAL_UNIT_OC = "organizationalUnit";
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Sun Mar 18 13:22:42 2007
@@ -469,7 +469,7 @@
             attributes.put( "cn", "system administrator" );
             attributes.put( "sn", "administrator" );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
-            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
             attributes.put( "displayName", "Directory Superuser" );
 
             partitionNexus.add(PartitionNexus.getAdminName(),
@@ -496,7 +496,7 @@
 
             attributes.put( "ou", "users" );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
-            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
 
             partitionNexus.add( userDn, attributes );
         }
@@ -520,7 +520,7 @@
 
             attributes.put( "ou", "groups" );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
-            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
 
             partitionNexus.add( groupDn, attributes );
         }
@@ -545,7 +545,7 @@
             attributes.put( "cn", "Administrators" );
             attributes.put( "uniqueMember", PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
-            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
 
             partitionNexus.add(normName, attributes );
             
@@ -589,7 +589,7 @@
 
             attributes.put( "ou", "configuration" );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
-            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
 
             partitionNexus.add( configurationDn, attributes );
         }
@@ -613,7 +613,7 @@
 
             attributes.put( "ou", "partitions" );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
-            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
 
             partitionNexus.add( partitionsDn, attributes );
         }
@@ -637,7 +637,7 @@
 
             attributes.put( "ou", "services" );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
-            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
 
             partitionNexus.add( servicesDn, attributes );
         }
@@ -661,7 +661,7 @@
 
             attributes.put( "ou", "interceptors" );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
-            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
 
             partitionNexus.add( interceptorsDn, attributes );
         }
@@ -686,7 +686,7 @@
             attributes.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.EXTENSIBLE_OBJECT_OC
);
             attributes.put( "prefNodeName", "sysPrefRoot" );
             attributes.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL_NORMALIZED
);
-            attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
 
             partitionNexus.add( sysPrefRootDn, attributes );
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
Sun Mar 18 13:22:42 2007
@@ -154,7 +154,7 @@
         attribute.add( principal );
         entry.put( attribute );
 
-        attribute = new AttributeImpl( "createTimestamp" );
+        attribute = new AttributeImpl( SchemaConstants.CREATE_TIMESTAMP_AT );
         attribute.add( DateUtils.getGeneralizedTime() );
         entry.put( attribute );
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Sun Mar 18 13:22:42 2007
@@ -264,7 +264,7 @@
             objectClassAttr.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
             objectClassAttr.add( SchemaConstants.EXTENSIBLE_OBJECT_OC );
             systemEntry.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL
);
-            systemEntry.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            systemEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
             systemEntry.put( NamespaceTools.getRdnAttribute( PartitionNexus.SYSTEM_PARTITION_SUFFIX
),
                 NamespaceTools.getRdnValue( PartitionNexus.SYSTEM_PARTITION_SUFFIX ) );
             systemCfg.setContextEntry( systemEntry );
@@ -361,7 +361,7 @@
             objectClassAttr.add( SchemaConstants.EXTENSIBLE_OBJECT_OC );
             systemEntry.put( objectClassAttr );
             systemEntry.put( SchemaConstants.CREATORS_NAME_AT, PartitionNexus.ADMIN_PRINCIPAL
);
-            systemEntry.put( "createTimestamp", DateUtils.getGeneralizedTime() );
+            systemEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
             systemEntry.put( NamespaceTools.getRdnAttribute( PartitionNexus.SYSTEM_PARTITION_SUFFIX
),
                 NamespaceTools.getRdnValue( PartitionNexus.SYSTEM_PARTITION_SUFFIX ) );
             systemCfg.setContextEntry( systemEntry );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
Sun Mar 18 13:22:42 2007
@@ -30,6 +30,8 @@
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.codec.LdapConstants;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
@@ -252,7 +254,7 @@
                 ResultCodeEnum.NAMING_VIOLATION );
         }
         
-        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( "attributeTypes" ) )
+        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.ATTRIBUTE_TYPES_AT
) )
         {
             throw new LdapInvalidNameException( 
                 "The parent entry of a attributeType should have a relative name of ou=attributeTypes.",


Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaManager.java
Sun Mar 18 13:22:42 2007
@@ -102,12 +102,12 @@
         "syntaxCheckers",
         SchemaConstants.LDAP_SYNTAXES_AT,
         SchemaConstants.MATCHING_RULES_AT,
-        "attributeTypes",
+        SchemaConstants.ATTRIBUTE_TYPES_AT,
         SchemaConstants.OBJECT_CLASSES_AT,
         SchemaConstants.MATCHING_RULE_USE_AT,
-        "dITStructureRules",
-        "dITContentRules",
-        "nameForms"
+        SchemaConstants.DIT_STRUCTURE_RULES_AT,
+        SchemaConstants.DIT_CONTENT_RULES_AT,
+        SchemaConstants.NAME_FORMS_AT
     };
     private static final String[] metaObjectClasses = new String[] {
         "metaComparator",
@@ -163,11 +163,11 @@
         VALID_OU_VALUES.add( "syntaxes" );
         VALID_OU_VALUES.add( SchemaConstants.MATCHING_RULES_AT );
         VALID_OU_VALUES.add( SchemaConstants.MATCHING_RULE_USE_AT );
-        VALID_OU_VALUES.add( "attributetypes" );
-        VALID_OU_VALUES.add( "objectclasses" );
-        VALID_OU_VALUES.add( "nameforms" );
-        VALID_OU_VALUES.add( "ditcontentrules" );
-        VALID_OU_VALUES.add( "ditstructurerules" );
+        VALID_OU_VALUES.add( SchemaConstants.ATTRIBUTE_TYPES_AT );
+        VALID_OU_VALUES.add( SchemaConstants.OBJECT_CLASSES_AT );
+        VALID_OU_VALUES.add( SchemaConstants.NAME_FORMS_AT );
+        VALID_OU_VALUES.add( SchemaConstants.DIT_CONTENT_RULES_AT );
+        VALID_OU_VALUES.add( SchemaConstants.DIT_STRUCTURE_RULES_AT );
         
         HashSet<String> set = new HashSet<String>();
         set.add( "normalizationService" );

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=519685&r1=519684&r2=519685
==============================================================================
--- 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
Sun Mar 18 13:22:42 2007
@@ -395,15 +395,19 @@
                 continue;
             }
             
-            if ( registries.getAttributeTypeRegistry().hasAttributeType( attribute ) )
+            try
             {
                 String oid = registries.getOidRegistry().getOid( attribute );
-                
+    
                 if ( !filteredAttrs.containsKey( oid ) )
                 {
                     filteredAttrs.put( oid, attribute );
                 }
             }
+            catch ( NamingException ne )
+            {
+                /* Do nothing, the attribute does not exist */
+            }
         }
         
         // If we still have the same attribute number, then we can just get out the method
@@ -478,12 +482,19 @@
                 
                 if ( registries.getObjectClassRegistry().hasObjectClass( objectClass ) )
                 {
-                    objectClassOid = registries.getObjectClassRegistry().lookup( objectClass
).getName();
+                    objectClassOid = registries.getObjectClassRegistry().lookup( objectClass
).getOid();
+                }
+                else
+                {
+                    return new EmptyEnumeration();
                 }
                 
+                String nodeOid = registries.getOidRegistry().getOid( node.getAttribute()
);
+                
                 // see if node attribute is objectClass
-                if ( node.getAttribute().equalsIgnoreCase( "2.5.4.0" )
-                    && ( SchemaConstants.TOP_OC.equalsIgnoreCase( objectClassOid
) || "subschema".equalsIgnoreCase( objectClassOid ) )
+                if ( nodeOid.equals( SchemaConstants.OBJECT_CLASS_AT_OID )
+                    && ( objectClassOid.equals( SchemaConstants.TOP_OC_OID ) || 
+                        objectClassOid.equals( SchemaConstants.SUBSCHEMA_OC_OID ) )
                     && ( node.getAssertionType() == AssertionEnum.EQUALITY ) )
                 {
                     // call.setBypass( true );
@@ -532,16 +543,28 @@
         Set<String> set = new HashSet<String>();
         AttributesImpl attrs = new AttributesImpl();
         AttributeImpl attr;
+        boolean returnAllOperationalAttributes = false;
 
+        // Transform the attributes to their OID counterpart
         for ( String id:ids )
         {
-            set.add( id.toLowerCase() );
+            // Check whether the set contains a plus, and use it below to include all
+            // operational attributes.  Due to RFC 3673, and issue DIREVE-228 in JIRA
+            if ( "+".equals( id ) )
+            {
+                // set.add( "+" );
+                returnAllOperationalAttributes = true;
+            }
+            else if ( "*".equals(  id ) )
+            {
+                set.add( id );
+            }
+            else
+            {
+                set.add( registries.getOidRegistry().getOid( id ) );
+            }
         }
 
-        // Check whether the set contains a plus, and use it below to include all
-        // operational attributes.  Due to RFC 3673, and issue DIREVE-228 in JIRA
-        boolean returnAllOperationalAttributes = set.contains( "+" );
-
         if ( returnAllOperationalAttributes || set.contains( "comparators" ) )
         {
             attr = new AttributeImpl( "comparators" );
@@ -585,7 +608,7 @@
             attrs.put( attr );
         }
 
-        if ( returnAllOperationalAttributes || set.contains( "objectclasses" ) )
+        if ( returnAllOperationalAttributes || set.contains( SchemaConstants.OBJECT_CLASSES_AT_OID
) )
         {
             attr = new AttributeImpl( SchemaConstants.OBJECT_CLASSES_AT );
             Iterator<ObjectClass> list = registries.getObjectClassRegistry().iterator();
@@ -599,9 +622,9 @@
             attrs.put( attr );
         }
 
-        if ( returnAllOperationalAttributes || set.contains( "attributetypes" ) )
+        if ( returnAllOperationalAttributes || set.contains( SchemaConstants.ATTRIBUTE_TYPES_AT
) )
         {
-            attr = new AttributeImpl( "attributeTypes" );
+            attr = new AttributeImpl( SchemaConstants.ATTRIBUTE_TYPES_AT );
             Iterator<AttributeType> list = registries.getAttributeTypeRegistry().iterator();
             
             while ( list.hasNext() )
@@ -655,9 +678,9 @@
             attrs.put( attr );
         }
 
-        if ( returnAllOperationalAttributes || set.contains( "ditcontentrules" ) )
+        if ( returnAllOperationalAttributes || set.contains( SchemaConstants.DIT_CONTENT_RULES_AT
) )
         {
-            attr = new AttributeImpl( "dITContentRules" );
+            attr = new AttributeImpl( SchemaConstants.DIT_CONTENT_RULES_AT );
             Iterator<DITContentRule> list = registries.getDitContentRuleRegistry().iterator();
             
             while ( list.hasNext() )
@@ -669,9 +692,9 @@
             attrs.put( attr );
         }
 
-        if ( returnAllOperationalAttributes || set.contains( "ditstructurerules" ) )
+        if ( returnAllOperationalAttributes || set.contains( SchemaConstants.DIT_STRUCTURE_RULES_AT
) )
         {
-            attr = new AttributeImpl( "dITStructureRules" );
+            attr = new AttributeImpl( SchemaConstants.DIT_STRUCTURE_RULES_AT );
             Iterator list = registries.getDitStructureRuleRegistry().iterator();
             
             while ( list.hasNext() )
@@ -683,9 +706,9 @@
             attrs.put( attr );
         }
 
-        if ( returnAllOperationalAttributes || set.contains( "nameforms" ) )
+        if ( returnAllOperationalAttributes || set.contains( SchemaConstants.NAME_FORMS_AT_OID
) )
         {
-            attr = new AttributeImpl( "nameForms" );
+            attr = new AttributeImpl( SchemaConstants.NAME_FORMS_AT );
             Iterator list = registries.getNameFormRegistry().iterator();
             
             while ( list.hasNext() )
@@ -748,7 +771,7 @@
         
         if ( returnAllOperationalAttributes || set.contains( SchemaConstants.CREATE_TIMESTAMP_AT
) )
         {
-            attr = new AttributeImpl( "createTimestamp" );
+            attr = new AttributeImpl( SchemaConstants.CREATE_TIMESTAMP_AT );
             AttributeType createTimestampAT = registries.
                 getAttributeTypeRegistry().lookup( SchemaConstants.CREATE_TIMESTAMP_AT );
             Attribute createTimestamp = AttributeUtils.getAttribute( modificationAttributes,
createTimestampAT );
@@ -763,7 +786,7 @@
             attrs.put( attr );
         }
         
-        if ( returnAllOperationalAttributes || set.contains( "modifytimestamp" ) )
+        if ( returnAllOperationalAttributes || set.contains( SchemaConstants.MODIFY_TIMESTAMP_AT
) )
         {
             attr = new AttributeImpl( SchemaConstants.MODIFY_TIMESTAMP_AT );
             AttributeType schemaModifyTimestampAT = registries.

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
Sun Mar 18 13:22:42 2007
@@ -99,7 +99,7 @@
         }
         else if ( obj instanceof AttributeType )
         {
-            buf.append( "attributeTypes" );
+            buf.append( SchemaConstants.ATTRIBUTE_TYPES_AT );
         }
         else if ( obj instanceof ObjectClass )
         {
@@ -107,19 +107,19 @@
         }
         else if ( obj instanceof MatchingRuleUse )
         {
-            buf.append( "matchingRuleUses" );
+            buf.append( SchemaConstants.MATCHING_RULE_USE_AT );
         }
         else if ( obj instanceof DITStructureRule )
         {
-            buf.append( "ditStructureRules" );
+            buf.append( SchemaConstants.DIT_STRUCTURE_RULES_AT );
         }
         else if ( obj instanceof DITContentRule )
         {
-            buf.append( "ditContentRules" );
+            buf.append( SchemaConstants.DIT_CONTENT_RULES_AT );
         }
         else if ( obj instanceof NameForm )
         {
-            buf.append( "nameForms" );
+            buf.append( SchemaConstants.NAME_FORMS_AT );
         }
 
         buf.append( ",cn=" ).append( obj.getSchema() ).append( ",ou=schema" );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
Sun Mar 18 13:22:42 2007
@@ -155,12 +155,14 @@
     {
         // only do something if the entry contains prescriptiveTrigger
         Attribute triggerSpec = entry.get( PRESCRIPTIVE_TRIGGER_ATTR );
-        if ( !hasPrescriptiveTrigger( entry ) )
+        
+        if ( triggerSpec == null )
         {
             return;
         }
         
         List subentryTriggerSpecs = new ArrayList();
+        
         for ( int ii = 0; ii < triggerSpec.size(); ii++ )
         {
             TriggerSpecification item = null;
@@ -177,6 +179,7 @@
 
             subentryTriggerSpecs.add( item );
         }
+        
         triggerSpecs.put( normName.toString(), subentryTriggerSpecs );
     }
 

Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractBackingStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractBackingStoreTest.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractBackingStoreTest.java
(original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractBackingStoreTest.java
Sun Mar 18 13:22:42 2007
@@ -59,6 +59,7 @@
 import org.apache.directory.server.schema.bootstrap.CosineSchema;
 import org.apache.directory.server.schema.bootstrap.InetorgpersonSchema;
 import org.apache.directory.server.schema.bootstrap.Krb5kdcSchema;
+import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.bootstrap.SystemSchema;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.ldif.Entry;
@@ -148,7 +149,7 @@
     {
         config = new MutableStartupConfiguration();
 
-        Set schemas = new HashSet();
+        Set<Schema> schemas = new HashSet<Schema>();
         schemas.add( new CoreSchema() );
         schemas.add( new CosineSchema() );
         schemas.add( new ApacheSchema() );
@@ -164,7 +165,7 @@
         
         //config.setBootstrapSchemas( schemas );
 
-        Set partitions = new HashSet();
+        Set<PartitionConfiguration> partitions = new HashSet<PartitionConfiguration>();
         partitions.add( getExamplePartition() );
         partitions.add( getApachePartition() );
 
@@ -179,7 +180,7 @@
         MutablePartitionConfiguration partConfig = new MutablePartitionConfiguration();
         partConfig.setName( "example" );
 
-        HashSet indices = new HashSet();
+        Set<Object> indices = new HashSet<Object>();
         indices.add( "dc" );
         indices.add( "ou" );
         indices.add( SchemaConstants.OBJECT_CLASS_AT );
@@ -191,7 +192,7 @@
 
         AttributesImpl attrs = new AttributesImpl();
         AttributeImpl objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-        objectClass.add( "top" );
+        objectClass.add( SchemaConstants.TOP_OC );
         objectClass.add( "domain" );
         attrs.put( objectClass );
         attrs.put( "dc", "example" );
@@ -206,7 +207,7 @@
         MutablePartitionConfiguration partConfig = new MutablePartitionConfiguration();
         partConfig.setName( "apache" );
 
-        HashSet indices = new HashSet();
+        Set<Object> indices = new HashSet<Object>();
         indices.add( "dc" );
         indices.add( "ou" );
         indices.add( SchemaConstants.OBJECT_CLASS_AT );
@@ -218,7 +219,7 @@
 
         AttributesImpl attrs = new AttributesImpl();
         AttributeImpl objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-        objectClass.add( "top" );
+        objectClass.add( SchemaConstants.TOP_OC );
         objectClass.add( "domain" );
         attrs.put( objectClass );
         attrs.put( "dc", "apache" );

Modified: directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
(original)
+++ directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
Sun Mar 18 13:22:42 2007
@@ -271,7 +271,7 @@
         try
         {
             return root.getAttributes( buf.toString(), new String[]
-                { "createTimestamp" } );
+                { SchemaConstants.CREATE_TIMESTAMP_AT } );
         }
         catch ( NamingException e )
         {
@@ -333,7 +333,7 @@
             Attributes fileEntry = getLdifFileEntry( root, cfg.getLdifDirectory() );
             if ( fileEntry != null )
             {
-                String time = ( String ) fileEntry.get( "createTimestamp" ).get();
+                String time = ( String ) fileEntry.get( SchemaConstants.CREATE_TIMESTAMP_AT
).get();
                 log.info( "Load of LDIF file '" + getCanonical( cfg.getLdifDirectory() )
                     + "' skipped.  It has already been loaded on " + time + "." );
                 return;
@@ -369,7 +369,7 @@
             Attributes fileEntry = getLdifFileEntry( root, ldifFiles[ii] );
             if ( fileEntry != null )
             {
-                String time = ( String ) fileEntry.get( "createTimestamp" ).get();
+                String time = ( String ) fileEntry.get( SchemaConstants.CREATE_TIMESTAMP_AT
).get();
                 log.info( "Load of LDIF file '" + getCanonical( ldifFiles[ii] )
                     + "' skipped.  It has already been loaded on " + time + "." );
                 continue;

Modified: directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
(original)
+++ directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
Sun Mar 18 13:22:42 2007
@@ -87,7 +87,7 @@
         
         // Create the Triger Specification within a Trigger Subentry.
         createTriggerSubentry( ctx, "triggerSubentry1",
-            "AFTER Delete CALL \"" + BackupUtilities.class.getName() + ".backupDeleted\"
( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry )" );
+            "AFTER Delete CALL \"" + BackupUtilities.class.getName() + ".backupDeleted\"
( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry );" );
         
         // Create a test entry which is selected by the Trigger Subentry.
         Attributes testEntry = new AttributesImpl( "ou", "testou", true );

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?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- 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
Sun Mar 18 13:22:42 2007
@@ -29,17 +29,32 @@
  */
 public class SchemaConstants
 {
-    // ObjectClasses
+    // ---- ObjectClasses ----
     public static final String SUBENTRY_OC = "subentry";
+    
+    // top
     public static final String TOP_OC = "top";
+    public static final String TOP_OC_OID = "2.5.6.0";
+    
+    // subschema
+    public static final String SUBSCHEMA_OC = "subschema";
+    public static final String SUBSCHEMA_OC_OID = "2.5.20.1";
+    
     public static final String EXTENSIBLE_OBJECT_OC = "extensibleObject";
     public static final String ORGANIZATIONAL_UNIT_OC = "organizationalUnit";
     
-    // AttributeTypes
+    // ---- AttributeTypes ----
+    // ObjectClass
     public static final String OBJECT_CLASS_AT = "objectClass";
+    public static final String OBJECT_CLASS_AT_OID = "2.5.4.0";
+    
     public static final String CREATORS_NAME_AT = "creatorsName";
     public static final String CREATE_TIMESTAMP_AT = "createTimestamp";
+    
+    // ObjectClasses
     public static final String OBJECT_CLASSES_AT = "objectClasses";
+    public static final String OBJECT_CLASSES_AT_OID = "2.5.21.6";
+
     public static final String MODIFY_TIMESTAMP_AT = "modifyTimestamp";
     public static final String MODIFIERS_NAME_AT = "modifiersName";
     public static final String LDAP_SYNTAXES_AT = "ldapSyntaxes";
@@ -48,5 +63,8 @@
     public static final String MATCHING_RULE_USE_AT = "matchingRuleUse";
     public static final String DIT_STRUCTURE_RULES_AT = "ditStructureRules";
     public static final String DIT_CONTENT_RULES_AT = "ditContentRules";
+    
+    // NameForms
     public static final String NAME_FORMS_AT = "nameForms";
+    public static final String NAME_FORMS_AT_OID = "2.5.21.7";
 }

Modified: directory/shared/trunk/ldap/src/main/antlr/ACIItem.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/ACIItem.g?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/ACIItem.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/ACIItem.g Sun Mar 18 13:22:42 2007
@@ -51,6 +51,7 @@
 import org.apache.directory.shared.ldap.util.NoDuplicateKeysMap;
 import org.apache.directory.shared.ldap.util.OptionalComponentsMonitor;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -1213,7 +1214,7 @@
     :
     ID_item ( SP )* COLON ( SP )* l_oid=oid
     {
-        node = new SimpleNode( "objectClass" , l_oid , AssertionEnum.EQUALITY );
+        node = new SimpleNode( SchemaConstants.OBJECT_CLASS_AT , l_oid , AssertionEnum.EQUALITY
);
     }
     ;
 

Modified: directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g?view=diff&rev=519685&r1=519684&r2=519685
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g Sun Mar 18 13:22:42
2007
@@ -41,6 +41,7 @@
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
 import org.apache.directory.shared.ldap.util.ComponentsMonitor;
 import org.apache.directory.shared.ldap.util.OptionalComponentsMonitor;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -390,7 +391,7 @@
     :
     ID_item ( SP )* COLON ( SP )* l_oid=oid
     {
-        node = new SimpleNode( "objectClass" , l_oid , AssertionEnum.EQUALITY );
+        node = new SimpleNode( SchemaConstants.OBJECT_CLASS_AT , l_oid , AssertionEnum.EQUALITY
);
     }
     ;
 



Mime
View raw message