Skip to content
Permalink
Browse files
Removed the Mutable classes (AttributeType, ObjectClass, MatchingRule)
  • Loading branch information
elecharny committed Jan 17, 2019
1 parent 8e2d017 commit 8d241399d81dea6dca0ccab18bfca303ce23ea59
Show file tree
Hide file tree
Showing 27 changed files with 814 additions and 1,404 deletions.
@@ -25,8 +25,6 @@
import org.apache.directory.api.ldap.model.schema.LdapComparator;
import org.apache.directory.api.ldap.model.schema.LdapSyntax;
import org.apache.directory.api.ldap.model.schema.MatchingRule;
import org.apache.directory.api.ldap.model.schema.MutableAttributeType;
import org.apache.directory.api.ldap.model.schema.MutableMatchingRule;
import org.apache.directory.api.ldap.model.schema.Normalizer;
import org.apache.directory.api.ldap.model.schema.PrepareString;
import org.apache.directory.api.ldap.model.schema.PrepareString.AssertionType;
@@ -108,7 +106,7 @@ public S( String oid, boolean humanReadible )
/* no protection*/
static AttributeType getCaseIgnoringAttributeNoNumbersType()
{
MutableAttributeType attributeType = new MutableAttributeType( "1.1.3.1" );
AttributeType attributeType = new AttributeType( "1.1.3.1" );
LdapSyntax syntax = new LdapSyntax( "1.1.1.1", "", true );

syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2.1" )
@@ -137,7 +135,7 @@ public boolean isValidSyntax( Object value )
}
} );

MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2.1" );
MatchingRule matchingRule = new MatchingRule( "1.1.2.1" );
matchingRule.setSyntax( syntax );

matchingRule.setLdapComparator( new LdapComparator<String>( matchingRule.getOid() )
@@ -181,7 +179,7 @@ public String normalize( String value, PrepareString.AssertionType assertionType

/* no protection*/static AttributeType getIA5StringAttributeType()
{
MutableAttributeType attributeType = new MutableAttributeType( "1.1" );
AttributeType attributeType = new AttributeType( "1.1" );
attributeType.addName( "1.1" );
LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );

@@ -199,7 +197,7 @@ public boolean isValidSyntax( Object value )
}
} );

MutableMatchingRule matchingRule = new MutableMatchingRule( "1.1.2" );
MatchingRule matchingRule = new MatchingRule( "1.1.2" );
matchingRule.setSyntax( syntax );

matchingRule.setLdapComparator( new LdapComparator<String>( matchingRule.getOid() )
@@ -225,7 +223,7 @@ public int compare( String o1, String o2 )

/* No protection */static AttributeType getBytesAttributeType()
{
MutableAttributeType attributeType = new MutableAttributeType( "1.2" );
AttributeType attributeType = new AttributeType( "1.2" );
LdapSyntax syntax = new LdapSyntax( "1.2.1", "", true );

syntax.setSyntaxChecker( new SyntaxChecker( "1.2.1" )
@@ -240,7 +238,7 @@ public boolean isValidSyntax( Object value )
}
} );

MutableMatchingRule matchingRule = new MutableMatchingRule( "1.2.2" );
MatchingRule matchingRule = new MatchingRule( "1.2.2" );
matchingRule.setSyntax( syntax );

matchingRule.setLdapComparator( new ByteArrayComparator( "1.2.2" ) );
@@ -54,7 +54,6 @@
import org.apache.directory.api.ldap.model.name.Dn;
import org.apache.directory.api.ldap.model.name.Rdn;
import org.apache.directory.api.ldap.model.schema.AttributeType;
import org.apache.directory.api.ldap.model.schema.MutableAttributeType;
import org.apache.directory.api.ldap.model.schema.SchemaManager;
import org.apache.directory.api.util.Base64;
import org.apache.directory.api.util.Chars;
@@ -1027,7 +1026,7 @@ else if ( attributeValue instanceof byte[] )
// The attribute does not exist already, create a fake one
if ( ( schemaManager != null ) && schemaManager.isRelaxed() )
{
MutableAttributeType newAttributeType = new MutableAttributeType( "1.3.6.1.4.1.18060.0.9999." + oidCounter++ );
AttributeType newAttributeType = new AttributeType( "1.3.6.1.4.1.18060.0.9999." + oidCounter++ );
newAttributeType.setNames( attributeType );
newAttributeType.setSyntax( schemaManager.getLdapSyntaxRegistry().get( SchemaConstants.DIRECTORY_STRING_SYNTAX ) );
schemaManager.add( newAttributeType );
@@ -1449,7 +1448,7 @@ protected LdifEntry parseEntry() throws LdapException
&& schemaManager.isRelaxed() )
{
// Not found : create a new one
MutableAttributeType newAttributeType = new MutableAttributeType( "1.3.6.1.4.1.18060.0.9999." + oidCounter++ );
AttributeType newAttributeType = new AttributeType( "1.3.6.1.4.1.18060.0.9999." + oidCounter++ );
newAttributeType.setNames( ava.getType() );
newAttributeType.setSyntax( schemaManager.getLdapSyntaxRegistry().get( SchemaConstants.DIRECTORY_STRING_SYNTAX ) );
schemaManager.add( newAttributeType );

0 comments on commit 8d24139

Please sign in to comment.