Return-Path:
Delivered-To: apmail-directory-commits-archive@www.apache.org
Received: (qmail 36294 invoked from network); 16 Mar 2010 00:32:09 -0000
Received: from unknown (HELO mail.apache.org) (140.211.11.3)
by 140.211.11.9 with SMTP; 16 Mar 2010 00:32:09 -0000
Received: (qmail 63746 invoked by uid 500); 16 Mar 2010 00:32:09 -0000
Delivered-To: apmail-directory-commits-archive@directory.apache.org
Received: (qmail 63698 invoked by uid 500); 16 Mar 2010 00:32:09 -0000
Mailing-List: contact commits-help@directory.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To: dev@directory.apache.org
Delivered-To: mailing list commits@directory.apache.org
Received: (qmail 63691 invoked by uid 99); 16 Mar 2010 00:32:09 -0000
Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)
by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 00:32:09 +0000
X-ASF-Spam-Status: No, hits=-1024.7 required=10.0
tests=ALL_TRUSTED,AWL
X-Spam-Check-By: apache.org
Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4)
by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Mar 2010 00:32:01 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
id C52B623889B8; Tue, 16 Mar 2010 00:31:41 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r923524 [1/7] - in /directory/shared/trunk:
ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/
ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/
ldap-schema-manager/sr...
Date: Tue, 16 Mar 2010 00:31:39 -0000
To: commits@directory.apache.org
From: elecharny@apache.org
X-Mailer: svnmailer-1.0.8
Message-Id: <20100316003141.C52B623889B8@eris.apache.org>
Author: elecharny
Date: Tue Mar 16 00:31:36 2010
New Revision: 923524
URL: http://svn.apache.org/viewvc?rev=923524&view=rev
Log:
Injected the new Exceptions
Added:
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnCache.temp
Modified:
directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java
directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java
directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java
directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java
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/DITContentRule.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/EntityFactory.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.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/MatchingRuleUse.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.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/PrepareString.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaDao.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/DnComparator.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/NormalizingComparator.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/SerializableComparator.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/UniqueMemberComparator.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/BooleanNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ConcreteNameComponentNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimToLowerNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DefaultStringNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DnNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/GeneralizedTimeNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/ObjectIdentifierNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ComparatorRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DITStructureRuleRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultComparatorRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultDITStructureRuleRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultNormalizerRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultObjectClassRegistry.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/DefaultSyntaxCheckerRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableAttributeTypeRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableComparatorRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITContentRuleRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITStructureRuleRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableLdapSyntaxRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleUseRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNameFormRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNormalizerRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableObjectClassRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableSyntaxCheckerRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaObjectRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SyntaxCheckerRegistry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValueTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntryTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/AVATest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/DNTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/FastDnParserTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/normalizers/DeepTrimNormalizerTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/normalizers/NumericNormalizerTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/normalizers/TelephoneNumberNormalizerTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistryTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/NameFormDescriptionSchemaParserTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/AttributeUtilsTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/LdapUrlTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/NamespaceToolsTest.java
directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/util/tree/TestDnNode.java
Modified: directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java (original)
+++ directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaEntityFactory.java Tue Mar 16 00:31:36 2010
@@ -38,7 +38,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.EntityFactory;
@@ -310,7 +310,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded. We can't create the requested Normalizer
String msg = I18n.err( I18n.ERR_10013, entry.getDn().getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Schema schema = getSchema( schemaName, targetRegistries );
@@ -360,7 +360,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded. We can't create the requested SyntaxChecker
String msg = I18n.err( I18n.ERR_10013, syntaxCheckerDescription.getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
// The FQCN
@@ -456,7 +456,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded. We can't create the requested Comparator
String msg = I18n.err( I18n.ERR_10016, comparatorDescription.getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
// The FQCN
@@ -492,7 +492,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded. We can't create the requested Comparator
String msg = I18n.err( I18n.ERR_10016, entry.getDn().getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Schema schema = getSchema( schemaName, targetRegistries );
@@ -580,7 +580,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded. We can't create the requested Normalizer
String msg = I18n.err( I18n.ERR_10018, normalizerDescription.getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
// The FQCN
@@ -616,7 +616,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded. We can't create the requested Normalizer
String msg = I18n.err( I18n.ERR_10018, entry.getDn().getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Schema schema = getSchema( schemaName, targetRegistries );
@@ -699,7 +699,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded. We can't create the requested Syntax
String msg = I18n.err( I18n.ERR_10020, entry.getDn().getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Schema schema = getSchema( schemaName, targetRegistries );
@@ -748,7 +748,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded. We can't create the requested MatchingRule
String msg = I18n.err( I18n.ERR_10022, entry.getDn().getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Schema schema = getSchema( schemaName, targetRegistries );
@@ -819,7 +819,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded. We can't create the requested ObjectClass
String msg = I18n.err( I18n.ERR_10024, entry.getDn().getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Schema schema = getSchema( schemaName, targetRegistries );
@@ -892,7 +892,7 @@ public class SchemaEntityFactory impleme
// The schema is not loaded, this is an error
String msg = I18n.err( I18n.ERR_10026, entry.getDn().getName(), schemaName );
LOG.warn( msg );
- throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
}
Schema schema = getSchema( schemaName, targetRegistries );
Modified: directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java (original)
+++ directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java Tue Mar 16 00:31:36 2010
@@ -34,7 +34,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.name.DN;
@@ -203,7 +203,7 @@ public class DefaultSchemaManager implem
}
else
{
- throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_11001, schemaName ), ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_11001, schemaName ), ResultCodeEnum.UNWILLING_TO_PERFORM );
}
}
@@ -1597,7 +1597,7 @@ public class DefaultSchemaManager implem
else
{
// We have an invalid SchemaObject, no need to go any further
- Throwable error = new LdapOperationNotSupportedException( I18n.err( I18n.ERR_11007, schemaObject.getOid() ),
+ Throwable error = new LdapUnwillingToPerformException( I18n.err( I18n.ERR_11007, schemaObject.getOid() ),
ResultCodeEnum.UNWILLING_TO_PERFORM );
errors.add( error );
}
@@ -1652,7 +1652,7 @@ public class DefaultSchemaManager implem
if ( schemaName == null )
{
// The schema associated with the SchemzaObject does not exist. This is not valid.
- Throwable error = new LdapOperationNotSupportedException( I18n.err( I18n.ERR_11009, schemaObject.getOid(),
+ Throwable error = new LdapUnwillingToPerformException( I18n.err( I18n.ERR_11009, schemaObject.getOid(),
copy.getSchemaName() ), ResultCodeEnum.UNWILLING_TO_PERFORM );
errors.add( error );
Modified: directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java (original)
+++ directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerAddTest.java Tue Mar 16 00:31:36 2010
@@ -36,7 +36,7 @@ import javax.naming.NamingException;
import javax.naming.directory.NoSuchAttributeException;
import org.apache.commons.io.FileUtils;
-import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.LdapComparator;
@@ -1044,7 +1044,7 @@ public class SchemaManagerAddTest
assertEquals( 1, errors.size() );
Throwable error = errors.get( 0 );
- assertTrue( error instanceof LdapOperationNotSupportedException );
+ assertTrue( error instanceof LdapUnwillingToPerformException );
// Check that the new MR has been injected
assertFalse( isMRPresent( schemaManager, "1.1.0" ) );
Modified: directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java (original)
+++ directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadTest.java Tue Mar 16 00:31:36 2010
@@ -31,7 +31,7 @@ import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
-import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.DefaultSchemaLdifExtractor;
@@ -556,7 +556,7 @@ public class SchemaManagerLoadTest
schemaManager.loadWithDeps( "bad" );
fail();
}
- catch ( LdapOperationNotSupportedException lonse )
+ catch ( LdapUnwillingToPerformException lonse )
{
// expected
}
@@ -623,7 +623,7 @@ public class SchemaManagerLoadTest
assertFalse( schemaManager.load( "core", "bad", "cosine", "InetOrgPerson" ) );
fail();
}
- catch ( LdapOperationNotSupportedException lonse )
+ catch ( LdapUnwillingToPerformException lonse )
{
// expected
}
Modified: directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java (original)
+++ directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/SchemaManagerLoadWithDepsTest.java Tue Mar 16 00:31:36 2010
@@ -30,7 +30,7 @@ import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
-import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.DefaultSchemaLdifExtractor;
@@ -423,7 +423,7 @@ public class SchemaManagerLoadWithDepsTe
schemaManager.loadWithDeps( "bad" );
fail();
}
- catch ( LdapOperationNotSupportedException lonse )
+ catch ( LdapUnwillingToPerformException lonse )
{
// expected
}
@@ -485,7 +485,7 @@ public class SchemaManagerLoadWithDepsTe
schemaManager.loadWithDeps( "core", "bad", "InetOrgPerson" );
fail();
}
- catch ( LdapOperationNotSupportedException lonse )
+ catch ( LdapUnwillingToPerformException lonse )
{
// expected
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java Tue Mar 16 00:31:36 2010
@@ -20,7 +20,7 @@
package org.apache.directory.shared.ldap.codec;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.asn1.ber.IAsn1Container;
import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
@@ -1990,7 +1990,7 @@ public class LdapMessageGrammar extends
{
addRequest.addAttributeType( type );
}
- catch ( NamingException ne )
+ catch ( LdapException ne )
{
String msg = I18n.err( I18n.ERR_04087 );
log.error( msg );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.java Tue Mar 16 00:31:36 2010
@@ -25,7 +25,7 @@ import java.nio.ByteBuffer;
import java.util.LinkedList;
import java.util.List;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.asn1.ber.tlv.TLV;
import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
@@ -165,7 +165,7 @@ public class AddRequestCodec extends Lda
*
* @param type The attribute's name (called 'type' in the grammar)
*/
- public void addAttributeType( String type ) throws NamingException
+ public void addAttributeType( String type ) throws LdapException
{
// do not create a new attribute if we have seen this attributeType before
if ( entry.get( type ) != null )
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java Tue Mar 16 00:31:36 2010
@@ -25,7 +25,7 @@ import java.nio.ByteBuffer;
import java.util.LinkedList;
import java.util.List;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.asn1.ber.tlv.TLV;
import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
@@ -185,7 +185,7 @@ public class SearchResultEntryCodec exte
{
entry.put( currentAttributeValue );
}
- catch ( NamingException ne )
+ catch ( LdapException ne )
{
// Too bad... But there is nothing we can do.
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java Tue Mar 16 00:31:36 2010
@@ -19,7 +19,7 @@
*/
package org.apache.directory.shared.ldap.entry;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.schema.SyntaxChecker;
@@ -204,7 +204,7 @@ public abstract class AbstractValue i
*
* @see ServerValue#isValid()
*/
- public final boolean isValid( SyntaxChecker syntaxChecker ) throws NamingException
+ public final boolean isValid( SyntaxChecker syntaxChecker ) throws LdapException
{
if ( valid != null )
{
@@ -215,7 +215,7 @@ public abstract class AbstractValue i
{
String message = I18n.err( I18n.ERR_04139, toString() );
LOG.error( message );
- throw new NamingException( message );
+ throw new LdapException( message );
}
valid = syntaxChecker.isValidSyntax( getReference() );
@@ -227,9 +227,9 @@ public abstract class AbstractValue i
* Normalize the value. In order to use this method, the Value
* must be schema aware.
*
- * @exception NamingException If the value cannot be normalized
+ * @exception LdapException If the value cannot be normalized
*/
- public void normalize() throws NamingException
+ public void normalize() throws LdapException
{
normalized = true;
normalizedValue = wrapped;
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java Tue Mar 16 00:31:36 2010
@@ -23,7 +23,7 @@ import java.io.Externalizable;
import java.util.Iterator;
import java.util.List;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.name.DN;
@@ -129,9 +129,9 @@ public interface Entry extends Cloneable
* Add some Attributes to the current Entry.
*
* @param attributes The attributes to add
- * @throws NamingException If we can't add any of the attributes
+ * @throws LdapException If we can't add any of the attributes
*/
- void add( EntryAttribute... attributes ) throws NamingException;
+ void add( EntryAttribute... attributes ) throws LdapException;
/**
@@ -140,9 +140,9 @@ public interface Entry extends Cloneable
* @param upId The user provided ID of the attribute we want to add
* some values to
* @param values The list of String values to add
- * @throws NamingException If we can't add any of the values
+ * @throws LdapException If we can't add any of the values
*/
- void add( String upId, String... values ) throws NamingException;
+ void add( String upId, String... values ) throws LdapException;
/**
@@ -151,9 +151,9 @@ public interface Entry extends Cloneable
* @param upId The user provided ID of the attribute we want to add
* some values to
* @param values The list of binary values to add
- * @throws NamingException If we can't add any of the values
+ * @throws LdapException If we can't add any of the values
*/
- void add( String upId, byte[]... values ) throws NamingException;
+ void add( String upId, byte[]... values ) throws LdapException;
/**
@@ -162,9 +162,9 @@ public interface Entry extends Cloneable
* @param upId The user provided ID of the attribute we want to add
* some values to
* @param values The list of Values to add
- * @throws NamingException If we can't add any of the values
+ * @throws LdapException If we can't add any of the values
*/
- void add( String upId, Value>... values ) throws NamingException;
+ void add( String upId, Value>... values ) throws LdapException;
/**
@@ -180,9 +180,9 @@ public interface Entry extends Cloneable
* @param attributes the attributes to be put
* @return the old attributes with the same OID, if exist; otherwise
* null
- * @exception NamingException if the operation fails
+ * @exception LdapException if the operation fails
*/
- List put( EntryAttribute... attributes ) throws NamingException;
+ List put( EntryAttribute... attributes ) throws LdapException;
/**
@@ -241,7 +241,7 @@ public interface Entry extends Cloneable
* @param attributes the attributes to be removed
* @return the removed attribute, if exists; otherwise null
*/
- List remove( EntryAttribute... attributes ) throws NamingException;
+ List remove( EntryAttribute... attributes ) throws LdapException;
/**
@@ -265,7 +265,7 @@ public interface Entry extends Cloneable
* @return true
if at least a value is removed, false
* if not all the values have been removed or if the attribute does not exist.
*/
- boolean remove( String upId, byte[]... values ) throws NamingException;
+ boolean remove( String upId, byte[]... values ) throws LdapException;
/**
@@ -289,7 +289,7 @@ public interface Entry extends Cloneable
* @return true
if at least a value is removed, false
* if no values have been removed or if the attribute does not exist.
*/
- boolean remove( String upId, String... values ) throws NamingException;
+ boolean remove( String upId, String... values ) throws LdapException;
/**
@@ -313,7 +313,7 @@ public interface Entry extends Cloneable
* @return true
if at least a value is removed, false
* if not all the values have been removed or if the attribute does not exist.
*/
- boolean remove( String upId, Value>... values ) throws NamingException;
+ boolean remove( String upId, Value>... values ) throws LdapException;
/**
@@ -346,9 +346,9 @@ public interface Entry extends Cloneable
* @param attributes The Attributes to look for
* @return true
if all the attributes are found within
* the entry, false
if at least one of them is not present.
- * @throws NamingException If the attribute does not exist
+ * @throws LdapException If the attribute does not exist
*/
- boolean contains( EntryAttribute... attributes ) throws NamingException;
+ boolean contains( EntryAttribute... attributes ) throws LdapException;
/**
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java Tue Mar 16 00:31:36 2010
@@ -22,7 +22,7 @@ import java.io.Externalizable;
import java.util.Iterator;
import java.util.List;
-import javax.naming.directory.InvalidAttributeValueException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
/**
* A generic interface mocking the Attribute JNDI interface. This interface
@@ -257,9 +257,9 @@ public interface EntryAttribute extends
*
*
* @return The value as a byte[]
- * @throws InvalidAttributeValueException If the value is a String
+ * @throws LdapInvalidAttributeValueException If the value is a String
*/
- byte[] getBytes() throws InvalidAttributeValueException;
+ byte[] getBytes() throws LdapInvalidAttributeValueException;
/**
@@ -308,9 +308,9 @@ public interface EntryAttribute extends
*
*
* @return The value as a String
- * @throws InvalidAttributeValueException If the value is a byte[]
+ * @throws LdapInvalidAttributeValueException If the value is a byte[]
*/
- String getString() throws InvalidAttributeValueException;
+ String getString() throws LdapInvalidAttributeValueException;
/**
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java Tue Mar 16 00:31:36 2010
@@ -22,7 +22,7 @@ package org.apache.directory.shared.ldap
import java.io.Externalizable;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.schema.Normalizer;
import org.apache.directory.shared.ldap.schema.SyntaxChecker;
@@ -134,9 +134,9 @@ public interface Value extends Clonea
*
* @param checker the SyntaxChecker to use to validate the value
* @return true
if the value is valid
- * @exception NamingException if the value cannot be validated
+ * @exception LdapException if the value cannot be validated
*/
- boolean isValid( SyntaxChecker checker ) throws NamingException;
+ boolean isValid( SyntaxChecker checker ) throws LdapException;
/**
@@ -182,9 +182,9 @@ public interface Value extends Clonea
* Normalize the value. In order to use this method, the Value
* must be schema aware.
*
- * @exception NamingException if the value cannot be normalized
+ * @exception LdapException if the value cannot be normalized
*/
- void normalize() throws NamingException;
+ void normalize() throws LdapException;
/**
@@ -194,9 +194,9 @@ public interface Value extends Clonea
* appropriate normalizer.
*
* @param normalizer the normalizer to apply to the value
- * @exception NamingException if the value cannot be normalized
+ * @exception LdapException if the value cannot be normalized
*/
- void normalize( Normalizer normalizer ) throws NamingException;
+ void normalize( Normalizer normalizer ) throws LdapException;
/**
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java Tue Mar 16 00:31:36 2010
@@ -19,7 +19,7 @@
package org.apache.directory.shared.ldap.entry.client;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.schema.SyntaxChecker;
@@ -39,7 +39,7 @@ public interface ClientAttribute extends
*
* @param checker The syntax checker
* @return true if the attribute and it's values are valid, false otherwise
- * @throws NamingException if there is a failure to check syntaxes of values
+ * @throws LdapException if there is a failure to check syntaxes of values
*/
- boolean isValid( SyntaxChecker checker) throws NamingException;
+ boolean isValid( SyntaxChecker checker) throws LdapException;
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java Tue Mar 16 00:31:36 2010
@@ -25,7 +25,7 @@ import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Arrays;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.NotImplementedException;
@@ -159,7 +159,7 @@ public class ClientBinaryValue extends A
* determine how to properly normalize the wrapped value.
*
* @return the normalized version of the wrapped value
- * @throws NamingException if schema entity resolution fails or normalization fails
+ * @throws LdapException if schema entity resolution fails or normalization fails
*/
public byte[] getNormalizedValueCopy()
{
@@ -181,9 +181,9 @@ public class ClientBinaryValue extends A
* appropriate normalizer.
*
* @param Normalizer The normalizer to apply to the value
- * @exception NamingException If the value cannot be normalized
+ * @exception LdapException If the value cannot be normalized
*/
- public final void normalize( Normalizer normalizer ) throws NamingException
+ public final void normalize( Normalizer normalizer ) throws LdapException
{
if ( normalizer != null )
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java Tue Mar 16 00:31:36 2010
@@ -24,7 +24,7 @@ import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.NotImplementedException;
@@ -166,9 +166,9 @@ public class ClientStringValue extends A
* appropriate normalizer.
*
* @param Normalizer The normalizer to apply to the value
- * @exception NamingException If the value cannot be normalized
+ * @exception LdapException If the value cannot be normalized
*/
- public final void normalize( Normalizer normalizer ) throws NamingException
+ public final void normalize( Normalizer normalizer ) throws LdapException
{
if ( normalizer != null )
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java Tue Mar 16 00:31:36 2010
@@ -27,12 +27,13 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-import javax.naming.NamingException;
-import javax.naming.directory.InvalidAttributeValueException;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.SyntaxChecker;
import org.apache.directory.shared.ldap.util.StringTools;
import org.slf4j.Logger;
@@ -156,9 +157,9 @@ public class DefaultClientAttribute impl
*
*
* @return The value as a byte[]
- * @throws InvalidAttributeValueException If the value is a String
+ * @throws LdapInvalidAttributeValueException If the value is a String
*/
- public byte[] getBytes() throws InvalidAttributeValueException
+ public byte[] getBytes() throws LdapInvalidAttributeValueException
{
Value> value = get();
@@ -170,7 +171,7 @@ public class DefaultClientAttribute impl
{
String message = I18n.err( I18n.ERR_04130 );
LOG.error( message );
- throw new InvalidAttributeValueException( message );
+ throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, message );
}
}
@@ -185,9 +186,9 @@ public class DefaultClientAttribute impl
*
*
* @return The value as a String
- * @throws InvalidAttributeValueException If the value is a byte[]
+ * @throws LdapInvalidAttributeValueException If the value is a byte[]
*/
- public String getString() throws InvalidAttributeValueException
+ public String getString() throws LdapInvalidAttributeValueException
{
Value> value = get();
@@ -199,7 +200,7 @@ public class DefaultClientAttribute impl
{
String message = I18n.err( I18n.ERR_04131 );
LOG.error( message );
- throw new InvalidAttributeValueException( message );
+ throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, message );
}
}
@@ -308,9 +309,9 @@ public class DefaultClientAttribute impl
* Checks to see if this attribute is valid along with the values it contains.
*
* @return true if the attribute and it's values are valid, false otherwise
- * @throws NamingException if there is a failure to check syntaxes of values
+ * @throws LdapException if there is a failure to check syntaxes of values
*/
- public boolean isValid() throws NamingException
+ public boolean isValid() throws LdapException
{
for ( Value> value:values )
{
@@ -328,9 +329,9 @@ public class DefaultClientAttribute impl
* Checks to see if this attribute is valid along with the values it contains.
*
* @return true if the attribute and it's values are valid, false otherwise
- * @throws NamingException if there is a failure to check syntaxes of values
+ * @throws LdapException if there is a failure to check syntaxes of values
*/
- public boolean isValid( SyntaxChecker checker ) throws NamingException
+ public boolean isValid( SyntaxChecker checker ) throws LdapException
{
for ( Value> value : values )
{
@@ -979,7 +980,7 @@ public class DefaultClientAttribute impl
* the attribute is not specified.
*
*
- * This method will throw any NamingException
that occurs.
+ * This method will throw any LdapException
that occurs.
*
*
* @return an enumeration of all values of the attribute
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntry.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientEntry.java Tue Mar 16 00:31:36 2010
@@ -31,7 +31,7 @@ import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
-import javax.naming.NamingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.entry.AbstractEntry;
@@ -158,9 +158,9 @@ public final class DefaultClientEntry ex
* Add some Attributes to the current Entry.
*
* @param attributes The attributes to add
- * @throws NamingException If we can't add any of the attributes
+ * @throws LdapException If we can't add any of the attributes
*/
- public void add( EntryAttribute... attributes ) throws NamingException
+ public void add( EntryAttribute... attributes ) throws LdapException
{
// Loop on all the added attributes
for ( EntryAttribute attribute:attributes )
@@ -190,9 +190,9 @@ public final class DefaultClientEntry ex
*
* @param upId The attribute ID
* @param values The list of binary values to inject. It can be empty
- * @throws NamingException If the attribute does not exist
+ * @throws LdapException If the attribute does not exist
*/
- public void add( String upId, byte[]... values ) throws NamingException
+ public void add( String upId, byte[]... values ) throws LdapException
{
// First, transform the upID to a valid ID
String id = getId( upId );
@@ -223,9 +223,9 @@ public final class DefaultClientEntry ex
* @param upId The user provided ID of the attribute we want to add
* some values to
* @param values The list of String values to add
- * @throws NamingException If we can't add any of the values
+ * @throws LdapException If we can't add any of the values
*/
- public void add( String upId, String... values ) throws NamingException
+ public void add( String upId, String... values ) throws LdapException
{
// First, transform the upID to a valid ID
String id = getId( upId );
@@ -255,9 +255,9 @@ public final class DefaultClientEntry ex
*
* @param upId The attribute ID
* @param values The list of Value values to inject. It can be empty
- * @throws NamingException If the attribute does not exist
+ * @throws LdapException If the attribute does not exist
*/
- public void add( String upId, Value>... values ) throws NamingException
+ public void add( String upId, Value>... values ) throws LdapException
{
// First, transform the upID to a valid ID
String id = getId( upId );
@@ -333,9 +333,9 @@ public final class DefaultClientEntry ex
* @param attributes The Attributes to look for
* @return true
if all the attributes are found within
* the entry, false
if at least one of them is not present.
- * @throws NamingException If the attribute does not exist
+ * @throws LdapException If the attribute does not exist
*/
- public boolean contains( EntryAttribute... attributes ) throws NamingException
+ public boolean contains( EntryAttribute... attributes ) throws LdapException
{
for ( EntryAttribute attribute:attributes )
{
@@ -359,9 +359,9 @@ public final class DefaultClientEntry ex
*
* @param attributes The Attributes to look for
* @return true
if the attributes are found within the entry
- * @throws NamingException If the attribute does not exist
+ * @throws LdapException If the attribute does not exist
*/
- public boolean contains( String upId ) throws NamingException
+ public boolean contains( String upId ) throws LdapException
{
String id = getId( upId );
@@ -630,9 +630,9 @@ public final class DefaultClientEntry ex
* @param attributes the attributes to be put
* @return the old attributes with the same OID, if exist; otherwise
* null
- * @exception NamingException if the operation fails
+ * @exception LdapException if the operation fails
*/
- public List put( EntryAttribute... attributes ) throws NamingException
+ public List put( EntryAttribute... attributes ) throws LdapException
{
// First, get the existing attributes
List previous = new ArrayList();
@@ -657,7 +657,7 @@ public final class DefaultClientEntry ex
}
- public List remove( EntryAttribute... attributes ) throws NamingException
+ public List remove( EntryAttribute... attributes ) throws LdapException
{
List removedAttributes = new ArrayList();
@@ -746,7 +746,7 @@ public final class DefaultClientEntry ex
* @return true
if at least a value is removed, false
* if not all the values have been removed or if the attribute does not exist.
*/
- public boolean remove( String upId, byte[]... values ) throws NamingException
+ public boolean remove( String upId, byte[]... values ) throws LdapException
{
try
{
@@ -813,7 +813,7 @@ public final class DefaultClientEntry ex
* @return true
if at least a value is removed, false
* if not all the values have been removed or if the attribute does not exist.
*/
- public boolean remove( String upId, String... values ) throws NamingException
+ public boolean remove( String upId, String... values ) throws LdapException
{
try
{
@@ -880,7 +880,7 @@ public final class DefaultClientEntry ex
* @return true
if at least a value is removed, false
* if not all the values have been removed or if the attribute does not exist.
*/
- public boolean remove( String upId, Value>... values ) throws NamingException
+ public boolean remove( String upId, Value>... values ) throws LdapException
{
try
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidDnException.java Tue Mar 16 00:31:36 2010
@@ -39,7 +39,7 @@ public class LdapInvalidDnException exte
/**
* to be used by some special exceptions like TooComplexException
*/
- protected LdapInvalidDnException( String message )
+ public LdapInvalidDnException( String message )
{
super( message );
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java Tue Mar 16 00:31:36 2010
@@ -25,6 +25,7 @@ import java.util.List;
import java.util.regex.Pattern;
import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.schema.Normalizer;
import org.apache.directory.shared.ldap.util.StringTools;
@@ -197,7 +198,7 @@ public class SubstringNode extends LeafN
* @return the equivalent compiled regular expression
* @throws LdapInvalidDnException if there are problems while normalizing
*/
- public final Pattern getRegex( Normalizer normalizer ) throws LdapInvalidDnException
+ public final Pattern getRegex( Normalizer normalizer ) throws LdapException
{
boolean isBinary = false;
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java Tue Mar 16 00:31:36 2010
@@ -24,30 +24,26 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
-import javax.naming.AuthenticationException;
-import javax.naming.AuthenticationNotSupportedException;
-import javax.naming.CommunicationException;
-import javax.naming.ContextNotEmptyException;
-import javax.naming.InvalidNameException;
-import javax.naming.LimitExceededException;
-import javax.naming.NameAlreadyBoundException;
-import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-import javax.naming.NoPermissionException;
-import javax.naming.OperationNotSupportedException;
-import javax.naming.PartialResultException;
-import javax.naming.ServiceUnavailableException;
-import javax.naming.SizeLimitExceededException;
-import javax.naming.TimeLimitExceededException;
-import javax.naming.directory.AttributeInUseException;
-import javax.naming.directory.InvalidAttributeIdentifierException;
-import javax.naming.directory.InvalidAttributeValueException;
-import javax.naming.directory.InvalidSearchFilterException;
-import javax.naming.directory.NoSuchAttributeException;
-import javax.naming.directory.SchemaViolationException;
-
+import org.apache.directory.shared.ldap.codec.LdapEncoder;
import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
+import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
+import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
+import org.apache.directory.shared.ldap.exception.LdapAuthenticationNotSupportedException;
+import org.apache.directory.shared.ldap.exception.LdapContextNotEmptyException;
+import org.apache.directory.shared.ldap.exception.LdapEntryAlreadyExistsException;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeTypeException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidSearchFilterException;
+import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
+import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
+import org.apache.directory.shared.ldap.exception.LdapNoSuchObjectException;
import org.apache.directory.shared.ldap.exception.LdapOperationException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.exception.LdapServiceUnavailableException;
+import org.apache.directory.shared.ldap.exception.LdapTimeLimitExceededException;
+import org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException;
/**
@@ -2281,17 +2277,17 @@ public enum ResultCodeEnum
return Collections.singleton( rc );
}
- if ( t instanceof SchemaViolationException )
+ if ( t instanceof LdapSchemaViolationException )
{
return SCHEMAVIOLATIONEXCEPTION_CODES;
}
- if ( t instanceof InvalidNameException )
+ if ( t instanceof LdapInvalidDnException )
{
return INVALIDNAMEEXCEPTION_CODES;
}
- if ( t instanceof OperationNotSupportedException )
+ if ( t instanceof LdapUnwillingToPerformException )
{
return OPERATIONNOTSUPPOERTEXCEPTION_CODES;
}
@@ -2306,24 +2302,24 @@ public enum ResultCodeEnum
return PARTIAL_RESULTSEXCEPTION_CODES;
}
- if ( t instanceof InvalidAttributeValueException )
+ if ( t instanceof LdapInvalidAttributeValueException )
{
return INVALIDATTRIBUTEVALUEEXCEPTION_CODES;
}
- if ( t instanceof ServiceUnavailableException )
+ if ( t instanceof LdapServiceUnavailableException )
{
return SERVICEUNAVAILABLE_CODES;
}
- if ( t instanceof AuthenticationNotSupportedException )
+ if ( t instanceof LdapAuthenticationNotSupportedException )
{
return AUTHENTICATIONNOTSUPPOERTEDEXCEPTION_CODES;
}
// keep this last because others are subtypes and thier evaluation
// may be shorted otherwise by this comparison here
- if ( t instanceof NamingException )
+ if ( t instanceof LdapException )
{
return NAMINGEXCEPTION_CODES;
}
@@ -2369,12 +2365,12 @@ public enum ResultCodeEnum
return ( ( LdapOperationException ) t ).getResultCode();
}
- if ( t instanceof CommunicationException )
+ if ( t instanceof LdapCommunicationException )
{
return ResultCodeEnum.PROTOCOL_ERROR;
}
- if ( t instanceof TimeLimitExceededException )
+ if ( t instanceof LdapTimeLimitExceededException )
{
return ResultCodeEnum.TIME_LIMIT_EXCEEDED;
}
@@ -2384,47 +2380,47 @@ public enum ResultCodeEnum
return ResultCodeEnum.SIZE_LIMIT_EXCEEDED;
}
- if ( t instanceof AuthenticationException )
+ if ( t instanceof LdapAuthenticationException )
{
return ResultCodeEnum.INVALID_CREDENTIALS;
}
- if ( t instanceof NoPermissionException )
+ if ( t instanceof LdapNoPermissionException )
{
return ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS;
}
- if ( t instanceof NoSuchAttributeException )
+ if ( t instanceof LdapNoSuchAttributeException )
{
return ResultCodeEnum.NO_SUCH_ATTRIBUTE;
}
- if ( t instanceof InvalidAttributeIdentifierException )
+ if ( t instanceof LdapInvalidAttributeTypeException )
{
return ResultCodeEnum.UNDEFINED_ATTRIBUTE_TYPE;
}
- if ( t instanceof InvalidSearchFilterException )
+ if ( t instanceof LdapInvalidSearchFilterException )
{
return ResultCodeEnum.INAPPROPRIATE_MATCHING;
}
- if ( t instanceof AttributeInUseException )
+ if ( t instanceof LdapAttributeInUseException )
{
return ResultCodeEnum.ATTRIBUTE_OR_VALUE_EXISTS;
}
- if ( t instanceof NameNotFoundException )
+ if ( t instanceof LdapNoSuchObjectException )
{
return ResultCodeEnum.NO_SUCH_OBJECT;
}
- if ( t instanceof NameAlreadyBoundException )
+ if ( t instanceof LdapEntryAlreadyExistsException )
{
return ResultCodeEnum.ENTRY_ALREADY_EXISTS;
}
- if ( t instanceof ContextNotEmptyException )
+ if ( t instanceof LdapContextNotEmptyException )
{
return ResultCodeEnum.NOT_ALLOWED_ON_NON_LEAF;
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java Tue Mar 16 00:31:36 2010
@@ -22,9 +22,9 @@ package org.apache.directory.shared.ldap
import java.util.HashSet;
import java.util.Set;
-import javax.naming.NamingException;
import javax.naming.directory.SearchControls;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.filter.SearchScope;
import org.apache.directory.shared.ldap.message.control.Control;
import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -69,6 +69,9 @@ public class SearchParams
/** The set of controls for this search. Default to an empty set */
private Set controls;
+
+ /** TODO : Remove me ! */
+ private SearchControls searchControls;
/**
* Creates a new instance of SearchContext, with all the values set to
@@ -211,7 +214,7 @@ public class SearchParams
returningAttributes.add( attrOptions );
}
- catch ( NamingException ne )
+ catch ( LdapException ne )
{
LOG.warn( "Requested attribute {} does not exist in the schema, it will be ignored", returnAttribute );
// Unknown attributes should be silently ignored, as RFC 2251 states
@@ -271,6 +274,12 @@ public class SearchParams
}
+ public SearchControls getSearchControls()
+ {
+ return searchControls;
+ }
+
+
public static SearchParams toSearchParams( SearchControls searchControls, AliasDerefMode aliasDerefMode )
{
SearchParams searchParams = new SearchParams();
@@ -280,6 +289,17 @@ public class SearchParams
searchParams.setSizeLimit( searchControls.getCountLimit() );
searchParams.setScope( SearchScope.getSearchScope( searchControls.getSearchScope() ) );
searchParams.setTypesOnly( searchControls.getReturningObjFlag() );
+
+ if ( searchControls.getReturningAttributes() != null )
+ {
+ for ( String returningAttribute : searchControls.getReturningAttributes() )
+ {
+ searchParams.addReturningAttributes( returningAttribute );
+ }
+ }
+
+ searchParams.searchControls = searchControls;
+
return searchParams;
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java Tue Mar 16 00:31:36 2010
@@ -31,10 +31,10 @@ import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
-import javax.naming.InvalidNameException;
import javax.naming.Name;
import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
@@ -125,9 +125,9 @@ public class DN implements Name, Externa
* Transduces, or copies a Name to an DN.
*
* @param name composed of String name components.
- * @throws InvalidNameException If the Name is invalid.
+ * @throws LdapInvalidDnException If the Name is invalid.
*/
- public DN( Name name ) throws InvalidNameException
+ public DN( Name name ) throws LdapInvalidDnException
{
if ( ( name != null ) && ( name.size() != 0 ) )
{
@@ -153,7 +153,7 @@ public class DN implements Name, Externa
*
*
* @param upName The String that contains the DN.
- * @throws InvalidNameException if the String does not contain a valid DN.
+ * @throws LdapInvalidNameException if the String does not contain a valid DN.
*/
public DN( String upName ) throws LdapInvalidDnException
{
@@ -261,7 +261,7 @@ public class DN implements Name, Externa
* @param name The DN as a String
* @param oidsMap The OID mapping
* @return A valid DN
- * @throws InvalidNameException If the DN is invalid.
+ * @throws LdapInvalidNameException If the DN is invalid.
* @throws LdapInvalidDnException If something went wrong.
*/
public static Name normalize( String name, Map oidsMap ) throws LdapInvalidDnException
@@ -1058,7 +1058,7 @@ public class DN implements Name, Externa
/**
* {@inheritDoc}
*/
- public Name addAll( Name suffix ) throws InvalidNameException
+ public Name addAll( Name suffix ) throws LdapInvalidNameException
{
addAll( rdns.size(), suffix );
normalizeInternal();
@@ -1071,7 +1071,7 @@ public class DN implements Name, Externa
/**
* {@inheritDoc}
*/
- public Name addAll( int posn, Name name ) throws InvalidNameException
+ public Name addAll( int posn, Name name ) throws LdapInvalidNameException
{
if ( name instanceof DN )
{
@@ -1119,7 +1119,7 @@ public class DN implements Name, Externa
}
catch( LdapInvalidDnException le )
{
- throw new InvalidNameException( le.getMessage() );
+ throw new LdapInvalidNameException( le.getMessage() );
}
}
@@ -1134,7 +1134,7 @@ public class DN implements Name, Externa
/**
* {@inheritDoc}
*/
- public Name add( String comp ) throws InvalidNameException
+ public Name add( String comp ) throws LdapException
{
if ( comp.length() == 0 )
{
@@ -1152,7 +1152,7 @@ public class DN implements Name, Externa
}
catch( LdapInvalidDnException le )
{
- throw new InvalidNameException( le.getMessage() );
+ throw new LdapInvalidDnException( le.getMessage() );
}
normalizeInternal();
@@ -1231,7 +1231,7 @@ public class DN implements Name, Externa
/**
* {@inheritDoc}
*/
- public Name add( int posn, String comp ) throws InvalidNameException
+ public Name add( int posn, String comp ) throws LdapInvalidNameException
{
if ( ( posn < 0 ) || ( posn > size() ) )
{
@@ -1252,7 +1252,7 @@ public class DN implements Name, Externa
}
catch( LdapInvalidDnException le )
{
- throw new InvalidNameException( le.getMessage() );
+ throw new LdapInvalidNameException( le.getMessage() );
}
normalizeInternal();
@@ -1265,7 +1265,7 @@ public class DN implements Name, Externa
/**
* {@inheritDoc}
*/
- public Object remove( int posn ) throws InvalidNameException
+ public Object remove( int posn ) throws LdapInvalidNameException
{
if ( rdns.size() == 0 )
{
Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnCache.temp
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnCache.temp?rev=923524&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnCache.temp (added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DnCache.temp Tue Mar 16 00:31:36 2010
@@ -0,0 +1,40 @@
+
+package org.apache.directory.shared.ldap.name;
+
+import java.util.WeakHashMap;
+
+import javax.naming.InvalidNameException;
+
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
+
+public class DnCache
+{
+ private WeakHashMap cache;
+ private static DN ouDn;
+
+ static
+ {
+ try
+ {
+ ouDn = new DN( SchemaConstants.OU_SCHEMA );
+ }
+ catch ( InvalidNameException ine )
+ {
+ // Do nothing
+ }
+ }
+
+ public DnCache( int size )
+ {
+ cache = new WeakHashMap( size );
+
+ try
+ {
+ cache.put( SchemaConstants.OU_SCHEMA, ouDn );
+ }
+ catch ( InvalidNameException ine )
+ {
+ // Do nothing
+ }
+ }
+}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/NameComponentNormalizer.java Tue Mar 16 00:31:36 2010
@@ -22,7 +22,6 @@ package org.apache.directory.shared.ldap
import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
/**
@@ -47,9 +46,9 @@ public interface NameComponentNormalizer
*
* @param attributeName the name or OID of the attributeType
* @return the OID of the attributeType if it is recognized
- * @throws LdapInvalidDnException if the attributeName is not recognized as a valid alias
+ * @throws LdapException if the attributeName is not recognized as a valid alias
*/
- String normalizeName( String attributeName ) throws LdapInvalidDnException;
+ String normalizeName( String attributeName ) throws LdapException;
/**
* Normalizes an attribute's value given the name of the attribute - short
@@ -75,10 +74,10 @@ public interface NameComponentNormalizer
* @param value
* the value of the attribute to normalize
* @return the normalized value
- * @throws LdapInvalidDnException
+ * @throws LdapException
* if there is a recognition problem or a syntax issue
*/
- Object normalizeByName( String attributeName, byte[] value ) throws LdapInvalidDnException;
+ Object normalizeByName( String attributeName, byte[] value ) throws LdapException;
/**
@@ -89,10 +88,10 @@ public interface NameComponentNormalizer
* @param value
* the value of the attribute to normalize
* @return the normalized value
- * @throws LdapInvalidDnException
+ * @throws LdapException
* if there is a recognition problem or a syntax issue
*/
- Object normalizeByOid( String attributeOid, String value ) throws LdapInvalidDnException;
+ Object normalizeByOid( String attributeOid, String value ) throws LdapException;
/**
@@ -103,8 +102,8 @@ public interface NameComponentNormalizer
* @param value
* the value of the attribute to normalize
* @return the normalized value
- * @throws LdapInvalidDnException
+ * @throws LdapException
* if there is a recognition problem or a syntax issue
*/
- Object normalizeByOid( String attributeOid, byte[] value ) throws LdapInvalidDnException;
+ Object normalizeByOid( String attributeOid, byte[] value ) throws LdapException;
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/SimpleNameComponentNormalizer.java Tue Mar 16 00:31:36 2010
@@ -23,6 +23,7 @@ package org.apache.directory.shared.ldap
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -54,25 +55,25 @@ public class SimpleNameComponentNormaliz
}
- public Object normalizeByName( String name, String val ) throws LdapInvalidDnException
+ public Object normalizeByName( String name, String val ) throws LdapException
{
return normalizer.normalize( val );
}
- public Object normalizeByName( String name, byte[] val ) throws LdapInvalidDnException
+ public Object normalizeByName( String name, byte[] val ) throws LdapException
{
return normalizer.normalize( new ClientBinaryValue( val ) );
}
- public Object normalizeByOid( String oid, String val ) throws LdapInvalidDnException
+ public Object normalizeByOid( String oid, String val ) throws LdapException
{
return normalizer.normalize( val );
}
- public Object normalizeByOid( String oid, byte[] val ) throws LdapInvalidDnException
+ public Object normalizeByOid( String oid, byte[] val ) throws LdapException
{
return normalizer.normalize( new ClientBinaryValue( val ) );
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java?rev=923524&r1=923523&r2=923524&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java Tue Mar 16 00:31:36 2010
@@ -28,8 +28,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import javax.naming.NamingException;
-
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.schema.registries.Registries;
import org.apache.directory.shared.ldap.util.StringTools;
@@ -209,7 +208,7 @@ public abstract class AbstractSchemaObje
* @param errors The errors we got
* @param registries The Registries
*/
- public void addToRegistries( List errors, Registries registries ) throws NamingException
+ public void addToRegistries( List errors, Registries registries ) throws LdapException
{
// do nothing
}
@@ -222,7 +221,7 @@ public abstract class AbstractSchemaObje
* @param errors The errors we got
* @param registries The Registries
*/
- public void removeFromRegistries( List errors, Registries registries ) throws NamingException
+ public void removeFromRegistries( List errors, Registries registries ) throws LdapException
{
// do nothing
}
@@ -777,9 +776,9 @@ public abstract class AbstractSchemaObje
*
* @param schemaObject the SchemaObject we want to register
* @param registries The registries in which we want it to be stored
- * @throws NamingException If the OID is invalid
+ * @throws LdapException If the OID is invalid
*/
- public void registerOid( SchemaObject schemaObject, Registries registries ) throws NamingException
+ public void registerOid( SchemaObject schemaObject, Registries registries ) throws LdapException
{
// Add the SchemaObject into the globalOidRegistry
registries.getGlobalOidRegistry().register( schemaObject );