You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2010/03/16 15:09:39 UTC
svn commit: r923747 [2/3] - in /directory/apacheds/trunk/core/src:
main/java/org/apache/directory/server/core/
main/java/org/apache/directory/server/core/authn/
main/java/org/apache/directory/server/core/authz/
main/java/org/apache/directory/server/cor...
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java Tue Mar 16 14:09:38 2010
@@ -33,6 +33,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.DITContentRule;
@@ -84,7 +85,7 @@ public class DefaultSchemaService implem
/* (non-Javadoc)
* @see org.apache.directory.server.core.schema.SchemaService#isSchemaSubentry(java.lang.String)
*/
- public boolean isSchemaSubentry( String dnString ) throws NamingException
+ public boolean isSchemaSubentry( String dnString ) throws LdapException
{
if ( ServerDNConstants.CN_SCHEMA_DN.equalsIgnoreCase( dnString ) ||
ServerDNConstants.CN_SCHEMA_DN_NORMALIZED.equalsIgnoreCase( dnString ) )
@@ -124,7 +125,7 @@ public class DefaultSchemaService implem
/**
* Generate the comparators attribute from the registry
*/
- private ServerAttribute generateComparators() throws NamingException
+ private ServerAttribute generateComparators() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.COMPARATORS_AT ) );
@@ -138,7 +139,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateNormalizers() throws NamingException
+ private ServerAttribute generateNormalizers() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.NORMALIZERS_AT ) );
@@ -154,7 +155,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateSyntaxCheckers() throws NamingException
+ private ServerAttribute generateSyntaxCheckers() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.SYNTAX_CHECKERS_AT ) );
@@ -168,7 +169,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateObjectClasses() throws NamingException
+ private ServerAttribute generateObjectClasses() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASSES_AT ) );
@@ -182,7 +183,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateAttributeTypes() throws NamingException
+ private ServerAttribute generateAttributeTypes() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.ATTRIBUTE_TYPES_AT ) );
@@ -196,7 +197,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateMatchingRules() throws NamingException
+ private ServerAttribute generateMatchingRules() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.MATCHING_RULES_AT ) );
@@ -210,7 +211,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateMatchingRuleUses() throws NamingException
+ private ServerAttribute generateMatchingRuleUses() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.MATCHING_RULE_USE_AT ) );
@@ -224,7 +225,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateSyntaxes() throws NamingException
+ private ServerAttribute generateSyntaxes() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.LDAP_SYNTAXES_AT ) );
@@ -238,7 +239,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateDitContextRules() throws NamingException
+ private ServerAttribute generateDitContextRules() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.DIT_CONTENT_RULES_AT ) );
@@ -252,7 +253,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateDitStructureRules() throws NamingException
+ private ServerAttribute generateDitStructureRules() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.DIT_STRUCTURE_RULES_AT ) );
@@ -266,7 +267,7 @@ public class DefaultSchemaService implem
}
- private ServerAttribute generateNameForms() throws NamingException
+ private ServerAttribute generateNameForms() throws LdapException
{
ServerAttribute attr = new DefaultServerAttribute(
getSchemaManager().lookupAttributeTypeRegistry( SchemaConstants.NAME_FORMS_AT ) );
@@ -283,7 +284,7 @@ public class DefaultSchemaService implem
/**
* Creates the SSSE by extracting all the SchemaObjects from the registries.
*/
- private void generateSchemaSubentry( ServerEntry mods ) throws NamingException
+ private void generateSchemaSubentry( ServerEntry mods ) throws LdapException
{
ServerEntry attrs = new DefaultServerEntry( getSchemaManager(), mods.getDn() );
@@ -340,7 +341,7 @@ public class DefaultSchemaService implem
}
- private void addAttribute( ServerEntry attrs, String id ) throws NamingException
+ private void addAttribute( ServerEntry attrs, String id ) throws LdapException
{
EntryAttribute attr = schemaSubentry.get( id );
@@ -382,7 +383,7 @@ public class DefaultSchemaService implem
schemaModificationAttributesDN.normalize(
getSchemaManager().getNormalizerMapping() );
}
- catch ( NamingException e )
+ catch ( LdapException e )
{
throw new RuntimeException( e );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java Tue Mar 16 14:09:38 2010
@@ -25,8 +25,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import javax.naming.NamingException;
-
import org.apache.directory.server.core.entry.ServerAttribute;
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.i18n.I18n;
@@ -34,6 +32,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.ModificationOperation;
import org.apache.directory.shared.ldap.entry.Value;
+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.name.DN;
@@ -70,11 +69,11 @@ public class SchemaChecker
* @param mod the type of modification operation being performed (should be
* REMOVE_ATTRIBUTE)
* @param attribute the attribute being modified
- * @throws NamingException if modify operations leave the entry inconsistent
+ * @throws LdapException if modify operations leave the entry inconsistent
* without a STRUCTURAL objectClass
*/
public static void preventStructuralClassRemovalOnModifyReplace( SchemaManager schemaManager, DN name, ModificationOperation mod,
- ServerAttribute attribute ) throws NamingException
+ ServerAttribute attribute ) throws LdapException
{
if ( mod != ModificationOperation.REPLACE_ATTRIBUTE )
{
@@ -97,7 +96,7 @@ public class SchemaChecker
log.info( msg + ". Raising LdapSchemaViolationException." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED, msg );
}
// check that there is at least one structural objectClass in the replacement set
@@ -118,7 +117,7 @@ public class SchemaChecker
{
log.info( msg + ". Raising LdapSchemaViolationException." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED, msg );
}
@@ -132,11 +131,11 @@ public class SchemaChecker
* @param mod the type of modification operation being performed (should be
* REMOVE_ATTRIBUTE)
* @param entry the entry being modified
- * @throws NamingException if modify operations leave the entry inconsistent
+ * @throws LdapException if modify operations leave the entry inconsistent
* without a STRUCTURAL objectClass
*/
public static void preventStructuralClassRemovalOnModifyReplace(
- ObjectClassRegistry registry, DN name, ModificationOperation mod, ServerEntry entry ) throws NamingException
+ ObjectClassRegistry registry, DN name, ModificationOperation mod, ServerEntry entry ) throws LdapException
{
if ( mod != ModificationOperation.REPLACE_ATTRIBUTE )
{
@@ -159,7 +158,7 @@ public class SchemaChecker
{
log.info( msg + ". Raising LdapSchemaViolationException." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED, msg );
}
// check that there is at least one structural objectClass in the replacement set
@@ -180,7 +179,7 @@ public class SchemaChecker
{
log.info( msg + ". Raising LdapSchemaViolationException." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED, msg );
}
@@ -195,11 +194,11 @@ public class SchemaChecker
* REMOVE_ATTRIBUTE)
* @param attribute the attribute being modified
* @param entryObjectClasses the entry being modified
- * @throws NamingException if modify operations leave the entry inconsistent
+ * @throws LdapException if modify operations leave the entry inconsistent
* without a STRUCTURAL objectClass
*/
public static void preventStructuralClassRemovalOnModifyRemove( SchemaManager schemaManager, DN name, ModificationOperation mod,
- EntryAttribute attribute, EntryAttribute entryObjectClasses ) throws NamingException
+ EntryAttribute attribute, EntryAttribute entryObjectClasses ) throws LdapException
{
if ( mod != ModificationOperation.REMOVE_ATTRIBUTE )
{
@@ -241,7 +240,7 @@ public class SchemaChecker
log.info( msg + ". Raising LdapSchemaViolationException." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED, msg );
}
// remove all the objectClass attribute values from a cloned copy and then
@@ -275,7 +274,7 @@ public class SchemaChecker
log.info( msg + ". Raising LdapSchemaViolationException." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_MODS_PROHIBITED, msg );
}
@@ -379,11 +378,11 @@ public class SchemaChecker
* @param mod the modification operation being performed (should be REPLACE_ATTRIBUTE )
* @param attribute the attribute being modified
* @param oidRegistry
- * @throws NamingException if the modify operation is removing an Rdn attribute
+ * @throws LdapException if the modify operation is removing an Rdn attribute
*/
public static void preventRdnChangeOnModifyReplace( DN name, ModificationOperation mod,
ServerAttribute attribute, SchemaManager schemaManager )
- throws NamingException
+ throws LdapException
{
if ( mod != ModificationOperation.REPLACE_ATTRIBUTE )
{
@@ -409,7 +408,7 @@ public class SchemaChecker
{
log.info( msg + ". SchemaChecker is throwing a schema violation exception." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
// from here on the modify operation replaces specific values
@@ -429,7 +428,7 @@ public class SchemaChecker
{
log.info( msg + ". SchemaChecker is throwing a schema violation exception." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
}
}
@@ -453,12 +452,12 @@ public class SchemaChecker
* @param mod the modification operation being performed (should be REPLACE_ATTRIBUTE )
* @param entry
* @param oidRegistry
- * @throws NamingException if the modify operation is removing an Rdn attribute
+ * @throws LdapException if the modify operation is removing an Rdn attribute
*/
public static void preventRdnChangeOnModifyReplace(
DN name, ModificationOperation mod, ServerEntry entry,
SchemaManager schemaManager )
- throws NamingException
+ throws LdapException
{
if ( mod != ModificationOperation.REPLACE_ATTRIBUTE )
{
@@ -487,7 +486,7 @@ public class SchemaChecker
log.info( msg + ". SchemaChecker is throwing a schema violation exception." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
// from here on the modify operation replaces specific values
@@ -506,7 +505,7 @@ public class SchemaChecker
log.info( msg + ". SchemaChecker is throwing a schema violation exception." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
}
}
@@ -530,10 +529,10 @@ public class SchemaChecker
* @param name the distinguished name of the attribute being modified
* @param mod the modification operation being performed (should be REMOVE_ATTRIBUTE )
* @param attribute the attribute being modified
- * @throws NamingException if the modify operation is removing an Rdn attribute
+ * @throws LdapException if the modify operation is removing an Rdn attribute
*/
public static void preventRdnChangeOnModifyRemove( DN name, ModificationOperation mod, ServerAttribute attribute,
- SchemaManager schemaManager ) throws NamingException
+ SchemaManager schemaManager ) throws LdapException
{
if ( mod != ModificationOperation.REMOVE_ATTRIBUTE )
{
@@ -560,7 +559,7 @@ public class SchemaChecker
log.info( msg + ". SchemaChecker is throwing a schema violation exception." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
// from here on the modify operation only deletes specific values
@@ -579,7 +578,7 @@ public class SchemaChecker
log.info( msg + ". SchemaChecker is throwing a schema violation exception." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
}
}
@@ -603,11 +602,11 @@ public class SchemaChecker
* @param mod the modification operation being performed (should be REMOVE_ATTRIBUTE )
* @param entry
* @param oidRegistry
- * @throws NamingException if the modify operation is removing an Rdn attribute
+ * @throws LdapException if the modify operation is removing an Rdn attribute
*/
public static void preventRdnChangeOnModifyRemove( DN name, ModificationOperation mod,
ServerEntry entry, SchemaManager schemaManager )
- throws NamingException
+ throws LdapException
{
if ( mod != ModificationOperation.REMOVE_ATTRIBUTE )
{
@@ -633,7 +632,7 @@ public class SchemaChecker
{
log.info( msg + ". SchemaChecker is throwing a schema violation exception." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
// from here on the modify operation only deletes specific values
@@ -652,7 +651,7 @@ public class SchemaChecker
{
log.info( msg + ". SchemaChecker is throwing a schema violation exception." );
}
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
}
}
@@ -669,9 +668,9 @@ public class SchemaChecker
* @param oidRegistry the OID registry
* @return the Rdn attribute value corresponding to the id, or null if the
* attribute is not an rdn attribute
- * @throws NamingException if the name is malformed in any way
+ * @throws LdapException if the name is malformed in any way
*/
- private static String getRdnValue( String id, DN name, SchemaManager schemaManager ) throws NamingException
+ private static String getRdnValue( String id, DN name, SchemaManager schemaManager ) throws LdapException
{
// Transform the rdnAttrId to it's OID counterPart
String idOid = schemaManager.getAttributeTypeRegistry().getOidByName( id );
@@ -679,7 +678,7 @@ public class SchemaChecker
if ( idOid == null )
{
log.error( I18n.err( I18n.ERR_43, id ) );
- throw new NamingException( I18n.err( I18n.ERR_44, id ) );
+ throw new LdapException( I18n.err( I18n.ERR_44, id ) );
}
String[] comps = NamespaceTools.getCompositeComponents( name.get( name.size() - 1 ) );
@@ -694,7 +693,7 @@ public class SchemaChecker
if ( rdnAttrOid == null )
{
log.error( I18n.err( I18n.ERR_43, rdnAttrOid ) );
- throw new NamingException( I18n.err( I18n.ERR_44, rdnAttrOid ) );
+ throw new LdapException( I18n.err( I18n.ERR_44, rdnAttrOid ) );
}
if ( rdnAttrOid.equalsIgnoreCase( idOid ) )
@@ -713,9 +712,9 @@ public class SchemaChecker
*
* @param name the distinguished name of an entry
* @return the set of attributes composing the Rdn for the name
- * @throws NamingException if the syntax of the Rdn is incorrect
+ * @throws LdapException if the syntax of the Rdn is incorrect
*/
- private static Set<String> getRdnAttributes( DN name ) throws NamingException
+ private static Set<String> getRdnAttributes( DN name ) throws LdapException
{
String[] comps = NamespaceTools.getCompositeComponents( name.get( name.size() - 1 ) );
Set<String> attributes = new HashSet<String>();
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Tue Mar 16 14:09:38 2010
@@ -30,9 +30,6 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import javax.naming.NamingException;
-import javax.naming.NoPermissionException;
-import javax.naming.directory.InvalidAttributeValueException;
import javax.naming.directory.SearchControls;
import org.apache.directory.server.constants.ServerDNConstants;
@@ -71,8 +68,10 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeTypeException;
import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.filter.ApproximateNode;
@@ -537,7 +536,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_47 );
LOG.error( message );
- throw new NamingException( message );
+ throw new LdapException( message );
}
}
}
@@ -553,7 +552,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_48 );
LOG.error( message );
- throw new NamingException( message );
+ throw new LdapException( message );
}
}
}
@@ -573,7 +572,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_49 );
LOG.error( message );
- throw new NamingException( message );
+ throw new LdapException( message );
}
if ( filter.isLeaf() )
@@ -598,7 +597,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_50 );
LOG.error( message );
- throw new NamingException( message );
+ throw new LdapException( message );
}
}
else if ( filter instanceof PresenceNode )
@@ -638,7 +637,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_51 );
LOG.error( message );
- throw new NamingException( message );
+ throw new LdapException( message );
}
}
else if ( filter instanceof ApproximateNode )
@@ -1154,7 +1153,7 @@ public class SchemaInterceptor extends B
if ( !attributeType.isUserModifiable() )
{
- throw new NoPermissionException( "Cannot modify the attribute '" + atav.getUpType() + "'" );
+ throw new LdapNoPermissionException( "Cannot modify the attribute '" + atav.getUpType() + "'" );
}
}
}
@@ -1208,7 +1207,7 @@ public class SchemaInterceptor extends B
{
String msg = I18n.err( I18n.ERR_52, attributeType );
LOG.error( msg );
- throw new NoPermissionException( msg );
+ throw new LdapNoPermissionException( msg );
}
}
@@ -1221,8 +1220,8 @@ public class SchemaInterceptor extends B
// The value syntax is incorrect : this is an error
String msg = I18n.err( I18n.ERR_53, attributeType );
LOG.error( msg );
- throw new LdapInvalidAttributeValueException( msg,
- ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+ throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
+ msg );
}
EntryAttribute currentAttribute = tempEntry.get( attributeType );
@@ -1449,7 +1448,7 @@ public class SchemaInterceptor extends B
result.remove( attribute );
}
}
- catch ( NamingException ne )
+ catch ( LdapException ne )
{
// Do nothings
}
@@ -1642,7 +1641,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_57 );
LOG.error( message );
- throw new LdapSchemaViolationException( message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, message );
}
break;
@@ -1652,7 +1651,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_58 );
LOG.error( message );
- throw new LdapSchemaViolationException( message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, message );
}
break;
@@ -1661,12 +1660,12 @@ public class SchemaInterceptor extends B
break;
}
}
- catch ( NamingException ne )
+ catch ( LdapException ne )
{
// The superior OC does not exist : this is an error
String message = I18n.err( I18n.ERR_59 );
LOG.error( message );
- throw new LdapSchemaViolationException( message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, message );
}
}
}
@@ -1735,11 +1734,11 @@ public class SchemaInterceptor extends B
}
- private String getSchemaName( DN dn ) throws NamingException
+ private String getSchemaName( DN dn ) throws LdapException
{
if ( dn.size() < 2 )
{
- throw new NamingException( I18n.err( I18n.ERR_276 ) );
+ throw new LdapException( I18n.err( I18n.ERR_276 ) );
}
RDN rdn = dn.getRdn( 1 );
@@ -1775,8 +1774,8 @@ public class SchemaInterceptor extends B
{
if ( !allowed.contains( attrOid ) )
{
- throw new LdapSchemaViolationException( I18n.err( I18n.ERR_277, attribute.getUpId(),
- dn.getName() ), ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, I18n.err( I18n.ERR_277, attribute.getUpId(),
+ dn.getName() ) );
}
}
}
@@ -1786,7 +1785,7 @@ public class SchemaInterceptor extends B
/**
* Checks to see number of values of an attribute conforms to the schema
*/
- private void assertNumberOfAttributeValuesValid( Entry entry ) throws InvalidAttributeValueException, Exception
+ private void assertNumberOfAttributeValuesValid( Entry entry ) throws LdapInvalidAttributeValueException
{
for ( EntryAttribute attribute : entry )
{
@@ -1798,13 +1797,12 @@ public class SchemaInterceptor extends B
/**
* Checks to see numbers of values of attributes conforms to the schema
*/
- private void assertNumberOfAttributeValuesValid( EntryAttribute attribute ) throws InvalidAttributeValueException,
- Exception
+ private void assertNumberOfAttributeValuesValid( EntryAttribute attribute ) throws LdapInvalidAttributeValueException
{
if ( attribute.size() > 1 && ( ( ServerAttribute ) attribute ).getAttributeType().isSingleValued() )
{
- throw new LdapInvalidAttributeValueException( I18n.err( I18n.ERR_278, attribute.getUpId() ),
- ResultCodeEnum.CONSTRAINT_VIOLATION );
+ throw new LdapInvalidAttributeValueException( ResultCodeEnum.CONSTRAINT_VIOLATION,
+ I18n.err( I18n.ERR_278, attribute.getUpId() ) );
}
}
@@ -1821,8 +1819,8 @@ public class SchemaInterceptor extends B
if ( must.size() != 0 )
{
- throw new LdapSchemaViolationException( I18n.err( I18n.ERR_279, must, dn.getName() ),
- ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION,
+ I18n.err( I18n.ERR_279, must, dn.getName() ) );
}
}
@@ -1864,7 +1862,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_60, dn );
LOG.error( message );
- throw new LdapSchemaViolationException( message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, message );
}
// --------------------------------------------------------------------
@@ -1896,7 +1894,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_61, dn, remaining );
LOG.error( message );
- throw new LdapSchemaViolationException( message, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, message );
}
}
@@ -1937,7 +1935,7 @@ public class SchemaInterceptor extends B
String message = I18n.err( I18n.ERR_280, value.getString(), attribute.getUpId() );
LOG.info( message );
- throw new LdapInvalidAttributeValueException( message, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+ throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, message );
}
}
}
@@ -1954,7 +1952,7 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_62, dn, atav.getUpType() );
LOG.error( message );
- throw new LdapSchemaViolationException( message, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, message );
}
}
}
@@ -1989,12 +1987,12 @@ public class SchemaInterceptor extends B
}
catch ( UnsupportedEncodingException uee )
{
- throw new NamingException( I18n.err( I18n.ERR_281 ) );
+ throw new LdapException( I18n.err( I18n.ERR_281 ) );
}
}
else
{
- throw new NamingException( I18n.err( I18n.ERR_282 ) );
+ throw new LdapException( I18n.err( I18n.ERR_282 ) );
}
}
@@ -2034,14 +2032,14 @@ public class SchemaInterceptor extends B
{
String message = I18n.err( I18n.ERR_63 );
LOG.error( message );
- throw new NamingException( message );
+ throw new LdapException( message );
}
}
else
{
String message = I18n.err( I18n.ERR_64 );
LOG.error( message );
- throw new NamingException( message );
+ throw new LdapException( message );
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java Tue Mar 16 14:09:38 2010
@@ -25,7 +25,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import org.apache.directory.server.core.entry.ServerAttribute;
@@ -176,8 +175,8 @@ public class SchemaSubentryManager
break;
case REPLACE_ATTRIBUTE :
- throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_283 ),
- ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+ I18n.err( I18n.ERR_283 ) );
default:
throw new IllegalStateException( I18n.err( I18n.ERR_284, mod.getOperation() ) );
@@ -215,8 +214,8 @@ public class SchemaSubentryManager
break;
case( DirContext.REPLACE_ATTRIBUTE ):
- throw new LdapUnwillingToPerformException( I18n.err( I18n.ERR_283 ),
- ResultCodeEnum.UNWILLING_TO_PERFORM );
+ throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
+ I18n.err( I18n.ERR_283 ) );
default:
throw new IllegalStateException( I18n.err( I18n.ERR_284, modOp ) );
@@ -231,7 +230,7 @@ public class SchemaSubentryManager
* @param mods the attribute with the modifications
* @param doCascadeModify determines if a cascading operation should be performed
* to effect all dependents on the changed entity
- * @throws NamingException if there are problems updating the registries and the
+ * @throws Exception if there are problems updating the registries and the
* schema partition
*/
private void modifyRemoveOperation( ModifyOperationContext opContext, String opAttrOid,
@@ -342,7 +341,7 @@ public class SchemaSubentryManager
* @param mods the attribute with the modifications
* @param doCascadeModify determines if a cascading operation should be performed
* to effect all dependents on the changed entity
- * @throws NamingException if there are problems updating the registries and the
+ * @throws Exception if there are problems updating the registries and the
* schema partition
*/
private void modifyAddOperation( ModifyOperationContext opContext, String opAttrOid,
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java Tue Mar 16 14:09:38 2010
@@ -25,8 +25,6 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
-import javax.naming.NamingException;
-
import org.apache.directory.server.core.authn.AuthenticationInterceptor;
import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
@@ -38,6 +36,7 @@ import org.apache.directory.server.utils
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.LdapInvalidDnException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.DITContentRule;
@@ -97,7 +96,7 @@ public class SchemaSubentryModifier
}
- private DN getDn( SchemaObject obj ) throws NamingException
+ private DN getDn( SchemaObject obj ) throws LdapInvalidDnException
{
StringBuffer buf = new StringBuffer();
buf.append( "m-oid=" ).append( obj.getOid() ).append( ",ou=" );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/TlsKeyGenerator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/TlsKeyGenerator.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/TlsKeyGenerator.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/TlsKeyGenerator.java Tue Mar 16 14:09:38 2010
@@ -30,11 +30,6 @@ import java.security.NoSuchAlgorithmExce
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Security;
-import java.util.Date;
-
-import javax.naming.NamingException;
-import javax.security.auth.x500.X500Principal;
-
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
@@ -42,11 +37,15 @@ import java.security.spec.EncodedKeySpec
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
+import java.util.Date;
+
+import javax.security.auth.x500.X500Principal;
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.x509.X509V1CertificateGenerator;
import org.slf4j.Logger;
@@ -105,9 +104,9 @@ public class TlsKeyGenerator
*
* @param entry the TLS key/cert entry
* @return the X509 certificate associated with that entry
- * @throws NamingException if there are problems accessing or decoding
+ * @throws LdapException if there are problems accessing or decoding
*/
- public static X509Certificate getCertificate( ServerEntry entry ) throws NamingException
+ public static X509Certificate getCertificate( ServerEntry entry ) throws LdapException
{
X509Certificate cert = null;
CertificateFactory certFactory = null;
@@ -118,8 +117,8 @@ public class TlsKeyGenerator
}
catch ( Exception e )
{
- NamingException ne = new NamingException( I18n.err( I18n.ERR_286 ) );
- ne.setRootCause( e );
+ LdapException ne = new LdapException( I18n.err( I18n.ERR_286 ) );
+ ne.initCause( e );
throw ne;
}
@@ -132,8 +131,8 @@ public class TlsKeyGenerator
}
catch ( CertificateException e )
{
- NamingException ne = new NamingException( I18n.err( I18n.ERR_287 ) );
- ne.setRootCause( e );
+ LdapException ne = new LdapException( I18n.err( I18n.ERR_287 ) );
+ ne.initCause( e );
throw ne;
}
@@ -146,9 +145,9 @@ public class TlsKeyGenerator
*
* @param entry an entry of the tlsKeyInfo objectClass
* @return the private and public key pair
- * @throws NamingException if there are format or access issues
+ * @throws LdapException if there are format or access issues
*/
- public static KeyPair getKeyPair( ServerEntry entry ) throws NamingException
+ public static KeyPair getKeyPair( ServerEntry entry ) throws LdapException
{
PublicKey publicKey = null;
PrivateKey privateKey = null;
@@ -160,8 +159,8 @@ public class TlsKeyGenerator
}
catch ( Exception e )
{
- NamingException ne = new NamingException( I18n.err( I18n.ERR_288, ALGORITHM ) );
- ne.setRootCause( e );
+ LdapException ne = new LdapException( I18n.err( I18n.ERR_288, ALGORITHM ) );
+ ne.initCause( e );
throw ne;
}
@@ -172,8 +171,8 @@ public class TlsKeyGenerator
}
catch ( Exception e )
{
- NamingException ne = new NamingException( I18n.err( I18n.ERR_289 ) );
- ne.setRootCause( e );
+ LdapException ne = new LdapException( I18n.err( I18n.ERR_289 ) );
+ ne.initCause( e );
throw ne;
}
@@ -184,8 +183,8 @@ public class TlsKeyGenerator
}
catch ( InvalidKeySpecException e )
{
- NamingException ne = new NamingException( I18n.err( I18n.ERR_290 ) );
- ne.setRootCause( e );
+ LdapException ne = new LdapException( I18n.err( I18n.ERR_290 ) );
+ ne.initCause( e );
throw ne;
}
@@ -205,9 +204,9 @@ public class TlsKeyGenerator
* concerns.
*
* @param entry the entry to add security attributes to
- * @throws NamingException on problems generating the content in the entry
+ * @throws LdapException on problems generating the content in the entry
*/
- public static void addKeyPair( ServerEntry entry ) throws NamingException
+ public static void addKeyPair( ServerEntry entry ) throws LdapException
{
EntryAttribute objectClass = entry.get( SchemaConstants.OBJECT_CLASS_AT );
@@ -227,8 +226,8 @@ public class TlsKeyGenerator
}
catch ( NoSuchAlgorithmException e )
{
- NamingException ne = new NamingException( I18n.err( I18n.ERR_291 ) );
- ne.setRootCause( e );
+ LdapException ne = new LdapException( I18n.err( I18n.ERR_291 ) );
+ ne.initCause( e );
throw ne;
}
@@ -271,8 +270,8 @@ public class TlsKeyGenerator
}
catch ( Exception e )
{
- NamingException ne = new NamingException( I18n.err( I18n.ERR_292 ) );
- ne.setRootCause( e );
+ LdapException ne = new LdapException( I18n.err( I18n.ERR_292 ) );
+ ne.initCause( e );
throw ne;
}
@@ -286,7 +285,7 @@ public class TlsKeyGenerator
* TODO the code is duplicate atm, will eliminate this redundancy after finding
* a better thought (an instant one is to call this method from the aboveaddKeyPair(entry) and remove the impl there)
*/
- public static void addKeyPair( ServerEntry entry, String issuerDN, String subjectDN, String keyAlgo ) throws NamingException
+ public static void addKeyPair( ServerEntry entry, String issuerDN, String subjectDN, String keyAlgo ) throws LdapException
{
EntryAttribute objectClass = entry.get( SchemaConstants.OBJECT_CLASS_AT );
@@ -306,8 +305,8 @@ public class TlsKeyGenerator
}
catch ( NoSuchAlgorithmException e )
{
- NamingException ne = new NamingException( I18n.err( I18n.ERR_291 ) );
- ne.setRootCause( e );
+ LdapException ne = new LdapException( I18n.err( I18n.ERR_291 ) );
+ ne.initCause( e );
throw ne;
}
@@ -351,8 +350,8 @@ public class TlsKeyGenerator
}
catch ( Exception e )
{
- NamingException ne = new NamingException( I18n.err( I18n.ERR_292 ) );
- ne.setRootCause( e );
+ LdapException ne = new LdapException( I18n.err( I18n.ERR_292 ) );
+ ne.initCause( e );
throw ne;
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java Tue Mar 16 14:09:38 2010
@@ -24,7 +24,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import javax.naming.NamingException;
import org.apache.directory.server.constants.ApacheSchemaConstants;
import org.apache.directory.server.core.DirectoryService;
@@ -36,6 +35,7 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.filter.AndNode;
import org.apache.directory.shared.ldap.filter.BranchNode;
import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -69,7 +69,7 @@ public class LdapClassLoader extends Cla
private DirectoryService directoryService;
- public LdapClassLoader( DirectoryService directoryService ) throws NamingException
+ public LdapClassLoader( DirectoryService directoryService ) throws LdapException
{
super( LdapClassLoader.class.getClassLoader() );
this.directoryService = directoryService;
@@ -148,7 +148,7 @@ public class LdapClassLoader extends Cla
{
configEntry = directoryService.getAdminSession().lookup( defaultSearchDn );
}
- catch ( NamingException e )
+ catch ( LdapException e )
{
log.debug( "No configuration data found for class loader default search contexts." );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java Tue Mar 16 14:09:38 2010
@@ -24,7 +24,6 @@ import java.util.Collections;
import java.util.List;
import java.util.Set;
-import javax.naming.NamingException;
import javax.naming.directory.SearchControls;
import org.apache.directory.server.core.CoreSession;
@@ -34,6 +33,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.filtering.EntryFilteringCursor;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.filter.EqualityNode;
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.filter.SearchScope;
@@ -78,7 +78,7 @@ public class StoredProcExecutionManager
* @param rootDSE A handle on the root DSE to be used for searching the SP Unit over.
* @param fullSPName Full name of the Stored Procedure including the unit name.
* @return The entry associated with the SP Unit.
- * @throws NamingException If the unit cannot be located or any other error occurs.
+ * @throws Exception If the unit cannot be located or any other error occurs.
*/
public ClonedServerEntry findStoredProcUnit( CoreSession session, String fullSPName ) throws Exception
{
@@ -110,9 +110,9 @@ public class StoredProcExecutionManager
*
* @param spUnitEntry The entry which a {@link StoredProcEngine} type will be mathched with respect to the language identifier.
* @return A {@link StoredProcEngine} associated with spUnitEntry.
- * @throws NamingException If no {@link StoredProcEngine} that can be associated with the language identifier in spUnitEntry can be found.
+ * @throws LdapException If no {@link StoredProcEngine} that can be associated with the language identifier in spUnitEntry can be found.
*/
- public StoredProcEngine getStoredProcEngineInstance( ClonedServerEntry spUnitEntry ) throws NamingException
+ public StoredProcEngine getStoredProcEngineInstance( ClonedServerEntry spUnitEntry ) throws LdapException
{
String spLangId = ( String ) spUnitEntry.getOriginalEntry().get( "storedProcLangId" ).getString();
@@ -129,14 +129,14 @@ public class StoredProcExecutionManager
}
catch ( InstantiationException e )
{
- NamingException ne = new NamingException();
- ne.setRootCause( e );
+ LdapException ne = new LdapException( e.getMessage() );
+ ne.initCause( e );
throw ne;
}
catch ( IllegalAccessException e )
{
- NamingException ne = new NamingException();
- ne.setRootCause( e );
+ LdapException ne = new LdapException( e.getMessage() );
+ ne.initCause( e );
throw ne;
}
@@ -146,7 +146,7 @@ public class StoredProcExecutionManager
}
- throw new NamingException( I18n.err( I18n.ERR_294, spLangId ) );
+ throw new LdapException( I18n.err( I18n.ERR_294, spLangId ) );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/LdapJavaStoredProcClassLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/LdapJavaStoredProcClassLoader.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/LdapJavaStoredProcClassLoader.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/LdapJavaStoredProcClassLoader.java Tue Mar 16 14:09:38 2010
@@ -21,9 +21,8 @@
package org.apache.directory.server.core.sp.java;
-import javax.naming.NamingException;
-
import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
/**
@@ -54,7 +53,7 @@ public class LdapJavaStoredProcClassLoad
{
classBytes = javaByteCodeAttr.getBytes();
}
- catch ( NamingException e )
+ catch ( LdapException e )
{
throw new ClassNotFoundException();
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java Tue Mar 16 14:09:38 2010
@@ -24,6 +24,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.filter.AndNode;
import org.apache.directory.shared.ldap.filter.BranchNode;
import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -31,8 +32,6 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.filter.OrNode;
import org.apache.directory.shared.ldap.filter.SimpleNode;
-import javax.naming.NamingException;
-
/**
* The top level evaluation node for a refinement.
@@ -56,7 +55,7 @@ public class RefinementEvaluator
}
- public boolean evaluate( ExprNode node, EntryAttribute objectClasses ) throws NamingException
+ public boolean evaluate( ExprNode node, EntryAttribute objectClasses ) throws LdapException
{
if ( node == null )
{
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java Tue Mar 16 14:09:38 2010
@@ -28,6 +28,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.filter.EqualityNode;
import org.apache.directory.shared.ldap.filter.SimpleNode;
import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
@@ -66,9 +67,9 @@ public class RefinementLeafEvaluator
* @param objectClasses the objectClass attribute's values
* @return true if the leaf node selects the entry based on objectClass values, false
* if it rejects the entry
- * @throws NamingException
+ * @throws LdapException
*/
- public boolean evaluate( SimpleNode node, EntryAttribute objectClasses ) throws NamingException
+ public boolean evaluate( SimpleNode node, EntryAttribute objectClasses ) throws LdapException
{
if ( node == null )
{
@@ -77,12 +78,12 @@ public class RefinementLeafEvaluator
if ( !( node instanceof EqualityNode ) )
{
- throw new NamingException( I18n.err( I18n.ERR_301, node ) );
+ throw new LdapException( I18n.err( I18n.ERR_301, node ) );
}
if ( !node.getAttribute().equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT ) )
{
- throw new NamingException( I18n.err( I18n.ERR_302, node.getAttribute() ) );
+ throw new LdapException( I18n.err( I18n.ERR_302, node.getAttribute() ) );
}
if ( null == objectClasses )
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Tue Mar 16 14:09:38 2010
@@ -26,7 +26,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import javax.naming.Name;
import javax.naming.directory.SearchControls;
import org.apache.directory.server.constants.ApacheSchemaConstants;
@@ -212,8 +211,8 @@ public class SubentryInterceptor extends
if ( oc == null )
{
- throw new LdapSchemaViolationException( I18n.err( I18n.ERR_305 ),
- ResultCodeEnum.OBJECT_CLASS_VIOLATION );
+ throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION,
+ I18n.err( I18n.ERR_305 ) );
}
if ( oc.contains( SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) )
@@ -452,7 +451,7 @@ public class SubentryInterceptor extends
{
String msg = I18n.err( I18n.ERR_307, name.getName() );
LOG.warn( msg );
- throw new LdapInvalidAttributeValueException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+ throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
}
subentryCache.setSubentry( name.getNormName(), ss, getSubentryTypes( entry ) );
@@ -678,7 +677,7 @@ public class SubentryInterceptor extends
}
- private List<Modification> getModsOnEntryRdnChange( Name oldName, Name newName, ServerEntry entry )
+ private List<Modification> getModsOnEntryRdnChange( DN oldName, DN newName, ServerEntry entry )
throws Exception
{
List<Modification> modList = new ArrayList<Modification>();
@@ -701,7 +700,7 @@ public class SubentryInterceptor extends
while ( subentries.hasNext() )
{
String subentryDn = subentries.next();
- Name apDn = new DN( subentryDn );
+ DN apDn = new DN( subentryDn );
apDn.remove( apDn.size() - 1 );
SubtreeSpecification ss = subentryCache.getSubentry( subentryDn ).getSubtreeSpecification();
boolean isOldNameSelected = evaluator.evaluate( ss, apDn, oldName, entry );
@@ -811,7 +810,7 @@ public class SubentryInterceptor extends
{
String msg = I18n.err( I18n.ERR_308 );
LOG.warn( msg );
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
next.rename( opContext );
@@ -889,7 +888,7 @@ public class SubentryInterceptor extends
{
String msg = I18n.err( I18n.ERR_308 );
LOG.warn( msg );
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
next.moveAndRename( opContext );
@@ -967,7 +966,7 @@ public class SubentryInterceptor extends
{
String msg = I18n.err( I18n.ERR_308 );
LOG.warn( msg );
- throw new LdapSchemaViolationException( msg, ResultCodeEnum.NOT_ALLOWED_ON_RDN );
+ throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN, msg );
}
next.move( opContext );
@@ -1063,7 +1062,7 @@ public class SubentryInterceptor extends
{
String msg = I18n.err( I18n.ERR_71 );
LOG.error( msg, e );
- throw new LdapInvalidAttributeValueException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+ throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
}
subentryCache.setSubentry( name.toNormName(), ssNew, getSubentryTypes( entry, mods ) );
@@ -1147,7 +1146,7 @@ public class SubentryInterceptor extends
// Utility Methods
// -----------------------------------------------------------------------
- private List<Modification> getOperationalModsForReplace( Name oldName, Name newName, Subentry subentry,
+ private List<Modification> getOperationalModsForReplace( DN oldName, DN newName, Subentry subentry,
ServerEntry entry ) throws Exception
{
List<Modification> modList = new ArrayList<Modification>();
@@ -1453,7 +1452,7 @@ public class SubentryInterceptor extends
while ( subentries.hasNext() )
{
String subentryDn = subentries.next();
- Name apDn = new DN( subentryDn );
+ DN apDn = new DN( subentryDn );
apDn.remove( apDn.size() - 1 );
SubtreeSpecification ss = subentryCache.getSubentry( subentryDn ).getSubtreeSpecification();
boolean isOldEntrySelected = evaluator.evaluate( ss, apDn, name, oldEntry );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java Tue Mar 16 14:09:38 2010
@@ -22,12 +22,10 @@ package org.apache.directory.server.core
import java.util.Iterator;
-import javax.naming.Name;
-import javax.naming.NamingException;
-
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.core.event.Evaluator;
import org.apache.directory.server.core.event.ExpressionEvaluator;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
@@ -54,7 +52,6 @@ public class SubtreeEvaluator
*
* @param oidRegistry a registry used to lookup objectClass names for OIDs
* @param attrRegistry registry to be looked up
- * @throws NamingException
*/
public SubtreeEvaluator( OidRegistry oidRegistry, SchemaManager schemaManager )
{
@@ -69,10 +66,10 @@ public class SubtreeEvaluator
* @param apDn the distinguished name of the administrative point containing the subentry
* @param entryDn the distinguished name of the candidate entry
* @return true if the entry is selected by the specification, false if it is not
- * @throws javax.naming.NamingException if errors are encountered while evaluating selection
+ * @throws LdapException if errors are encountered while evaluating selection
*/
- public boolean evaluate( SubtreeSpecification subtree, Name apDn, Name entryDn, ServerEntry entry )
- throws NamingException
+ public boolean evaluate( SubtreeSpecification subtree, DN apDn, DN entryDn, ServerEntry entry )
+ throws LdapException
{
// TODO: Try to make this cast unnecessary.
DN dnEntryDn = (DN) entryDn;
@@ -93,7 +90,7 @@ public class SubtreeEvaluator
* administrative point. In the process we calculate the relative
* distinguished name relative to the administrative point.
*/
- Name apRelativeRdn;
+ DN apRelativeRdn;
if ( !NamespaceTools.isDescendant( apDn, entryDn ) )
{
@@ -114,7 +111,7 @@ public class SubtreeEvaluator
* relative name of the entry with respect to the base rdn. With the
* baseRelativeRdn we can later make comparisons with specific exclusions.
*/
- Name baseRelativeRdn;
+ DN baseRelativeRdn;
if ( subtree.getBase() != null && subtree.getBase().size() == 0 )
{
@@ -168,7 +165,7 @@ public class SubtreeEvaluator
while ( list.hasNext() )
{
- Name chopBefore = ( Name ) list.next();
+ DN chopBefore = ( DN ) list.next();
if ( NamespaceTools.isDescendant( chopBefore, baseRelativeRdn ) )
{
@@ -180,7 +177,7 @@ public class SubtreeEvaluator
while ( list.hasNext() )
{
- Name chopAfter = ( Name ) list.next();
+ DN chopAfter = ( DN ) list.next();
if ( NamespaceTools.isDescendant( chopAfter, baseRelativeRdn ) && !chopAfter.equals( baseRelativeRdn ) )
{
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java Tue Mar 16 14:09:38 2010
@@ -27,11 +27,9 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import javax.naming.Name;
-import javax.naming.NamingException;
-
import org.apache.directory.server.core.interceptor.context.OperationContext;
import org.apache.directory.server.core.partition.ByPassConstants;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter.Generic_LDAP_CONTEXT;
@@ -52,10 +50,10 @@ public abstract class AbstractStoredProc
}
- protected Name getOperationPrincipal() throws NamingException
+ protected DN getOperationPrincipal() throws LdapInvalidDnException
{
Principal principal = opContext.getSession().getEffectivePrincipal();
- Name userName = new DN( principal.getName() );
+ DN userName = new DN( principal.getName() );
return userName;
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java Tue Mar 16 14:09:38 2010
@@ -22,10 +22,10 @@ package org.apache.directory.server.core
import java.util.Map;
-import javax.naming.NamingException;
-
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
@@ -50,7 +50,7 @@ public class AddStoredProcedureParameter
MicroInjector $entryInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
{
// Return a safe copy constructed with user provided name.
return new DN( addedEntryName.getName() );
@@ -60,7 +60,7 @@ public class AddStoredProcedureParameter
MicroInjector $attributesInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapException
{
return addedEntry.clone();
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java Tue Mar 16 14:09:38 2010
@@ -22,9 +22,8 @@ package org.apache.directory.server.core
import java.util.Map;
-import javax.naming.NamingException;
-
import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.name.RDN;
import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
@@ -68,7 +67,7 @@ public class ModifyDNStoredProcedurePara
*/
MicroInjector $entryInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
{
// Return a safe copy constructed with user provided name.
return new DN( oldDN.getName() );
@@ -80,7 +79,7 @@ public class ModifyDNStoredProcedurePara
*/
MicroInjector $newrdnInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
{
// Return a safe copy constructed with user provided name.
return new DN( newRDN.getUpName() );
@@ -92,7 +91,7 @@ public class ModifyDNStoredProcedurePara
*/
MicroInjector $deleteoldrdnInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
{
// Return a safe copy constructed with user provided name.
return deleteOldRn;
@@ -104,7 +103,7 @@ public class ModifyDNStoredProcedurePara
*/
MicroInjector $newSuperiorInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
{
// Return a safe copy constructed with user provided name.
return new DN( newSuperiorDN.getName() );
@@ -116,7 +115,7 @@ public class ModifyDNStoredProcedurePara
*/
MicroInjector $oldRDNInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
{
// Return a safe copy constructed with user provided name.
return new DN( oldRDN.getName() );
@@ -128,7 +127,7 @@ public class ModifyDNStoredProcedurePara
*/
MicroInjector $oldSuperiorDNInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
{
// Return a safe copy constructed with user provided name.
return new DN( oldSuperiorDN.getName() );
@@ -140,7 +139,7 @@ public class ModifyDNStoredProcedurePara
*/
MicroInjector $newDNInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
{
// Return a safe copy constructed with user provided name.
return new DN( newDN.getName() );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java Tue Mar 16 14:09:38 2010
@@ -24,14 +24,14 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import javax.naming.NamingException;
-
import org.apache.directory.server.core.entry.ClonedServerEntry;
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
import org.apache.directory.server.core.interceptor.context.OperationContext;
import org.apache.directory.server.core.partition.ByPassConstants;
import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
@@ -59,7 +59,7 @@ public class ModifyStoredProcedureParame
MicroInjector $objectInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
{
// Return a safe copy constructed with user provided name.
return new DN( modifiedEntryName.getName() );
@@ -69,7 +69,7 @@ public class ModifyStoredProcedureParame
MicroInjector $modificationInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapException
{
List<Modification> newMods = new ArrayList<Modification>();
@@ -85,7 +85,7 @@ public class ModifyStoredProcedureParame
MicroInjector $oldEntryInjector = new MicroInjector()
{
- public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws NamingException
+ public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapException
{
return oldEntry;
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java Tue Mar 16 14:09:38 2010
@@ -20,11 +20,10 @@
package org.apache.directory.server.core.trigger;
-import javax.naming.InvalidNameException;
-import javax.naming.NamingException;
-
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
import org.apache.directory.shared.ldap.name.DN;
@@ -38,14 +37,14 @@ public class SimpleTriggerExecutionAutho
{
adminName = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
}
- catch ( InvalidNameException e )
+ catch ( LdapInvalidDnException e )
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
- public boolean hasPermission( OperationContext opContext ) throws NamingException
+ public boolean hasPermission( OperationContext opContext ) throws LdapException
{
DN principalName = opContext.getSession().getEffectivePrincipal().getClonedName();
return principalName.equals( adminName );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Tue Mar 16 14:09:38 2010
@@ -50,8 +50,8 @@ import org.apache.directory.server.i18n.
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Value;
-import org.apache.directory.shared.ldap.exception.LdapNamingException;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.exception.LdapOperationErrorException;
+import org.apache.directory.shared.ldap.exception.LdapOtherException;
import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.name.RDN;
import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
@@ -180,7 +180,7 @@ public class TriggerInterceptor extends
{
String msg = I18n.err( I18n.ERR_72, triggerString );
LOG.error( msg, e );
- throw new LdapNamingException( msg, ResultCodeEnum.OPERATIONS_ERROR );
+ throw new LdapOperationErrorException( msg );
}
triggerSpecs.add( item );
@@ -608,8 +608,8 @@ public class TriggerInterceptor extends
}
catch ( Exception e )
{
- LdapNamingException lne = new LdapNamingException( ResultCodeEnum.OTHER );
- lne.setRootCause( e );
+ LdapOtherException lne = new LdapOtherException( e.getMessage() );
+ lne.initCause( e );
throw lne;
}
}
Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java Tue Mar 16 14:09:38 2010
@@ -25,8 +25,7 @@ import java.util.Iterator;
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.AttributeType;
import org.apache.directory.shared.ldap.schema.LdapSyntax;
import org.apache.directory.shared.ldap.schema.MatchingRule;
@@ -59,7 +58,7 @@ public class DummyAttributeTypeRegistry
}
- public AttributeType lookup( final String id ) throws NamingException
+ public AttributeType lookup( final String id ) throws LdapException
{
Normalizer normalizer = new DeepTrimToLowerNormalizer( "1.1.1" );
@@ -89,7 +88,7 @@ public class DummyAttributeTypeRegistry
}
- public String getSchemaName( String id ) throws NamingException
+ public String getSchemaName( String id ) throws LdapException
{
return "dummy";
}
@@ -113,13 +112,13 @@ public class DummyAttributeTypeRegistry
}
- public Iterator<AttributeType> descendants( String ancestorId ) throws NamingException
+ public Iterator<AttributeType> descendants( String ancestorId ) throws LdapException
{
return null;
}
- public boolean hasDescendants( String ancestorId ) throws NamingException
+ public boolean hasDescendants( String ancestorId ) throws LdapException
{
return false;
}
@@ -131,36 +130,36 @@ public class DummyAttributeTypeRegistry
}
- public AttributeType unregister( String numericOid ) throws NamingException
+ public AttributeType unregister( String numericOid ) throws LdapException
{
return null;
}
- public void register( AttributeType attributeType ) throws NamingException
+ public void register( AttributeType attributeType ) throws LdapException
{
}
- public Set<String> getBinaryAttributes() throws NamingException
+ public Set<String> getBinaryAttributes() throws LdapException
{
return null;
}
public void unregisterDescendants( AttributeType attributeType, AttributeType ancestor )
- throws NamingException
+ throws LdapException
{
}
public void registerDescendants( AttributeType attributeType, AttributeType ancestor )
- throws NamingException
+ throws LdapException
{
}
- public void addMappingFor( AttributeType attributeType ) throws NamingException
+ public void addMappingFor( AttributeType attributeType ) throws LdapException
{
}
Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyOidRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyOidRegistry.java?rev=923747&r1=923746&r2=923747&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyOidRegistry.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyOidRegistry.java Tue Mar 16 14:09:38 2010
@@ -25,9 +25,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import javax.naming.NamingException;
-
-import org.apache.directory.server.core.authz.support.ACITupleFilter;
+import org.apache.directory.shared.ldap.exception.LdapException;
import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
@@ -40,7 +38,7 @@ import org.apache.directory.shared.ldap.
*/
class DummyOidRegistry extends OidRegistry
{
- public String getOid( String name ) throws NamingException
+ public String getOid( String name ) throws LdapException
{
return name.toLowerCase();
}
@@ -52,13 +50,13 @@ class DummyOidRegistry extends OidRegist
}
- public String getPrimaryName( String oid ) throws NamingException
+ public String getPrimaryName( String oid ) throws LdapException
{
return oid;
}
- public List<String> getNameSet( String oid ) throws NamingException
+ public List<String> getNameSet( String oid ) throws LdapException
{
List<String> list = new ArrayList<String>();
list.add( oid );
@@ -99,7 +97,7 @@ class DummyOidRegistry extends OidRegist
}
- public void unregister( String numericOid ) throws NamingException
+ public void unregister( String numericOid ) throws LdapException
{
}
}
\ No newline at end of file