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 2010/03/16 18:02:10 UTC
svn commit: r923869 - in
/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema:
AttributeType.java MatchingRule.java ObjectClass.java
registries/DefaultSchemaObjectRegistry.java registries/Registries.java
Author: elecharny
Date: Tue Mar 16 17:02:09 2010
New Revision: 923869
URL: http://svn.apache.org/viewvc?rev=923869&view=rev
Log:
Replaced some excpeiton being thrown by another exception
Modified:
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java?rev=923869&r1=923868&r2=923869&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java Tue Mar 16 17:02:09 2010
@@ -272,8 +272,7 @@ public class AttributeType extends Abstr
// Not allowed.
String msg = I18n.err( I18n.ERR_04304, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
- msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
isOk = false;
@@ -330,7 +329,7 @@ public class AttributeType extends Abstr
// Not allowed.
String msg = I18n.err( I18n.ERR_04306, syntaxOid, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
return;
@@ -365,7 +364,7 @@ public class AttributeType extends Abstr
// Not allowed.
String msg = I18n.err( I18n.ERR_04307, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
return;
@@ -393,7 +392,7 @@ public class AttributeType extends Abstr
// Not allowed.
String msg = I18n.err( I18n.ERR_04308, equalityOid, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
return;
@@ -443,7 +442,7 @@ public class AttributeType extends Abstr
// Not allowed.
String msg = I18n.err( I18n.ERR_04310, orderingOid, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
return;
@@ -458,7 +457,7 @@ public class AttributeType extends Abstr
// Not allowed.
String msg = I18n.err( I18n.ERR_04311, orderingOid, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
}
@@ -494,7 +493,7 @@ public class AttributeType extends Abstr
// Not allowed.
String msg = I18n.err( I18n.ERR_04312, substringOid, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
return;
@@ -538,7 +537,7 @@ public class AttributeType extends Abstr
// This is an error
String msg = I18n.err( I18n.ERR_04314, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
return;
@@ -550,7 +549,7 @@ public class AttributeType extends Abstr
// Cannot have a not user modifiable AT which is not an operational AT
String msg = I18n.err( I18n.ERR_04315, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
}
@@ -576,7 +575,7 @@ public class AttributeType extends Abstr
// An AttributeType which is collective must be a USER attributeType
String msg = I18n.err( I18n.ERR_04316, getName() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java?rev=923869&r1=923868&r2=923869&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java Tue Mar 16 17:02:09 2010
@@ -24,8 +24,7 @@ import java.util.List;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.exception.LdapProtocolErrorException;
import org.apache.directory.shared.ldap.schema.comparators.ComparableComparator;
import org.apache.directory.shared.ldap.schema.normalizers.NoOpNormalizer;
import org.apache.directory.shared.ldap.schema.registries.Registries;
@@ -153,8 +152,7 @@ public class MatchingRule extends Abstra
catch ( LdapException ne )
{
// The Syntax is a mandatory element, it must exist.
- throw new LdapSchemaViolationException( ResultCodeEnum.UNWILLING_TO_PERFORM,
- I18n.err( I18n.ERR_04317 ) );
+ throw new LdapProtocolErrorException( I18n.err( I18n.ERR_04317 ) );
}
/**
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java?rev=923869&r1=923868&r2=923869&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java Tue Mar 16 17:02:09 2010
@@ -26,8 +26,6 @@ import java.util.List;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapProtocolErrorException;
-import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
import org.apache.directory.shared.ldap.schema.registries.Registries;
@@ -146,8 +144,7 @@ public class ObjectClass extends Abstrac
// An ABSTRACT OC can only inherit from ABSTRACT OCs
String msg = I18n.err( I18n.ERR_04318, oid , superior.getObjectType() , superior );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
- msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
return;
}
@@ -160,8 +157,7 @@ public class ObjectClass extends Abstrac
// An AUXILIARY OC can only inherit from STRUCTURAL OCs
String msg = I18n.err( I18n.ERR_04319, oid, superior );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
- msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
return;
}
@@ -174,8 +170,7 @@ public class ObjectClass extends Abstrac
// A STRUCTURAL OC can only inherit from AUXILIARY OCs
String msg = I18n.err( I18n.ERR_04320, oid, superior );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
- msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
return;
}
@@ -217,8 +212,7 @@ public class ObjectClass extends Abstrac
{
// Already registered : this is an error
String msg = I18n.err( I18n.ERR_04322, oid, mayAttributeTypeName );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
- msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
break;
}
@@ -230,7 +224,7 @@ public class ObjectClass extends Abstrac
// Cannot find the AT
String msg = I18n.err( I18n.ERR_04323, oid, mayAttributeTypeName );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
break;
}
@@ -258,8 +252,7 @@ public class ObjectClass extends Abstrac
// Already registered : this is an error
String msg = I18n.err( I18n.ERR_04324, oid, mustAttributeTypeName );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
- msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
break;
}
@@ -270,8 +263,7 @@ public class ObjectClass extends Abstrac
// Already registered : this is an error
String msg = I18n.err( I18n.ERR_04325, oid, mustAttributeTypeName );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
- msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
break;
}
@@ -283,7 +275,7 @@ public class ObjectClass extends Abstrac
// Cannot find the AT
String msg = I18n.err( I18n.ERR_04326, oid, mustAttributeTypeName );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
break;
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java?rev=923869&r1=923868&r2=923869&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java Tue Mar 16 17:02:09 2010
@@ -26,6 +26,7 @@ import java.util.Map;
import org.apache.directory.shared.asn1.primitives.OID;
import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -214,7 +215,7 @@ public abstract class DefaultSchemaObjec
{
String msg = I18n.err( I18n.ERR_04271, schemaObjectType.name(), name );
LOG.warn( msg );
- throw new LdapSchemaViolationException( ResultCodeEnum.ATTRIBUTE_OR_VALUE_EXISTS, msg );
+ throw new LdapAttributeInUseException( msg );
}
else
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=923869&r1=923868&r2=923869&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java Tue Mar 16 17:02:09 2010
@@ -31,6 +31,7 @@ import java.util.Set;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapProtocolErrorException;
import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -723,7 +724,7 @@ public class Registries implements Schem
// Not allowed.
String msg = I18n.err( I18n.ERR_04292, schemaObject.getName(), ne.getLocalizedMessage() );
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
+ Throwable error = new LdapProtocolErrorException( msg );
errors.add( error );
LOG.info( msg );
}
@@ -1000,7 +1001,7 @@ public class Registries implements Schem
else
{
// This is an error.
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
+ Throwable error = new LdapProtocolErrorException(
I18n.err( I18n.ERR_04294, matchingRule.getOid() ) );
errors.add( error );
}
@@ -1234,8 +1235,7 @@ public class Registries implements Schem
if ( musts.contains( may ) )
{
// This is not allowed.
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
- I18n.err( I18n.ERR_04299, objectClass.getOid() ) );
+ Throwable error = new LdapProtocolErrorException( I18n.err( I18n.ERR_04299, objectClass.getOid() ) );
errors.add( error );
return;
}
@@ -1278,8 +1278,7 @@ public class Registries implements Schem
else
{
// Not allowed : we have a cyle
- Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX ,
- I18n.err( I18n.ERR_04300, objectClass.getOid(), superior) );
+ Throwable error = new LdapProtocolErrorException( I18n.err( I18n.ERR_04300, objectClass.getOid(), superior) );
errors.add( error );
return;
}