You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2009/08/27 12:58:39 UTC
svn commit: r808365 - in /directory:
apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/
apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/
apacheds/branche...
Author: elecharny
Date: Thu Aug 27 10:58:38 2009
New Revision: 808365
URL: http://svn.apache.org/viewvc?rev=808365&view=rev
Log:
o Fixed some compilation errors
o Removed useless classes
Removed:
directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AbstractSchemaDescription.java
directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/AttributeTypeDescription.java
directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/ObjectClassDescription.java
Modified:
directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java
directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java
directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java?rev=808365&r1=808364&r2=808365&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerEntrySerializerTest.java Thu Aug 27 10:58:38 2009
@@ -70,7 +70,7 @@
public static void setup() throws Exception
{
loader = new BootstrapSchemaLoader();
- oidRegistry = new DefaultOidRegistry();
+ oidRegistry = new OidRegistry();
registries = new DefaultRegistries( "bootstrap", loader, oidRegistry );
// load essential bootstrap schemas
Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java?rev=808365&r1=808364&r2=808365&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java Thu Aug 27 10:58:38 2009
@@ -159,7 +159,7 @@
public static void setup() throws Exception
{
loader = new BootstrapSchemaLoader();
- oidRegistry = new DefaultOidRegistry();
+ oidRegistry = new OidRegistry();
registries = new DefaultRegistries( "bootstrap", loader, oidRegistry );
// load essential bootstrap schemas
Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=808365&r1=808364&r2=808365&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Thu Aug 27 10:58:38 2009
@@ -35,9 +35,9 @@
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.LdapSyntax;
import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.ObjectClass;
import org.apache.directory.shared.ldap.schema.SyntaxChecker;
import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimNormalizer;
-import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription;
import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescriptionSchemaParser;
import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescriptionSchemaParser;
import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescription;
@@ -45,7 +45,6 @@
import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescriptionSchemaParser;
import org.apache.directory.shared.ldap.schema.parsers.NormalizerDescription;
import org.apache.directory.shared.ldap.schema.parsers.NormalizerDescriptionSchemaParser;
-import org.apache.directory.shared.ldap.schema.parsers.ObjectClassDescription;
import org.apache.directory.shared.ldap.schema.parsers.ObjectClassDescriptionSchemaParser;
import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescription;
import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescriptionSchemaParser;
@@ -1514,25 +1513,26 @@
Attributes attrs = getSubschemaSubentryAttributes();
Attribute attrTypes = attrs.get( "objectClasses" );
- ObjectClassDescription objectClassDescription = null;
- for ( int ii = 0; ii < attrTypes.size(); ii++ )
+ ObjectClass objectClass = null;
+ for ( int i = 0; i < attrTypes.size(); i++ )
{
- String desc = ( String ) attrTypes.get( ii );
+ String desc = ( String ) attrTypes.get( i );
+
if ( desc.indexOf( oid ) != -1 )
{
- objectClassDescription = objectClassDescriptionSchemaParser.parseObjectClassDescription( desc );
+ objectClass = objectClassDescriptionSchemaParser.parseObjectClassDescription( desc );
break;
}
}
if ( isPresent )
{
- assertNotNull( objectClassDescription );
- assertEquals( oid, objectClassDescription.getNumericOid() );
+ assertNotNull( objectClass );
+ assertEquals( oid, objectClass.getOid() );
}
else
{
- assertNull( objectClassDescription );
+ assertNull( objectClass );
}
// -------------------------------------------------------------------
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java?rev=808365&r1=808364&r2=808365&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java Thu Aug 27 10:58:38 2009
@@ -68,7 +68,7 @@
import org.apache.directory.shared.ldap.schema.NameForm;
import org.apache.directory.shared.ldap.schema.ObjectClass;
import org.apache.directory.shared.ldap.schema.LdapSyntax;
-import org.apache.directory.shared.ldap.schema.parsers.AbstractSchemaDescription;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescription;
import org.apache.directory.shared.ldap.schema.parsers.NormalizerDescription;
import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescription;
@@ -219,7 +219,6 @@
this.subentryModifier = new SchemaSubentryModifier( registries, dao );
this.parsers = new DescriptionParsers( registries, dao );
- OidRegistry oidRegistry = registries.getOidRegistry();
AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
String comparatorsOid = atRegistry.getOid( SchemaConstants.COMPARATORS_AT );
@@ -648,11 +647,11 @@
}
- public String getSchema( AbstractSchemaDescription desc )
+ public String getSchema( SchemaObject schemaObject )
{
- if ( desc.getExtensions().containsKey( MetaSchemaConstants.X_SCHEMA ) )
+ if ( schemaObject.getExtensions().containsKey( MetaSchemaConstants.X_SCHEMA ) )
{
- return desc.getExtensions().get( MetaSchemaConstants.X_SCHEMA ).get( 0 );
+ return schemaObject.getExtensions().get( MetaSchemaConstants.X_SCHEMA ).get( 0 );
}
return MetaSchemaConstants.SCHEMA_OTHER;
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java?rev=808365&r1=808364&r2=808365&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java Thu Aug 27 10:58:38 2009
@@ -32,8 +32,6 @@
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Modification;
import org.apache.directory.shared.ldap.entry.Value;
-import org.apache.directory.shared.ldap.schema.parsers.AbstractSchemaDescription;
-import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription;
import org.apache.directory.shared.ldap.util.StringTools;
@@ -134,23 +132,25 @@
* the quoted description strings to render
* @return the same string buffer that was given for call chaining
*/
- public static StringBuffer render( StringBuffer buf, String[] qdescrs )
+ public static StringBuffer render( StringBuffer buf, List<String> qdescrs )
{
- if ( qdescrs == null || qdescrs.length == 0 )
+ if ( ( qdescrs == null ) || ( qdescrs.size() == 0 ) )
{
return buf;
}
- else if ( qdescrs.length == 1 )
+ else if ( qdescrs.size() == 1 )
{
- buf.append( "'" ).append( qdescrs[0] ).append( "'" );
+ buf.append( "'" ).append( qdescrs.get( 0 ) ).append( "'" );
}
else
{
buf.append( "( " );
- for ( int ii = 0; ii < qdescrs.length; ii++ )
+
+ for ( String qdescr : qdescrs )
{
- buf.append( "'" ).append( qdescrs[ii] ).append( "' " );
+ buf.append( "'" ).append( qdescr ).append( "' " );
}
+
buf.append( ")" );
}
@@ -165,7 +165,7 @@
* the quoted description strings to render
* @return the string buffer the qdescrs are rendered into
*/
- public static StringBuffer render( String[] qdescrs )
+ public static StringBuffer render( List<String> qdescrs )
{
StringBuffer buf = new StringBuffer();
return render( buf, qdescrs );
@@ -364,10 +364,10 @@
buf.append( " OBSOLETE " );
}
- if ( oc.getSuperClasses() != null && oc.getSuperClasses().length > 0 )
+ if ( ( oc.getSuperiorOids() != null ) && ( oc.getSuperiorOids().size() > 0 ) )
{
buf.append( "SUP " );
- render( buf, oc.getSuperClasses() );
+ render( buf, oc.getSuperiorOids() );
}
if ( oc.getType() != null )
@@ -375,16 +375,16 @@
buf.append( " " ).append( oc.getType() );
}
- if ( oc.getMustList() != null && oc.getMustList().length > 0 )
+ if ( ( oc.getMustAttributeTypeOids() != null ) && ( oc.getMustAttributeTypeOids().size() > 0 ) )
{
buf.append( " MUST " );
- render( buf, oc.getMustList() );
+ render( buf, oc.getMustAttributeTypeOids() );
}
- if ( oc.getMayList() != null && oc.getMayList().length > 0 )
+ if ( ( oc.getMayAttributeTypeOids() != null ) && ( oc.getMayAttributeTypeOids().size() > 0 ) )
{
buf.append( " MAY " );
- render( buf, oc.getMayList() );
+ render( buf, oc.getMayAttributeTypeOids() );
}
buf.append( " X-SCHEMA '" );
@@ -604,83 +604,83 @@
* @return the StringBuffer containing the rendered attributeType description
* @throws NamingException if there are problems accessing the objects
* associated with the attribute type.
- */
- public static StringBuffer render( AttributeTypeDescription atd )
+ *
+ public static StringBuffer render( AttributeType attributeType )
{
StringBuffer buf = new StringBuffer();
- buf.append( "( " ).append( atd.getNumericOid() );
+ buf.append( "( " ).append( attributeType.getOid() );
- if ( atd.getNames() != null && atd.getNames().size() > 0 )
+ if ( attributeType.getNames() != null && attributeType.getNames().size() > 0 )
{
buf.append( " NAME " );
- render( buf, atd.getNames().toArray( new String[atd.getNames().size()] ) ).append( " " );
+ render( buf, attributeType.getNames() ).append( " " );
}
else
{
buf.append( " " );
}
- if ( atd.getDescription() != null )
+ if ( attributeType.getDescription() != null )
{
- buf.append( "DESC " ).append( "'" ).append( atd.getDescription() ).append( "' " );
+ buf.append( "DESC " ).append( "'" ).append( attributeType.getDescription() ).append( "' " );
}
- if ( atd.isObsolete() )
+ if ( attributeType.isObsolete() )
{
buf.append( " OBSOLETE" );
}
- if ( atd.getSuperType() != null )
+ if ( attributeType.getSupOid() != null )
{
- buf.append( " SUP " ).append( atd.getSuperType() );
+ buf.append( " SUP " ).append( attributeType.getSupOid() );
}
- if ( atd.getEqualityMatchingRule() != null )
+ if ( attributeType.getEqualityOid() != null )
{
- buf.append( " EQUALITY " ).append( atd.getEqualityMatchingRule() );
+ buf.append( " EQUALITY " ).append( attributeType.getEqualityOid() );
}
- if ( atd.getOrderingMatchingRule() != null )
+ if ( attributeType.getOrderingOid() != null )
{
- buf.append( " ORDERING " ).append( atd.getOrderingMatchingRule() );
+ buf.append( " ORDERING " ).append( attributeType.getOrderingOid() );
}
- if ( atd.getSubstringsMatchingRule() != null )
+ if ( attributeType.getSubstrOid() != null )
{
- buf.append( " SUBSTR " ).append( atd.getSubstringsMatchingRule() );
+ buf.append( " SUBSTR " ).append( attributeType.getSubstrOid() );
}
- if ( atd.getSyntax() != null )
+ if ( attributeType.getSyntax() != null )
{
- buf.append( " SYNTAX " ).append( atd.getSyntax() );
+ buf.append( " SYNTAX " ).append( attributeType.getSyntax() );
- if ( atd.getSyntaxLength() > 0 )
+ if ( attributeType.getLength() > 0 )
{
- buf.append( "{" ).append( atd.getSyntaxLength() ).append( "}" );
+ buf.append( "{" ).append( attributeType.getLength() ).append( "}" );
}
}
- if ( atd.isSingleValued() )
+ if ( attributeType.isSingleValue() )
{
buf.append( " SINGLE-VALUE" );
}
- if ( atd.isCollective() )
+ if ( attributeType.isCollective() )
{
buf.append( " COLLECTIVE" );
}
- if ( !atd.isUserModifiable() )
+ if ( !attributeType.isCanUserModify() )
{
buf.append( " NO-USER-MODIFICATION" );
}
- if ( atd.getUsage() != null )
+ if ( attributeType.getUsage() != null )
{
- buf.append( " USAGE " ).append( UsageEnum.render( atd.getUsage() ) );
+ buf.append( " USAGE " ).append( UsageEnum.render( attributeType.getUsage() ) );
}
- return buf.append( render( atd.getExtensions() ) ).append( ")" );
+ return buf.append( render( attributeType.getExtensions() ) ).append( ")" );
}