if ( !oidsMap.containsKey( type ) )
{
// No AttributeType : this is an error
String msg = I18n.err( I18n.ERR_04268_OID_NOT_FOUND, atav.getType() );
LOG.error( msg );
throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, msg );
}
OidNormalizer oidNormalizer = oidsMap.get( type );
if ( oidNormalizer != null )
{
try
{
Ava newAva = new Ava(
atav.getType(),
oidNormalizer.getAttributeTypeOid(),
atav.getValue(),
oidNormalizer.getNormalizer().normalize( atav.getNormValue() ),
atav.getName() );
newAva.apply( schemaManager );
return newAva;
}
catch ( LdapException le )
{
throw new LdapInvalidDnException( le.getMessage(), le );
}
}
else
{
// We don't have a normalizer for this OID : just do nothing.
return atav;
}
}
else
{
// The type is empty : this is not possible...
String msg = I18n.err( I18n.ERR_04209_EMPTY_TYPE_NOT_ALLOWED );
LOG.error( msg );
throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, msg );
}
}