You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/10/22 22:18:03 UTC
svn commit: rev 55327 - in incubator/directory/eve/trunk/backend/core/src: java/org/apache/eve/schema/bootstrap test/org/apache/eve/schema/bootstrap
Author: akarasulu
Date: Fri Oct 22 13:18:02 2004
New Revision: 55327
Added:
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/InetorgpersonComparatorProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/InetorgpersonMatchingRuleProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/InetorgpersonNormalizerProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisComparatorProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisMatchingRuleProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisNormalizerProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisSyntaxCheckerProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisSyntaxProducer.java
Modified:
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/AbstractBootstrapProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapAttributeTypeRegistry.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapComparatorRegistry.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapMatchingRuleRegistry.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapObjectClassRegistry.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapOidRegistry.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapRegistries.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapSyntaxRegistry.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemComparatorProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemMatchingRuleProducer.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemNormalizerProducer.java
incubator/directory/eve/trunk/backend/core/src/test/org/apache/eve/schema/bootstrap/BootstrapSchemaLoaderTest.java
Log:
Commit changes ...
o added new comparators, normalizers and more to nis, inetorperson and
system schemas
o fixed null pointers in OidRegistry
o made attribute check superior classes for information such as syntax
and matchingRules
o added code to test referencial integrity in test cases and the BSLoader
Notes ...
o we still have resolution issues somewhere
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/AbstractBootstrapProducer.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/AbstractBootstrapProducer.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/AbstractBootstrapProducer.java Fri Oct 22 13:18:02 2004
@@ -219,6 +219,11 @@
public AttributeType getSuperior() throws NamingException
{
+ if ( superiorId == null )
+ {
+ return null;
+ }
+
return this.attributeTypeRegistry.lookup( superiorId );
}
@@ -229,7 +234,17 @@
public MatchingRule getEquality() throws NamingException
{
- return this.matchingRuleRegistry.lookup( equalityId );
+ if ( equalityId != null )
+ {
+ return this.matchingRuleRegistry.lookup( equalityId );
+ }
+
+ if ( superiorId != null )
+ {
+ return getSuperior().getEquality();
+ }
+
+ return null;
}
public void setEqualityId( String equalityId )
@@ -239,7 +254,17 @@
public MatchingRule getSubstr() throws NamingException
{
- return this.matchingRuleRegistry.lookup( substrId ) ;
+ if ( substrId != null )
+ {
+ return this.matchingRuleRegistry.lookup( substrId );
+ }
+
+ if ( superiorId != null )
+ {
+ return getSuperior().getSubstr();
+ }
+
+ return null;
}
public void setSubstrId( String substrId )
@@ -249,7 +274,17 @@
public MatchingRule getOrdering() throws NamingException
{
- return this.matchingRuleRegistry.lookup( orderingId );
+ if ( orderingId != null )
+ {
+ return this.matchingRuleRegistry.lookup( orderingId );
+ }
+
+ if ( superiorId != null )
+ {
+ return getSuperior().getOrdering();
+ }
+
+ return null;
}
public void setOrderingId( String orderingId )
@@ -264,7 +299,17 @@
public Syntax getSyntax() throws NamingException
{
- return this.syntaxRegistry.lookup( syntaxId );
+ if ( syntaxId != null )
+ {
+ return this.syntaxRegistry.lookup( syntaxId );
+ }
+
+ if ( superiorId != null )
+ {
+ return getSuperior().getSyntax();
+ }
+
+ return null;
}
public void setSingleValue( boolean singleValue )
@@ -285,6 +330,11 @@
public void setObsolete( boolean obsolete )
{
super.setObsolete( obsolete );
+ }
+
+ public void setDescription( String description )
+ {
+ super.setDescription( description );
}
public void setUsage( UsageEnum usage )
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapAttributeTypeRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapAttributeTypeRegistry.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapAttributeTypeRegistry.java Fri Oct 22 13:18:02 2004
@@ -25,6 +25,7 @@
import java.util.Map;
import java.util.HashMap;
+import java.util.Iterator;
import javax.naming.NamingException;
@@ -147,5 +148,12 @@
throw new NamingException( "OID " + id + " not found in oid to " +
"schema name map!" );
+ }
+
+
+
+ Iterator list()
+ {
+ return byOid.values().iterator();
}
}
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapComparatorRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapComparatorRegistry.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapComparatorRegistry.java Fri Oct 22 13:18:02 2004
@@ -94,7 +94,7 @@
public Comparator lookup( String oid ) throws NamingException
{
- if ( ! comparators.containsKey( oid ) )
+ if ( comparators.containsKey( oid ) )
{
Comparator c = ( Comparator ) comparators.get( oid );
monitor.lookedUp( oid, c );
@@ -102,7 +102,7 @@
}
- NamingException e = new NamingException( "Comparator not found for OID" );
+ NamingException e = new NamingException( "Comparator not found for OID: " + oid );
monitor.lookupFailed( oid, e );
throw e;
}
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapMatchingRuleRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapMatchingRuleRegistry.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapMatchingRuleRegistry.java Fri Oct 22 13:18:02 2004
@@ -25,6 +25,7 @@
import java.util.Map;
import java.util.HashMap;
+import java.util.Iterator;
import javax.naming.NamingException;
@@ -105,7 +106,13 @@
}
oidToSchema.put( matchingRule.getOid(), schema );
- oidRegistry.register( matchingRule.getName(), matchingRule.getOid() );
+
+ String[] names = matchingRule.getNames();
+ for ( int ii = 0; ii < names.length; ii++ )
+ {
+ oidRegistry.register( names[ii], matchingRule.getOid() );
+ }
+
byOid.put( matchingRule.getOid(), matchingRule );
monitor.registered( matchingRule );
}
@@ -169,5 +176,11 @@
void setMonitor( MatchingRuleRegistryMonitor monitor )
{
this.monitor = monitor;
+ }
+
+
+ Iterator list()
+ {
+ return byOid.values().iterator();
}
}
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapObjectClassRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapObjectClassRegistry.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapObjectClassRegistry.java Fri Oct 22 13:18:02 2004
@@ -19,6 +19,7 @@
import java.util.Map;
import java.util.HashMap;
+import java.util.Iterator;
import javax.naming.NamingException;
import org.apache.ldap.common.schema.ObjectClass;
@@ -142,5 +143,16 @@
throw new NamingException( "OID " + id + " not found in oid to " +
"schema name map!" );
+ }
+
+
+ /**
+ * Open up a back door for some tests.
+ *
+ * @return an iteration over the set of ObjectClasses within this registry.
+ */
+ Iterator list()
+ {
+ return byOid.values().iterator();
}
}
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapOidRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapOidRegistry.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapOidRegistry.java Fri Oct 22 13:18:02 2004
@@ -52,6 +52,10 @@
*/
public String getOid( String name ) throws NamingException
{
+ if ( name == null )
+ {
+ throw new NamingException( "name should not be null" );
+ }
/* If name is an OID than we return it back since inherently the
* OID is another name for the object referred to by OID and the
* caller does not know that the argument is an OID String.
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapRegistries.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapRegistries.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapRegistries.java Fri Oct 22 13:18:02 2004
@@ -17,7 +17,17 @@
package org.apache.eve.schema.bootstrap;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.naming.NamingException;
+
import org.apache.eve.schema.*;
+import org.apache.ldap.common.schema.ObjectClass;
+import org.apache.ldap.common.schema.Syntax;
+import org.apache.ldap.common.schema.MatchingRule;
+import org.apache.ldap.common.schema.AttributeType;
/**
@@ -28,18 +38,18 @@
*/
public class BootstrapRegistries
{
- private AttributeTypeRegistry attributeTypeRegistry;
- private ComparatorRegistry comparatorRegistry;
- private DITContentRuleRegistry ditContentRuleRegistry;
- private DITStructureRuleRegistry ditStructureRuleRegistry;
- private MatchingRuleRegistry matchingRuleRegistry;
- private MatchingRuleUseRegistry matchingRuleUseRegistry;
- private NameFormRegistry nameFormRegistry;
- private NormalizerRegistry normalizerRegistry;
- private ObjectClassRegistry objectClassRegistry;
- private OidRegistry oidRegistry;
- private SyntaxCheckerRegistry syntaxCheckerRegistry;
- private SyntaxRegistry syntaxRegistry;
+ private BootstrapAttributeTypeRegistry attributeTypeRegistry;
+ private BootstrapComparatorRegistry comparatorRegistry;
+ private BootstrapDitContentRuleRegistry ditContentRuleRegistry;
+ private BootstrapDitStructureRuleRegistry ditStructureRuleRegistry;
+ private BootstrapMatchingRuleRegistry matchingRuleRegistry;
+ private BootstrapMatchingRuleUseRegistry matchingRuleUseRegistry;
+ private BootstrapNameFormRegistry nameFormRegistry;
+ private BootstrapNormalizerRegistry normalizerRegistry;
+ private BootstrapObjectClassRegistry objectClassRegistry;
+ private BootstrapOidRegistry oidRegistry;
+ private BootstrapSyntaxCheckerRegistry syntaxCheckerRegistry;
+ private BootstrapSyntaxRegistry syntaxRegistry;
public BootstrapRegistries()
@@ -117,5 +127,303 @@
public SyntaxRegistry getSyntaxRegistry()
{
return syntaxRegistry;
+ }
+
+
+ // ------------------------------------------------------------------------
+ // Code used to sanity check the resolution of entities in registries
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * Attempts to resolve the dependent schema objects of all entities that
+ * refer to other objects within the registries. Null references will be
+ * handed appropriately.
+ *
+ * @return a list of exceptions encountered while resolving entities
+ */
+ public List checkRefInteg()
+ {
+ ArrayList errors = new ArrayList();
+
+ Iterator list = objectClassRegistry.list();
+ while ( list.hasNext() )
+ {
+ ObjectClass oc = ( ObjectClass ) list.next();
+ resolve( oc, errors );
+ }
+
+ list = attributeTypeRegistry.list();
+ while ( list.hasNext() )
+ {
+ AttributeType at = ( AttributeType ) list.next();
+ resolve( at, errors );
+ }
+
+ list = matchingRuleRegistry.list();
+ while ( list.hasNext() )
+ {
+ MatchingRule mr = ( MatchingRule ) list.next();
+ resolve( mr, errors );
+ }
+
+ list = syntaxRegistry.list();
+ while ( list.hasNext() )
+ {
+ Syntax syntax = ( Syntax ) list.next();
+ resolve( syntax, errors );
+ }
+
+ return errors;
+ }
+
+
+ /**
+ * Attempts to resolve the SyntaxChecker associated with a Syntax.
+ *
+ * @param syntax the Syntax to resolve the SyntaxChecker of
+ * @param errors the list of errors to add exceptions to
+ * @return true if it succeeds, false otherwise
+ */
+ private boolean resolve( Syntax syntax, List errors )
+ {
+ if ( syntax == null )
+ {
+ return true;
+ }
+
+ try
+ {
+ syntax.getSyntaxChecker();
+ return true;
+ }
+ catch ( NamingException e )
+ {
+ errors.add( e );
+ return false;
+ }
+ }
+
+
+ private boolean resolve( MatchingRule mr, List errors )
+ {
+ boolean isSuccess = true;
+
+ if ( mr == null )
+ {
+ return true;
+ }
+
+ try
+ {
+ if ( mr.getComparator() == null )
+ {
+ errors.add( new NullPointerException( "matchingRule "
+ + mr.getName() + " with OID " + mr.getOid()
+ + " has a null comparator" ) );
+ isSuccess = false;
+ }
+ }
+ catch ( NamingException e )
+ {
+ errors.add( e );
+ isSuccess = false;
+ }
+
+ try
+ {
+ if ( mr.getNormalizer() == null )
+ {
+ errors.add( new NullPointerException( "matchingRule "
+ + mr.getName() + " with OID " + mr.getOid()
+ + " has a null normalizer" ) );
+ isSuccess = false;
+ }
+ }
+ catch ( NamingException e )
+ {
+ errors.add( e );
+ isSuccess = false;
+ }
+
+ try
+ {
+ isSuccess &= resolve( mr.getSyntax(), errors );
+
+ if ( mr.getSyntax() == null )
+ {
+ errors.add( new NullPointerException( "matchingRule "
+ + mr.getName() + " with OID " + mr.getOid()
+ + " has a null Syntax" ) );
+ isSuccess = false;
+ }
+ }
+ catch ( NamingException e )
+ {
+ errors.add( e );
+ isSuccess = false;
+ }
+
+ return isSuccess;
+ }
+
+
+ private boolean resolve( AttributeType at, List errors )
+ {
+ boolean isSuccess = true;
+ boolean hasMatchingRule = false;
+
+ if ( at == null )
+ {
+ return true;
+ }
+
+ try
+ {
+ isSuccess &= resolve( at.getSuperior(), errors );
+ }
+ catch ( NamingException e )
+ {
+ errors.add( e );
+ isSuccess = false;
+ }
+
+ try
+ {
+ isSuccess &= resolve( at.getEquality(), errors );
+
+ if ( at.getEquality() != null )
+ {
+ hasMatchingRule |= true;
+ }
+ }
+ catch ( NamingException e )
+ {
+ errors.add( e );
+ isSuccess = false;
+ }
+
+ try
+ {
+ isSuccess &= resolve( at.getOrdering(), errors );
+
+ if ( at.getOrdering() != null )
+ {
+ hasMatchingRule |= true;
+ }
+ }
+ catch ( NamingException e )
+ {
+ errors.add( e );
+ isSuccess = false;
+ }
+
+ try
+ {
+ isSuccess &= resolve( at.getSubstr(), errors );
+
+ if ( at.getSubstr() != null )
+ {
+ hasMatchingRule |= true;
+ }
+ }
+ catch ( NamingException e )
+ {
+ errors.add( e );
+ isSuccess = false;
+ }
+
+ try
+ {
+ isSuccess &= resolve( at.getSyntax(), errors );
+
+ if ( at.getSyntax() == null )
+ {
+ errors.add( new NullPointerException( "attributeType "
+ + at.getName() + " with OID " + at.getOid()
+ + " has a null Syntax" ) );
+ isSuccess = false;
+ }
+ }
+ catch ( NamingException e )
+ {
+ errors.add( e );
+ isSuccess = false;
+ }
+
+ if ( ! hasMatchingRule )
+ {
+ errors.add( new NullPointerException( "attributeType "
+ + at.getName() + " with OID " + at.getOid()
+ + " has a no matchingRules defined" ) );
+ isSuccess = false;
+ }
+
+ return isSuccess;
+ }
+
+
+ private boolean resolve( ObjectClass oc, List errors )
+ {
+ boolean isSuccess = true;
+
+ if ( oc == null )
+ {
+ return true;
+ }
+
+ ObjectClass[] superiors = new org.apache.ldap.common.schema.ObjectClass[0];
+ try
+ {
+ superiors = oc.getSuperClasses();
+ }
+ catch ( NamingException e )
+ {
+ superiors = new ObjectClass[0];
+ isSuccess = false;
+ errors.add( e );
+ }
+
+ for ( int ii = 0; ii < superiors.length; ii++ )
+ {
+ isSuccess &= resolve( superiors[ii], errors ) ;
+ }
+
+ AttributeType[] mayList = new org.apache.ldap.common.schema.AttributeType[0];
+ try
+ {
+ mayList = oc.getMayList();
+ }
+ catch ( NamingException e )
+ {
+ mayList = new AttributeType[0];
+ isSuccess = false;
+ errors.add( e );
+ }
+
+ for ( int ii = 0; ii < mayList.length; ii++ )
+ {
+ isSuccess &= resolve( mayList[ii], errors ) ;
+ }
+
+
+ AttributeType[] mustList = new org.apache.ldap.common.schema.AttributeType[0];
+ try
+ {
+ mustList = oc.getMustList();
+ }
+ catch ( NamingException e )
+ {
+ mustList = new AttributeType[0];
+ isSuccess = false;
+ errors.add( e );
+ }
+
+ for ( int ii = 0; ii < mustList.length; ii++ )
+ {
+ isSuccess &= resolve( mustList[ii], errors ) ;
+ }
+
+ return isSuccess;
}
}
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapSyntaxRegistry.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapSyntaxRegistry.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/BootstrapSyntaxRegistry.java Fri Oct 22 13:18:02 2004
@@ -25,6 +25,7 @@
import java.util.Map;
import java.util.HashMap;
+import java.util.Iterator;
import javax.naming.NamingException;
@@ -168,5 +169,11 @@
void setMonitor( SyntaxRegistryMonitor monitor )
{
this.monitor = monitor;
+ }
+
+
+ Iterator list()
+ {
+ return byOid.values().iterator();
}
}
Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/InetorgpersonComparatorProducer.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/InetorgpersonComparatorProducer.java Fri Oct 22 13:18:02 2004
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.eve.schema.bootstrap;
+
+
+import java.util.Comparator;
+import javax.naming.NamingException;
+
+import org.apache.ldap.common.schema.*;
+
+
+
+/**
+ * A producer of Comparator objects for the inetorgperson schema. This code has been
+ * automatically generated using schema files in the OpenLDAP format along with
+ * the eve schema plugin for maven. This has been done to facilitate
+ * Eve<->OpenLDAP schema interoperability.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class InetorgpersonComparatorProducer extends AbstractBootstrapProducer
+{
+ public InetorgpersonComparatorProducer()
+ {
+ super( ProducerTypeEnum.COMPARATOR_PRODUCER );
+ }
+
+
+ // ------------------------------------------------------------------------
+ // BootstrapProducer Methods
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+ */
+ public void produce( BootstrapRegistries registries, ProducerCallback cb )
+ throws NamingException
+ {
+
+ Comparator comparator;
+
+ /*
+ * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.3
+ * =========================================================
+
+ ( 2.5.13.5 NAME 'caseExactMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+ ( 2.5.13.7 NAME 'caseExactSubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+
+ ( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+
+ */
+
+ comparator = new NormalizingComparator(
+ new CachingNormalizer( new DeepTrimNormalizer() ),
+ new ComparableComparator() );
+ cb.schemaObjectProduced( this, "2.5.13.5", comparator );
+
+ comparator = new NormalizingComparator(
+ new CachingNormalizer( new DeepTrimNormalizer() ),
+ new ComparableComparator() );
+ cb.schemaObjectProduced( this, "2.5.13.7", comparator );
+
+ comparator = new NormalizingComparator(
+ new CachingNormalizer( new DeepTrimToLowerNormalizer() ),
+ new ComparableComparator() );
+ cb.schemaObjectProduced( this, "2.5.13.12", comparator );
+
+ /*
+ * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.4
+ * =========================================================
+
+ ( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+ */
+
+ comparator = new NormalizingComparator(
+ new CachingNormalizer( new DeepTrimToLowerNormalizer() ),
+ new ComparableComparator() );
+ cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.109.114.3", comparator );
+ }
+}
Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/InetorgpersonMatchingRuleProducer.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/InetorgpersonMatchingRuleProducer.java Fri Oct 22 13:18:02 2004
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.eve.schema.bootstrap;
+
+
+import javax.naming.NamingException;
+
+
+
+/**
+ * A producer of MatchingRule objects for the inetorgperson schema. This code has been
+ * automatically generated using schema files in the OpenLDAP format along with
+ * the eve schema plugin for maven. This has been done to facilitate
+ * Eve<->OpenLDAP schema interoperability.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class InetorgpersonMatchingRuleProducer extends AbstractBootstrapProducer
+{
+ public InetorgpersonMatchingRuleProducer()
+ {
+ super( ProducerTypeEnum.MATCHING_RULE_PRODUCER );
+ }
+
+
+ // ------------------------------------------------------------------------
+ // BootstrapProducer Methods
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+ */
+ public void produce( BootstrapRegistries registries, ProducerCallback cb )
+ throws NamingException
+ {
+ BootstrapMatchingRule mrule = null;
+
+ /*
+ * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.3
+ * =========================================================
+
+ ( 2.5.13.5 NAME 'caseExactMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+ ( 2.5.13.7 NAME 'caseExactSubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+
+ ( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+ */
+
+ mrule = new BootstrapMatchingRule( "2.5.13.5", registries );
+ mrule.setNames( new String[] { "caseExactMatch" } );
+ mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.15" );
+ cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+ mrule = new BootstrapMatchingRule( "2.5.13.7", registries );
+ mrule.setNames( new String[] { "caseExactSubstringsMatch" } );
+ mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.58" );
+ cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+ mrule = new BootstrapMatchingRule( "2.5.13.12", registries );
+ mrule.setNames( new String[] { "caseIgnoreListSubstringsMatch" } );
+ mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.58" );
+ cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+ /*
+ * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.4
+ * =========================================================
+
+ ( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+ */
+
+ mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.1466.109.114.3", registries );
+ mrule.setNames( new String[] { "caseIgnoreIA5SubstringsMatch" } );
+ mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.58" );
+ cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+ }
+}
Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/InetorgpersonNormalizerProducer.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/InetorgpersonNormalizerProducer.java Fri Oct 22 13:18:02 2004
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.eve.schema.bootstrap;
+
+
+import javax.naming.NamingException;
+
+import org.apache.ldap.common.schema.*;
+
+
+
+/**
+ * A producer of Normalizer objects for the inetorgperson schema. This code has been
+ * automatically generated using schema files in the OpenLDAP format along with
+ * the eve schema plugin for maven. This has been done to facilitate
+ * Eve<->OpenLDAP schema interoperability.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class InetorgpersonNormalizerProducer extends AbstractBootstrapProducer
+{
+ public InetorgpersonNormalizerProducer()
+ {
+ super( ProducerTypeEnum.NORMALIZER_PRODUCER );
+ }
+
+
+ // ------------------------------------------------------------------------
+ // BootstrapProducer Methods
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+ */
+ public void produce( BootstrapRegistries registries, ProducerCallback cb )
+ throws NamingException
+ {
+ /*
+ * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.3
+ * =========================================================
+
+ ( 2.5.13.5 NAME 'caseExactMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+ ( 2.5.13.7 NAME 'caseExactSubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+
+ ( 2.5.13.12 NAME 'caseIgnoreListSubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+ */
+
+ Normalizer normalizer;
+
+ normalizer = new CachingNormalizer( new DeepTrimNormalizer() );
+ cb.schemaObjectProduced( this, "2.5.13.5", normalizer );
+
+ normalizer = new CachingNormalizer( new DeepTrimNormalizer() );
+ cb.schemaObjectProduced( this, "2.5.13.7", normalizer );
+
+ normalizer = new CachingNormalizer( new DeepTrimToLowerNormalizer() );
+ cb.schemaObjectProduced( this, "2.5.13.12", normalizer );
+
+ /*
+ * Straight out of RFC 2798 for InetOrgPerson: Section 9.3.4
+ * =========================================================
+
+ ( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.58 )
+ */
+
+ normalizer = new CachingNormalizer( new DeepTrimToLowerNormalizer() );
+ cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.109.114.3", normalizer );
+
+ }
+}
Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisComparatorProducer.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisComparatorProducer.java Fri Oct 22 13:18:02 2004
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.eve.schema.bootstrap;
+
+
+import java.util.Comparator;
+import javax.naming.NamingException;
+
+import org.apache.ldap.common.schema.NormalizingComparator;
+import org.apache.ldap.common.schema.CachingNormalizer;
+import org.apache.ldap.common.schema.DeepTrimNormalizer;
+import org.apache.ldap.common.schema.ComparableComparator;
+
+
+
+/**
+ * A producer of Comparator objects for the nis schema. This code has been
+ * automatically generated using schema files in the OpenLDAP format along with
+ * the eve schema plugin for maven. This has been done to facilitate
+ * Eve<->OpenLDAP schema interoperability.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class NisComparatorProducer extends AbstractBootstrapProducer
+{
+ public NisComparatorProducer()
+ {
+ super( ProducerTypeEnum.COMPARATOR_PRODUCER );
+ }
+
+
+ // ------------------------------------------------------------------------
+ // BootstrapProducer Methods
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+ */
+ public void produce( BootstrapRegistries registries, ProducerCallback cb )
+ throws NamingException
+ {
+ Comparator comparator;
+
+ /* Really an openLDAP matching rule but its used in he nis so its here
+ *
+ ( 1.3.6.1.4.1.4203.1.2.1 NAME 'caseExactIA5SubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+ */
+ comparator = new NormalizingComparator(
+ new CachingNormalizer( new DeepTrimNormalizer() ),
+ new ComparableComparator() );
+ cb.schemaObjectProduced( this, "1.3.6.1.4.1.4203.1.2.1", comparator );
+ }
+}
Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisMatchingRuleProducer.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisMatchingRuleProducer.java Fri Oct 22 13:18:02 2004
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.eve.schema.bootstrap;
+
+
+import javax.naming.NamingException;
+
+
+/**
+ * A producer of MatchingRule objects for the nis schema. This code has been
+ * automatically generated using schema files in the OpenLDAP format along with
+ * the eve schema plugin for maven. This has been done to facilitate
+ * Eve<->OpenLDAP schema interoperability.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class NisMatchingRuleProducer extends AbstractBootstrapProducer
+{
+ public NisMatchingRuleProducer()
+ {
+ super( ProducerTypeEnum.MATCHING_RULE_PRODUCER );
+ }
+
+
+ // ------------------------------------------------------------------------
+ // BootstrapProducer Methods
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+ */
+ public void produce( BootstrapRegistries registries, ProducerCallback cb )
+ throws NamingException
+ {
+ BootstrapMatchingRule mrule;
+
+ /* Really an openLDAP matching rule but its used in he nis so its here
+ *
+ ( 1.3.6.1.4.1.4203.1.2.1 NAME 'caseExactIA5SubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+ */
+
+ mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.4203.1.2.1", registries );
+ mrule.setNames( new String[] { "caseExactIA5SubstringsMatch" } );
+ mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+ cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+ }
+}
Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisNormalizerProducer.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisNormalizerProducer.java Fri Oct 22 13:18:02 2004
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.eve.schema.bootstrap;
+
+
+import javax.naming.NamingException;
+
+import org.apache.ldap.common.schema.CachingNormalizer;
+import org.apache.ldap.common.schema.DeepTrimNormalizer;
+import org.apache.ldap.common.schema.Normalizer;
+
+
+
+/**
+ * A producer of Normalizer objects for the nis schema. This code has been
+ * automatically generated using schema files in the OpenLDAP format along with
+ * the eve schema plugin for maven. This has been done to facilitate
+ * Eve<->OpenLDAP schema interoperability.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class NisNormalizerProducer extends AbstractBootstrapProducer
+{
+ public NisNormalizerProducer()
+ {
+ super( ProducerTypeEnum.NORMALIZER_PRODUCER );
+ }
+
+
+ // ------------------------------------------------------------------------
+ // BootstrapProducer Methods
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+ */
+ public void produce( BootstrapRegistries registries, ProducerCallback cb )
+ throws NamingException
+ {
+ Normalizer normalizer;
+
+ /* Really an openLDAP matching rule but its used in he nis so its here
+ *
+ ( 1.3.6.1.4.1.4203.1.2.1 NAME 'caseExactIA5SubstringsMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+ */
+ normalizer = new CachingNormalizer( new DeepTrimNormalizer() );
+ cb.schemaObjectProduced( this, "1.3.6.1.4.1.4203.1.2.1", normalizer );
+
+ }
+}
Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisSyntaxCheckerProducer.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisSyntaxCheckerProducer.java Fri Oct 22 13:18:02 2004
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.eve.schema.bootstrap;
+
+
+import javax.naming.NamingException;
+
+import org.apache.ldap.common.schema.SyntaxChecker;
+import org.apache.ldap.common.schema.AcceptAllSyntaxChecker;
+
+
+
+/**
+ * A producer of SyntaxChecker objects for the nis schema. This code has been
+ * automatically generated using schema files in the OpenLDAP format along with
+ * the eve schema plugin for maven. This has been done to facilitate
+ * Eve<->OpenLDAP schema interoperability.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class NisSyntaxCheckerProducer extends AbstractBootstrapProducer
+{
+ public NisSyntaxCheckerProducer()
+ {
+ super( ProducerTypeEnum.SYNTAX_CHECKER_PRODUCER );
+ }
+
+
+ // ------------------------------------------------------------------------
+ // BootstrapProducer Methods
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+ */
+ public void produce( BootstrapRegistries registries, ProducerCallback cb )
+ throws NamingException
+ {
+ SyntaxChecker syntaxChecker;
+
+ /*
+ * We are going to need a syntax checker for each and every one of
+ * these syntaxes. However right now we're probably not going to be
+ * turning on syntax checking or are not as interested in it. So we
+ * can put in place simple do nothing syntax checkers - which is really
+ * the binary syntax checker.
+ */
+
+ // 1.3.6.1.1.1.0.0 - RFC2307 NIS Netgroup Triple
+ syntaxChecker = new AcceptAllSyntaxChecker( "1.3.6.1.1.1.0.0" );
+ cb.schemaObjectProduced( this, syntaxChecker.getSyntaxOid(), syntaxChecker );
+
+ // 1.3.6.1.1.1.0.1 - RFC2307 Boot Parameter Syntax
+ syntaxChecker = new AcceptAllSyntaxChecker( "1.3.6.1.1.1.0.1" );
+ cb.schemaObjectProduced( this, syntaxChecker.getSyntaxOid(), syntaxChecker );
+ }
+}
Added: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisSyntaxProducer.java
==============================================================================
--- (empty file)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/NisSyntaxProducer.java Fri Oct 22 13:18:02 2004
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.eve.schema.bootstrap;
+
+
+import javax.naming.NamingException;
+
+import org.apache.eve.schema.SyntaxCheckerRegistry;
+
+
+
+/**
+ * A producer of Syntax objects for the nis schema. This code has been
+ * automatically generated using schema files in the OpenLDAP format along with
+ * the eve schema plugin for maven. This has been done to facilitate
+ * Eve<->OpenLDAP schema interoperability.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class NisSyntaxProducer extends AbstractBootstrapProducer
+{
+ public NisSyntaxProducer()
+ {
+ super( ProducerTypeEnum.SYNTAX_PRODUCER );
+ }
+
+
+ // ------------------------------------------------------------------------
+ // BootstrapProducer Methods
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
+ */
+ public void produce( BootstrapRegistries registries, ProducerCallback cb )
+ throws NamingException
+ {
+ BootstrapSyntax syntax;
+ SyntaxCheckerRegistry syntaxCheckerRegistry = registries.getSyntaxCheckerRegistry();
+
+ // 1.3.6.1.1.1.0.0 - RFC2307 NIS Netgroup Triple
+ syntax = new BootstrapSyntax( "1.3.6.1.1.1.0.0", syntaxCheckerRegistry );
+ syntax.setDescription( "RFC2307 NIS Netgroup Triple" );
+ syntax.setNames( new String[] { "NIS Netgroup Triple" } );
+ syntax.setHumanReadible( true );
+ cb.schemaObjectProduced( this, syntax.getOid(), syntax );
+
+ // 1.3.6.1.1.1.0.1 - RFC2307 Boot Parameter Syntax
+ syntax = new BootstrapSyntax( "1.3.6.1.1.1.0.1", syntaxCheckerRegistry );
+ syntax.setNames( new String[] { "NIS Boot Parameter" } );
+ syntax.setHumanReadible( true );
+ cb.schemaObjectProduced( this, syntax.getOid(), syntax );
+
+ }
+}
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemComparatorProducer.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemComparatorProducer.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemComparatorProducer.java Fri Oct 22 13:18:02 2004
@@ -116,12 +116,19 @@
comparator = new ComparableComparator();
cb.schemaObjectProduced( this, "2.5.13.14", comparator );
- /*
- ( 2.5.13.16 NAME 'bitStringMatch'
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )
- */
- comparator = new ComparableComparator();
- cb.schemaObjectProduced( this, "2.5.13.16", comparator );
+ /*
+ ( 2.5.13.16 NAME 'bitStringMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )
+ */
+ comparator = new ComparableComparator();
+ cb.schemaObjectProduced( this, "2.5.13.16", comparator );
+
+ /*
+ ( 2.5.13.17 NAME 'octetStringMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
+ */
+ comparator = new ComparableComparator();
+ cb.schemaObjectProduced( this, "2.5.13.17", comparator );
/*
( 2.5.13.20 NAME 'telephoneNumberMatch'
@@ -205,6 +212,18 @@
new CachingNormalizer( new DeepTrimToLowerNormalizer() ),
new ComparableComparator() );
cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.109.114.2", comparator );
+
+ /*
+ * MatchingRules from section 2 of http://www.faqs.org/rfcs/rfc3698.html
+ * for Additional MatchingRules
+
+ ( 2.5.13.13 NAME 'booleanMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )
+
+ */
+
+ comparator = new ComparableComparator();
+ cb.schemaObjectProduced( this, "2.5.13.13", comparator );
}
}
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemMatchingRuleProducer.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemMatchingRuleProducer.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemMatchingRuleProducer.java Fri Oct 22 13:18:02 2004
@@ -101,6 +101,9 @@
( 2.5.13.16 NAME 'bitStringMatch'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )
+
+ ( 2.5.13.17 NAME 'octetStringMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
*/
mrule = new BootstrapMatchingRule( "2.5.13.8", registries );
@@ -128,6 +131,11 @@
mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.6" );
cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+ mrule = new BootstrapMatchingRule( "2.5.13.17", registries );
+ mrule.setNames( new String[] { "octetStringMatch" } );
+ mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.40" );
+ cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
/*
* Straight out of RFC 2252: Section 8
* =======================================
@@ -216,7 +224,7 @@
cb.schemaObjectProduced( this, mrule.getOid(), mrule );
mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.1466.109.114.1", registries );
- mrule.setNames( new String[] { "caseExactIA5Match", "caseExactMatch" } );
+ mrule.setNames( new String[] { "caseExactIA5Match" } );
mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
cb.schemaObjectProduced( this, mrule.getOid(), mrule );
@@ -224,5 +232,20 @@
mrule.setNames( new String[] { "caseIgnoreIA5Match" } );
mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+ /*
+ * MatchingRules from section 2 of http://www.faqs.org/rfcs/rfc3698.html
+ * for Additional MatchingRules
+
+ ( 2.5.13.13 NAME 'booleanMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )
+
+ */
+
+ mrule = new BootstrapMatchingRule( "2.5.13.13", registries );
+ mrule.setNames( new String[] { "booleanMatch" } );
+ mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.7" );
+ cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
}
}
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemNormalizerProducer.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemNormalizerProducer.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/schema/bootstrap/SystemNormalizerProducer.java Fri Oct 22 13:18:02 2004
@@ -124,6 +124,13 @@
cb.schemaObjectProduced( this, "2.5.13.16", normalizer );
/*
+ ( 2.5.13.17 NAME 'octetStringMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
+ */
+ normalizer = new NoOpNormalizer();
+ cb.schemaObjectProduced( this, "2.5.13.17", normalizer );
+
+ /*
( 2.5.13.20 NAME 'telephoneNumberMatch'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )
*/
@@ -193,5 +200,16 @@
normalizer = new CachingNormalizer( new DeepTrimNormalizer() );
cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.109.114.1", normalizer );
+ /*
+ * MatchingRules from section 2 of http://www.faqs.org/rfcs/rfc3698.html
+ * for Additional MatchingRules
+
+ ( 2.5.13.13 NAME 'booleanMatch'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )
+
+ */
+
+ normalizer = new NoOpNormalizer();
+ cb.schemaObjectProduced( this, "2.5.13.13", normalizer );
}
}
Modified: incubator/directory/eve/trunk/backend/core/src/test/org/apache/eve/schema/bootstrap/BootstrapSchemaLoaderTest.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/test/org/apache/eve/schema/bootstrap/BootstrapSchemaLoaderTest.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/test/org/apache/eve/schema/bootstrap/BootstrapSchemaLoaderTest.java Fri Oct 22 13:18:02 2004
@@ -17,10 +17,17 @@
package org.apache.eve.schema.bootstrap;
+import java.util.Iterator;
+import java.util.List;
+import java.io.StringWriter;
+import java.io.PrintWriter;
import javax.naming.NamingException;
import junit.framework.TestCase;
import org.apache.ldap.common.schema.AttributeType;
+import org.apache.ldap.common.schema.ObjectClass;
+import org.apache.ldap.common.schema.MatchingRule;
+import org.apache.ldap.common.schema.Syntax;
/**
@@ -48,9 +55,8 @@
}
- public void testLoad() throws NamingException
+ public void testLoadAll() throws NamingException
{
- BootstrapRegistries registries = new BootstrapRegistries();
BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
String[] schemaClasses = {
"org.apache.eve.schema.bootstrap.AutofsSchema",
@@ -268,5 +274,46 @@
type = registries.getAttributeTypeRegistry().lookup( "eveUpdn" );
assertNotNull( type );
+ }
+
+
+ /**
+ * Attempts to resolve the dependent schema objects of all entities that
+ * refer to other objects within the registries.
+ *
+ * @throws NamingException if there are problems.
+ */
+ public void testReferentialIntegrity() throws NamingException
+ {
+ if ( System.getProperties().containsKey( "ignore.ref.integ.test" ) )
+ {
+ System.err.println( "REFERENTIAL INTEGRITY TESTS BYPASSED!!!" );
+ return;
+ }
+
+ testLoadAll();
+ List errors = registries.checkRefInteg();
+ assertNotNull( errors );
+
+ StringBuffer buf = new StringBuffer();
+
+ if ( ! errors.isEmpty() )
+ {
+ buf.append( "expected empty erorrs but got " )
+ .append( errors.size() ).append( " errors:\n" );
+ for ( int ii = 0; ii < errors.size(); ii++ )
+ {
+ buf.append( '\t' ).append( errors.get( ii ).toString() ).append( '\n' );
+ }
+
+ StringWriter out = new StringWriter();
+ Exception e = ( Exception ) errors.get( 0 );
+ e.printStackTrace( new PrintWriter( out ) );
+ buf.append( "\nfirst exception trace:\n" + out.getBuffer().toString() );
+ }
+
+
+
+ assertTrue( buf.toString(), errors.isEmpty() );
}
}