You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2011/11/12 16:37:43 UTC
svn commit: r1201278 [1/2] - in /directory/apacheds/trunk:
core-api/src/main/java/org/apache/directory/server/core/api/
core-api/src/main/java/org/apache/directory/server/core/api/interceptor/
core-integ/src/test/java/org/apache/directory/server/core/a...
Author: elecharny
Date: Sat Nov 12 15:37:42 2011
New Revision: 1201278
URL: http://svn.apache.org/viewvc?rev=1201278&view=rev
Log:
o Created a InterceptorEnum class to store the interceptor name
o used this enum in code
Added:
directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InterceptorEnum.java
Modified:
directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java
directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java
directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java
directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java
Added: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InterceptorEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InterceptorEnum.java?rev=1201278&view=auto
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InterceptorEnum.java (added)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/InterceptorEnum.java Sat Nov 12 15:37:42 2011
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.core.api;
+
+/**
+ * The list of mandatory interceptors we use in the server.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public enum InterceptorEnum {
+ NORMALIZATION_INTERCEPTOR( "normalizationInterceptor" ),
+ AUTHENTICATION_INTERCEPTOR( "authenticationInterceptor" ),
+ REFERRAL_INTERCEPTOR( "referralInterceptor" ),
+ ACI_AUTHORIZATION_INTERCEPTOR( "aciAuthorizationInterceptor" ),
+ DEFAULT_AUTHORIZATION_INTERCEPTOR( "defaultAuthorizationInterceptor" ),
+ ADMINISTRATIVE_POINT_INTERCEPTOR( "administrativePointInterceptor" ),
+ EXCEPTION_INTERCEPTOR( "exceptionInterceptor" ),
+ OPERATIONAL_ATTRIBUTE_INTERCEPTOR( "operationalAttributeInterceptor" ),
+ SCHEMA_INTERCEPTOR( "schemaInterceptor" ),
+ SUBENTRY_INTERCEPTOR( "subentryInterceptor" ),
+ EVENT_INTERCEPTOR( "eventInterceptor" ),
+ TRIGGER_INTERCEPTOR( "triggerInterceptor" ),
+ CHANGE_LOG_INTERCEPTOR( "changeLogInterceptor" ),
+ COLLECTIVE_ATTRIBUTE_INTERCEPTOR( "collectiveAttributeInterceptor" ),
+ JOURNAL_INTERCEPTOR( "journalInterceptor" );
+
+ /** The associated interceptor name */
+ private String name;
+
+ /**
+ * The private constructor
+ * @param methodName The associated interceptor name
+ */
+ private InterceptorEnum( String name )
+ {
+ this.name = name;
+ }
+
+
+ /**
+ * @return The associated interceptor name
+ */
+ public String getName()
+ {
+ return name;
+ }
+}
Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java Sat Nov 12 15:37:42 2011
@@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.Set;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.LdapPrincipal;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
@@ -293,7 +294,7 @@ public abstract class BaseInterceptor im
/**
- * Creates a new instance.
+ * Creates a new instance with a default name : the class name itself.
*/
protected BaseInterceptor()
{
@@ -302,7 +303,9 @@ public abstract class BaseInterceptor im
/**
- * Creates a new instance.
+ * Creates a new instance with a given name.
+ *
+ * @param name the Interceptor name
*/
protected BaseInterceptor( String name )
{
@@ -311,6 +314,17 @@ public abstract class BaseInterceptor im
/**
+ * Creates a new instance with a given name.
+ *
+ * @param name the Interceptor name
+ */
+ protected BaseInterceptor( InterceptorEnum interceptor )
+ {
+ this.name = interceptor.getName();
+ }
+
+
+ /**
* This method does nothing by default.
* @throws Exception
*/
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java Sat Nov 12 15:37:42 2011
@@ -43,11 +43,11 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
import org.apache.directory.server.core.integ.IntegrationUtils;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyConfiguration;
import org.apache.directory.shared.ldap.codec.api.LdapApiService;
import org.apache.directory.shared.ldap.codec.api.LdapApiServiceFactory;
import org.apache.directory.shared.ldap.extras.controls.ppolicy.PasswordPolicy;
-import org.apache.directory.shared.ldap.extras.controls.ppolicy.PasswordPolicyErrorEnum;
import org.apache.directory.shared.ldap.extras.controls.ppolicy.PasswordPolicyImpl;
import org.apache.directory.shared.ldap.extras.controls.ppolicy_impl.PasswordPolicyDecorator;
import org.apache.directory.shared.ldap.model.constants.LdapSecurityConstants;
@@ -92,7 +92,7 @@ public class PasswordPolicyTest extends
private static final LdapApiService codec = LdapApiServiceFactory.getSingleton();
- private static final PasswordPolicyDecorator PP_REQ_CTRL =
+ private static final PasswordPolicyDecorator PP_REQ_CTRL =
new PasswordPolicyDecorator( codec, new PasswordPolicyImpl() );
@@ -114,11 +114,11 @@ public class PasswordPolicyTest extends
PpolicyConfigContainer policyContainer = new PpolicyConfigContainer();
policyContainer.setDefaultPolicy( policyConfig );
- AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)getService().getInterceptor( AuthenticationInterceptor.class.getSimpleName() );
+ AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)getService().getInterceptor( InterceptorEnum.AUTHENTICATION_INTERCEPTOR.getName() );
authenticationInterceptor.setPwdPolicies( policyContainer );
AuthenticationInterceptor authInterceptor = ( AuthenticationInterceptor ) getService()
- .getInterceptor( AuthenticationInterceptor.class.getSimpleName() );
+ .getInterceptor( InterceptorEnum.AUTHENTICATION_INTERCEPTOR.getName() );
authInterceptor.loadPwdPolicyStateAtributeTypes();
}
@@ -137,12 +137,12 @@ public class PasswordPolicyTest extends
LdapConnection connection = getAdminNetworkConnection( getLdapServer() );
Dn userDn = new Dn( "cn=user,ou=system" );
- Entry userEntry = new DefaultEntry(
- userDn.toString(),
- "ObjectClass: top",
- "ObjectClass: person",
+ Entry userEntry = new DefaultEntry(
+ userDn.toString(),
+ "ObjectClass: top",
+ "ObjectClass: person",
"cn: user",
- "sn: user_sn",
+ "sn: user_sn",
"userPassword: 1234" );
AddRequest addRequest = new AddRequestImpl();
@@ -224,12 +224,12 @@ public class PasswordPolicyTest extends
LdapConnection adminConnection = getAdminNetworkConnection( getLdapServer() );
Dn userDn = new Dn( "cn=user2,ou=system" );
- Entry userEntry = new DefaultEntry(
- userDn.toString(),
- "ObjectClass: top",
- "ObjectClass: person",
+ Entry userEntry = new DefaultEntry(
+ userDn.toString(),
+ "ObjectClass: top",
+ "ObjectClass: person",
"cn: user2",
- "sn: user_sn",
+ "sn: user_sn",
"userPassword: 12345" );
AddRequest addRequest = new AddRequestImpl();
@@ -280,11 +280,11 @@ public class PasswordPolicyTest extends
Dn userDn = new Dn( "cn=userMinAge,ou=system" );
Entry userEntry = new DefaultEntry(
- userDn.toString(),
- "ObjectClass: top",
- "ObjectClass: person",
+ userDn.toString(),
+ "ObjectClass: top",
+ "ObjectClass: person",
"cn: userMinAge",
- "sn: userMinAge_sn",
+ "sn: userMinAge_sn",
"userPassword: 12345");
AddRequest addRequest = new AddRequestImpl();
@@ -328,11 +328,11 @@ public class PasswordPolicyTest extends
Dn userDn = new Dn( "cn=userPwdHist,ou=system" );
Entry userEntry = new DefaultEntry(
- userDn.toString(),
- "ObjectClass: top",
- "ObjectClass: person",
+ userDn.toString(),
+ "ObjectClass: top",
+ "ObjectClass: person",
"cn: userPwdHist",
- "sn: userPwdHist_sn",
+ "sn: userPwdHist_sn",
"userPassword: 12345" );
AddRequest addRequest = new AddRequestImpl();
@@ -397,11 +397,11 @@ public class PasswordPolicyTest extends
Dn userDn = new Dn( "cn=userLen,ou=system" );
Entry userEntry = new DefaultEntry(
- userDn.toString(),
- "ObjectClass: top",
- "ObjectClass: person",
+ userDn.toString(),
+ "ObjectClass: top",
+ "ObjectClass: person",
"cn: userLen",
- "sn: userLen_sn",
+ "sn: userLen_sn",
"userPassword: 1234");
AddRequest addRequest = new AddRequestImpl();
@@ -447,11 +447,11 @@ public class PasswordPolicyTest extends
Dn userDn = new Dn( "cn=userMaxAge,ou=system" );
String password = "12345";
Entry userEntry = new DefaultEntry(
- userDn.toString(),
- "ObjectClass: top",
- "ObjectClass: person",
+ userDn.toString(),
+ "ObjectClass: top",
+ "ObjectClass: person",
"cn: userMaxAge",
- "sn: userMaxAge_sn",
+ "sn: userMaxAge_sn",
"userPassword: " + password );
AddRequest addRequest = new AddRequestImpl();
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Sat Nov 12 15:37:42 2011
@@ -51,6 +51,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.api.DirectoryService;
import org.apache.directory.server.core.api.DnFactory;
import org.apache.directory.server.core.api.InstanceLayout;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.LdapPrincipal;
import org.apache.directory.server.core.api.OperationEnum;
import org.apache.directory.server.core.api.OperationManager;
@@ -533,6 +534,7 @@ public class DefaultDirectoryService imp
{
gatherInterceptors( interceptor, interceptor.getClass(), operation, operationList );
}
+
operationInterceptors.put( operation, operationList );
}
}
@@ -552,8 +554,9 @@ public class DefaultDirectoryService imp
* @param operation type of operation
* @param selectedInterceptorList the list of selected interceptors
*/
- private void gatherInterceptors( Interceptor interceptor, Class interceptorClz, OperationEnum operation, List<String> selectedInterceptorList )
+ private void gatherInterceptors( Interceptor interceptor, Class<?> interceptorClz, OperationEnum operation, List<String> selectedInterceptorList )
{
+ // We stop recursing when we reach the Base class
if( ( interceptorClz == null ) || ( interceptorClz == BaseInterceptor.class ) )
{
return;
@@ -2232,7 +2235,7 @@ public class DefaultDirectoryService imp
*/
public boolean isPwdPolicyEnabled()
{
- AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)getInterceptor( AuthenticationInterceptor.class.getSimpleName() );
+ AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)getInterceptor( InterceptorEnum.AUTHENTICATION_INTERCEPTOR.getName() );
if ( authenticationInterceptor == null )
{
Modified: directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java Sat Nov 12 15:37:42 2011
@@ -72,9 +72,18 @@ public class KeyDerivationInterceptor ex
private static final Logger log = LoggerFactory.getLogger( KeyDerivationInterceptor.class );
/** The service name. */
- public static final String NAME = "keyDerivationService";
+ private static final String NAME = "keyDerivationService";
/**
+ * Creates an instance of a KeyDerivationInterceptor.
+ */
+ public KeyDerivationInterceptor()
+ {
+ super( NAME );
+ }
+
+
+ /**
* Intercept the addition of the 'userPassword' and 'krb5PrincipalName' attributes. Use the 'userPassword'
* and 'krb5PrincipalName' attributes to derive Kerberos keys for the principal. If the 'userPassword' is
* the special keyword 'randomKey', set random keys for the principal. Set the key version number (kvno)
Modified: directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java Sat Nov 12 15:37:42 2011
@@ -34,6 +34,7 @@ import org.apache.directory.server.const
import org.apache.directory.server.core.shared.DefaultCoreSession;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.LdapPrincipal;
import org.apache.directory.server.core.api.administrative.AccessControlAAP;
import org.apache.directory.server.core.api.administrative.AccessControlAdministrativePoint;
@@ -182,6 +183,16 @@ public class AdministrativePointIntercep
/** A lock to guarantee the AP cache consistency */
private ReentrantReadWriteLock mutex = new ReentrantReadWriteLock();
+
+ /**
+ * Creates a new instance of a AdministrativePointInterceptor.
+ */
+ public AdministrativePointInterceptor()
+ {
+ super( InterceptorEnum.ADMINISTRATIVE_POINT_INTERCEPTOR );
+ }
+
+
/**
* Get a read-lock on the AP cache.
* No read operation can be done on the AP cache if this
@@ -738,14 +749,6 @@ public class AdministrativePointIntercep
}
- /**
- * Creates an Administrative service interceptor.
- */
- public AdministrativePointInterceptor()
- {
- }
-
-
//-------------------------------------------------------------------------------------------
// Helper methods
//-------------------------------------------------------------------------------------------
Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java Sat Nov 12 15:37:42 2011
@@ -6,16 +6,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
- *
+ * under the License.
+ *
*/
package org.apache.directory.server.core.authn;
@@ -32,6 +32,7 @@ import static org.apache.directory.share
import java.util.Date;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyConfiguration;
import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyException;
import org.apache.directory.shared.ldap.model.constants.AuthenticationLevel;
@@ -116,7 +117,7 @@ public abstract class AbstractAuthentica
/**
* Calls {@link #doDestroy()} method, and clears default properties
* (<tt>factoryConfiguration</tt> and <tt>configuration</tt>).
- * Please put your deinitialization code into {@link #doDestroy()}.
+ * Please put your deinitialization code into {@link #doDestroy()}.
*/
public final void destroy()
{
@@ -157,7 +158,8 @@ public abstract class AbstractAuthentica
return;
}
- AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)directoryService.getInterceptor( AuthenticationInterceptor.class.getSimpleName() );
+ AuthenticationInterceptor authenticationInterceptor = (AuthenticationInterceptor)directoryService.getInterceptor(
+ InterceptorEnum.AUTHENTICATION_INTERCEPTOR.getName() );
PasswordPolicyConfiguration pPolicyConfig = authenticationInterceptor.getPwdPolicy( userEntry );
// check for locked out account
@@ -203,7 +205,7 @@ public abstract class AbstractAuthentica
if( System.currentTimeMillis() < pwdStartTime.getTime() )
{
- throw new PasswordPolicyException( "account is locked, will be activated after " + pwdStartTime, ACCOUNT_LOCKED.getValue() );
+ throw new PasswordPolicyException( "account is locked, will be activated after " + pwdStartTime, ACCOUNT_LOCKED.getValue() );
}
}
Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Sat Nov 12 15:37:42 2011
@@ -45,6 +45,7 @@ import java.util.Set;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.LdapPrincipal;
import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyConfiguration;
import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyException;
@@ -149,6 +150,7 @@ public class AuthenticationInterceptor e
*/
public AuthenticationInterceptor()
{
+ super( InterceptorEnum.AUTHENTICATION_INTERCEPTOR );
}
Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Sat Nov 12 15:37:42 2011
@@ -33,6 +33,7 @@ import javax.naming.directory.SearchCont
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.LdapPrincipal;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.entry.ServerEntryUtils;
@@ -168,6 +169,15 @@ public class AciAuthorizationInterceptor
/** The SubentryUtils instance */
private static SubentryUtils subentryUtils;
+
+ /**
+ * Create a AciAuthorizationInterceptor instance
+ */
+ public AciAuthorizationInterceptor()
+ {
+ super( InterceptorEnum.ACI_AUTHORIZATION_INTERCEPTOR );
+ }
+
/**
* Load the Tuples into the cache
Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,6 +29,7 @@ import org.apache.directory.server.const
import org.apache.directory.server.core.shared.DefaultCoreSession;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.LdapPrincipal;
import org.apache.directory.server.core.api.filtering.EntryFilter;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
@@ -94,13 +95,12 @@ public class DefaultAuthorizationInterce
}
}
-
/**
- * Creates a new instance.
+ * Creates a new instance of DefaultAuthorizationInterceptor.
*/
public DefaultAuthorizationInterceptor()
{
- // Nothing to do
+ super( InterceptorEnum.DEFAULT_AUTHORIZATION_INTERCEPTOR );
}
Modified: directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Sat Nov 12 15:37:42 2011
@@ -26,6 +26,7 @@ import org.apache.directory.server.const
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.changelog.ChangeLog;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.entry.ServerEntryUtils;
@@ -74,11 +75,19 @@ public class ChangeLogInterceptor extend
/** OID of the 'rev' attribute used in changeLogEvent and tag objectclasses */
private static final String REV_AT_OID = "1.3.6.1.4.1.18060.0.4.1.2.47";
+
+ /**
+ * Creates a new instance of a ChangeLogInterceptor.
+ */
+ public ChangeLogInterceptor()
+ {
+ super( InterceptorEnum.CHANGE_LOG_INTERCEPTOR );
+ }
+
+
// -----------------------------------------------------------------------
// Overridden init() and destroy() methods
// -----------------------------------------------------------------------
-
-
/**
* The init method will initialize the local variables and load the
* entryDeleted AttributeType.
Modified: directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Sat Nov 12 15:37:42 2011
@@ -26,6 +26,7 @@ import java.util.Set;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.filtering.EntryFilter;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
@@ -71,6 +72,15 @@ public class CollectiveAttributeIntercep
private static Logger LOG = LoggerFactory.getLogger( CollectiveAttributeInterceptor.class );
/**
+ * Creates a new instance of a CollectiveAttributeInterceptor.
+ */
+ public CollectiveAttributeInterceptor()
+ {
+ super( InterceptorEnum.COLLECTIVE_ATTRIBUTE_INTERCEPTOR );
+ }
+
+
+ /**
* the search result filter to use for collective attribute injection
*/
private class CollectiveAttributeFilter implements EntryFilter
Modified: directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java Sat Nov 12 15:37:42 2011
@@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.event.DirectoryListener;
import org.apache.directory.server.core.api.event.Evaluator;
@@ -70,7 +71,15 @@ public class EventInterceptor extends Ba
private Evaluator evaluator;
private ExecutorService executor;
-
+ /**
+ * Creates a new instance of a EventInterceptor.
+ */
+ public EventInterceptor()
+ {
+ super( InterceptorEnum.EVENT_INTERCEPTOR );
+ }
+
+
/**
* Initialize the event interceptor. It creates a pool of executor which will be used
* to call the listeners in separate threads.
Modified: directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Sat Nov 12 15:37:42 2011
@@ -23,6 +23,7 @@ package org.apache.directory.server.core
import org.apache.commons.collections.map.LRUMap;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.filtering.BaseEntryFilteringCursor;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
@@ -96,9 +97,13 @@ public class ExceptionInterceptor extend
*/
public ExceptionInterceptor()
{
+ super( InterceptorEnum.EXCEPTION_INTERCEPTOR );
}
+ /**
+ * {@inheritDoc}
+ */
public void init( DirectoryService directoryService ) throws LdapException
{
super.init( directoryService );
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class CryptPasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a CryptPasswordHashingInterceptor
+ */
public CryptPasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_CRYPT );
+ super( "CryptPasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_CRYPT );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class Md5PasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a Md5PasswordHashingInterceptor
+ */
public Md5PasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_MD5 );
+ super( "Md5PasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_MD5 );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -42,22 +42,12 @@ import org.apache.directory.shared.ldap.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class PasswordHashingInterceptor extends BaseInterceptor
+public abstract class PasswordHashingInterceptor extends BaseInterceptor
{
/** the hashing algorithm to be used, if null then the password won't be changed */
private LdapSecurityConstants algorithm;
-
- /**
- * Creates a new instance of PasswordHashingInterceptor which does not hash the passwords.
- */
- public PasswordHashingInterceptor()
- {
- this( null );
- }
-
-
/**
*
* Creates a new instance of PasswordHashingInterceptor which hashes the
@@ -66,8 +56,9 @@ public class PasswordHashingInterceptor
*
* @param algorithm the name of the algorithm to be used
*/
- public PasswordHashingInterceptor( LdapSecurityConstants algorithm )
+ protected PasswordHashingInterceptor( String name, LdapSecurityConstants algorithm )
{
+ super( name );
this.algorithm = algorithm;
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class Sha256PasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a Sha256PasswordHashingInterceptor
+ */
public Sha256PasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_SHA256 );
+ super( "Sha256PasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_SHA256 );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class Sha384PasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a Sha384PasswordHashingInterceptor
+ */
public Sha384PasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_SHA384 );
+ super( "Sha384PasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_SHA384 );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class Sha512PasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a Sha512PasswordHashingInterceptor
+ */
public Sha512PasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_SHA512 );
+ super( "Sha512PasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_SHA512 );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class ShaPasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a ShaPasswordHashingInterceptor
+ */
public ShaPasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_SHA );
+ super( "ShaPasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_SHA );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class Smd5PasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a Smd5PasswordHashingInterceptor
+ */
public Smd5PasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_SMD5 );
+ super( "Smd5PasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_SMD5 );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class Ssha256PasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a Ssha256PasswordHashingInterceptor
+ */
public Ssha256PasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_SSHA256 );
+ super( "Ssha256PasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_SSHA256 );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class Ssha384PasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a Ssha384PasswordHashingInterceptor
+ */
public Ssha384PasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_SSHA384 );
+ super( "Ssha384PasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_SSHA384 );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class Ssha512PasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a Ssha512PasswordHashingInterceptor
+ */
public Ssha512PasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_SSHA512 );
+ super( "Ssha512PasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_SSHA512 );
}
}
Modified: directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,8 +29,11 @@ import org.apache.directory.shared.ldap.
*/
public class SshaPasswordHashingInterceptor extends PasswordHashingInterceptor
{
+ /**
+ * Creates an instance of a SshaPasswordHashingInterceptor
+ */
public SshaPasswordHashingInterceptor()
{
- super( LdapSecurityConstants.HASH_METHOD_SSHA );
+ super( "SshaPasswordHashingInterceptor", LdapSecurityConstants.HASH_METHOD_SSHA );
}
}
Modified: directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java Sat Nov 12 15:37:42 2011
@@ -22,6 +22,7 @@ package org.apache.directory.server.core
import java.util.concurrent.atomic.AtomicLong;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
@@ -62,7 +63,15 @@ public class JournalInterceptor extends
/** the Journal service to log changes to */
private Journal journal;
+ /**
+ * Creates a new instance of a JournalInterceptor.
+ */
+ public JournalInterceptor()
+ {
+ super( InterceptorEnum.JOURNAL_INTERCEPTOR );
+ }
+
// -----------------------------------------------------------------------
// Overridden init() and destroy() methods
// -----------------------------------------------------------------------
Modified: directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java Sat Nov 12 15:37:42 2011
@@ -68,9 +68,6 @@ public class TimerInterceptor extends Ba
private static final boolean IS_DEBUG_STATS = OPERATION_STATS.isDebugEnabled();
private static final boolean IS_DEBUG_TIME = OPERATION_TIME.isDebugEnabled();
- /** The Logger's name */
- private String name;
-
/** Stats for the add operation */
private static AtomicLong totalAdd = new AtomicLong( 0 );
private static AtomicInteger nbAddCalls = new AtomicInteger( 0 );
@@ -131,11 +128,11 @@ public class TimerInterceptor extends Ba
*
* Creates a new instance of TimerInterceptor.
*
- * @param name This interceptor's name
+ * @param name This interceptor's getName()
*/
public TimerInterceptor( String name )
{
- this.name = name;
+ super( name );
}
@@ -158,15 +155,6 @@ public class TimerInterceptor extends Ba
/**
* {@inheritDoc}
*/
- public String getName()
- {
- return name;
- }
-
-
- /**
- * {@inheritDoc}
- */
public void add( AddOperationContext addContext ) throws LdapException
{
long t0 = System.nanoTime();
@@ -181,13 +169,13 @@ public class TimerInterceptor extends Ba
if ( nbAddCalls.get() % 1000 == 0 )
{
long average = totalAdd.get()/(nbAddCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average add = {} microseconds, nb adds = {}", average, nbAddCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average add = {} microseconds, nb adds = {}", average, nbAddCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta add = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta add = {}", getName(), delta );
}
}
@@ -209,13 +197,13 @@ public class TimerInterceptor extends Ba
if ( nbBindCalls.get() % 1000 == 0 )
{
long average = totalBind.get()/(nbBindCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average bind = {} microseconds, nb binds = {}", average, nbBindCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average bind = {} microseconds, nb binds = {}", average, nbBindCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta bind = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta bind = {}", getName(), delta );
}
}
@@ -237,13 +225,13 @@ public class TimerInterceptor extends Ba
if ( nbCompareCalls.get() % 1000 == 0 )
{
long average = totalCompare.get()/(nbCompareCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average compare = {} microseconds, nb compares = {}", average, nbCompareCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average compare = {} microseconds, nb compares = {}", average, nbCompareCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta compare = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta compare = {}", getName(), delta );
}
return compare;
@@ -267,13 +255,13 @@ public class TimerInterceptor extends Ba
if ( nbDeleteCalls.get() % 1000 == 0 )
{
long average = totalDelete.get()/(nbDeleteCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average delete = {} microseconds, nb deletes = {}", average, nbDeleteCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average delete = {} microseconds, nb deletes = {}", average, nbDeleteCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta delete = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta delete = {}", getName(), delta );
}
}
@@ -295,13 +283,13 @@ public class TimerInterceptor extends Ba
if ( nbGetRootDseCalls.get() % 1000 == 0 )
{
long average = totalGetRootDse.get()/(nbGetRootDseCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average getRootDSE = {} microseconds, nb getRootDSEs = {}", average, nbGetRootDseCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average getRootDSE = {} microseconds, nb getRootDSEs = {}", average, nbGetRootDseCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta getRootDSE = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta getRootDSE = {}", getName(), delta );
}
return rootDse;
@@ -325,13 +313,13 @@ public class TimerInterceptor extends Ba
if ( nbHasEntryCalls.get() % 1000 == 0 )
{
long average = totalHasEntry.get()/(nbHasEntryCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average hasEntry = {} microseconds, nb hasEntrys = {}", average, nbHasEntryCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average hasEntry = {} microseconds, nb hasEntrys = {}", average, nbHasEntryCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta hasEntry = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta hasEntry = {}", getName(), delta );
}
return hasEntry;
@@ -355,13 +343,13 @@ public class TimerInterceptor extends Ba
if ( nbListCalls.get() % 1000 == 0 )
{
long average = totalList.get()/(nbListCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average list = {} microseconds, nb lists = {}", average, nbListCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average list = {} microseconds, nb lists = {}", average, nbListCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta list = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta list = {}", getName(), delta );
}
return cursor;
@@ -385,13 +373,13 @@ public class TimerInterceptor extends Ba
if ( nbLookupCalls.get() % 1000 == 0 )
{
long average = totalLookup.get()/(nbLookupCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average lookup = {} microseconds, nb lookups = {}", average, nbLookupCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average lookup = {} microseconds, nb lookups = {}", average, nbLookupCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta lookup = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta lookup = {}", getName(), delta );
}
return entry;
@@ -415,13 +403,13 @@ public class TimerInterceptor extends Ba
if ( nbModifyCalls.get() % 1000 == 0 )
{
long average = totalModify.get()/(nbModifyCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average modify = {} microseconds, nb modifys = {}", average, nbModifyCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average modify = {} microseconds, nb modifys = {}", average, nbModifyCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta modify = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta modify = {}", getName(), delta );
}
}
@@ -443,13 +431,13 @@ public class TimerInterceptor extends Ba
if ( nbMoveCalls.get() % 1000 == 0 )
{
long average = totalMove.get()/(nbMoveCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average move = {} microseconds, nb moves = {}", average, nbMoveCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average move = {} microseconds, nb moves = {}", average, nbMoveCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta move = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta move = {}", getName(), delta );
}
}
@@ -471,13 +459,13 @@ public class TimerInterceptor extends Ba
if ( nbMoveAndRenameCalls.get() % 1000 == 0 )
{
long average = totalMoveAndRename.get()/(nbMoveAndRenameCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average moveAndRename = {} microseconds, nb moveAndRenames = {}", average, nbMoveAndRenameCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average moveAndRename = {} microseconds, nb moveAndRenames = {}", average, nbMoveAndRenameCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta moveAndRename = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta moveAndRename = {}", getName(), delta );
}
}
@@ -499,13 +487,13 @@ public class TimerInterceptor extends Ba
if ( nbRenameCalls.get() % 1000 == 0 )
{
long average = totalRename.get()/(nbRenameCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average rename = {} microseconds, nb renames = {}", average, nbRenameCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average rename = {} microseconds, nb renames = {}", average, nbRenameCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta rename = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta rename = {}", getName(), delta );
}
}
@@ -527,13 +515,13 @@ public class TimerInterceptor extends Ba
if ( nbSearchCalls.get() % 1000 == 0 )
{
long average = totalSearch.get()/(nbSearchCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average search = {} microseconds, nb searches = {}", average, nbSearchCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average search = {} microseconds, nb searches = {}", average, nbSearchCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta search = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta search = {}", getName(), delta );
}
return cursor;
@@ -557,13 +545,13 @@ public class TimerInterceptor extends Ba
if ( nbUnbindCalls.get() % 1000 == 0 )
{
long average = totalUnbind.get()/(nbUnbindCalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average unbind = {} microseconds, nb unbinds = {}", average, nbUnbindCalls.get() );
+ OPERATION_STATS.debug( getName() + " : Average unbind = {} microseconds, nb unbinds = {}", average, nbUnbindCalls.get() );
}
}
if ( IS_DEBUG_TIME )
{
- OPERATION_TIME.debug( "{} : Delta unbind = {}", name, delta );
+ OPERATION_TIME.debug( "{} : Delta unbind = {}", getName(), delta );
}
}
}
Modified: directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java Sat Nov 12 15:37:42 2011
@@ -23,6 +23,7 @@ package org.apache.directory.server.core
import java.util.List;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.filtering.BaseEntryFilteringCursor;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
@@ -79,6 +80,15 @@ public class NormalizationInterceptor ex
private FilterNormalizingVisitor normVisitor;
/**
+ * Creates a new instance of a NormalizationInterceptor.
+ */
+ public NormalizationInterceptor()
+ {
+ super( InterceptorEnum.NORMALIZATION_INTERCEPTOR );
+ }
+
+
+ /**
* Initialize the registries, normalizers.
*/
public void init( DirectoryService directoryService ) throws LdapException
Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,6 +29,7 @@ import java.util.UUID;
import org.apache.directory.server.constants.ApacheSchemaConstants;
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.filtering.EntryFilter;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
@@ -124,6 +125,7 @@ public class OperationalAttributeInterce
*/
public OperationalAttributeInterceptor()
{
+ super( InterceptorEnum.OPERATIONAL_ATTRIBUTE_INTERCEPTOR );
}
Modified: directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Sat Nov 12 15:37:42 2011
@@ -23,6 +23,7 @@ package org.apache.directory.server.core
import javax.naming.Context;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.ReferralManager;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
@@ -191,6 +192,14 @@ public class ReferralInterceptor extends
}
}
+ /**
+ * Creates a new instance of a ReferralInterceptor.
+ */
+ public ReferralInterceptor()
+ {
+ super( InterceptorEnum.REFERRAL_INTERCEPTOR );
+ }
+
public void init( DirectoryService directoryService ) throws LdapException
{
Modified: directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Sat Nov 12 15:37:42 2011
@@ -34,6 +34,7 @@ import javax.naming.directory.SearchCont
import org.apache.directory.server.core.shared.SchemaService;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.filtering.BaseEntryFilteringCursor;
import org.apache.directory.server.core.api.filtering.EntryFilter;
@@ -134,9 +135,7 @@ public class SchemaInterceptor extends B
/** The SubschemaSubentry Dn */
private Dn subschemaSubentryDn;
- /**
- * the normalized name for the schema modification attributes
- */
+ /** The normalized name for the schema modification attributes */
private Dn schemaModificationAttributesDn;
/** The schema manager */
@@ -157,6 +156,14 @@ public class SchemaInterceptor extends B
/** A map used to store all the objectClasses allowed attributes (may + must) */
private Map<String, List<AttributeType>> allowed;
+ /**
+ * Creates a new instance of a SchemaInterceptor.
+ */
+ public SchemaInterceptor()
+ {
+ super( InterceptorEnum.SCHEMA_INTERCEPTOR );
+ }
+
/**
* Initialize the Schema Service
Modified: directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java (original)
+++ directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java Sat Nov 12 15:37:42 2011
@@ -6,16 +6,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
- *
+ * under the License.
+ *
*/
package org.apache.directory.server.core.schema;
@@ -26,6 +26,7 @@ import java.util.HashSet;
import java.util.Set;
import org.apache.directory.server.core.api.DnFactory;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.interceptor.context.OperationContext;
import org.apache.directory.shared.ldap.model.constants.MetaSchemaConstants;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
@@ -52,7 +53,7 @@ import org.apache.directory.shared.util.
/**
- * Responsible for translating modify operations on the subschemaSubentry into
+ * Responsible for translating modify operations on the subschemaSubentry into
* operations against entries within the schema partition.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -64,11 +65,11 @@ public class SchemaSubentryModifier
static
{
Set<String> c = new HashSet<String>();
- c.add( "AuthenticationInterceptor" );
- c.add( "AciAuthorizationInterceptor" );
- c.add( "DefaultAuthorizationInterceptor" );
- c.add( "ExceptionInterceptor" );
- c.add( "SchemaInterceptor" );
+ c.add( InterceptorEnum.AUTHENTICATION_INTERCEPTOR.getName() );
+ c.add( InterceptorEnum.ACI_AUTHORIZATION_INTERCEPTOR.getName() );
+ c.add( InterceptorEnum.DEFAULT_AUTHORIZATION_INTERCEPTOR.getName() );
+ c.add( InterceptorEnum.EXCEPTION_INTERCEPTOR.getName() );
+ c.add( InterceptorEnum.SCHEMA_INTERCEPTOR.getName() );
BYPASS = Collections.unmodifiableCollection( c );
}
@@ -140,7 +141,7 @@ public class SchemaSubentryModifier
public void add( OperationContext opContext, LdapComparatorDescription comparatorDescription ) throws LdapException
{
- String schemaName = getSchema( comparatorDescription );
+ String schemaName = getSchema( comparatorDescription );
Dn dn = dnFactory.create(
"m-oid=" + comparatorDescription.getOid(),
SchemaConstants.COMPARATORS_PATH,
@@ -149,7 +150,7 @@ public class SchemaSubentryModifier
Entry entry = getEntry( dn, comparatorDescription );
- opContext.add( (Entry)entry, BYPASS );
+ opContext.add( entry, BYPASS );
}
@@ -158,13 +159,13 @@ public class SchemaSubentryModifier
String schemaName = getSchema( normalizerDescription );
Dn dn = dnFactory.create(
"m-oid=" + normalizerDescription.getOid(),
- SchemaConstants.NORMALIZERS_PATH ,
+ SchemaConstants.NORMALIZERS_PATH ,
"cn=" + schemaName,
SchemaConstants.OU_SCHEMA );
Entry entry = getEntry( dn, normalizerDescription );
- opContext.add( (Entry)entry, BYPASS );
+ opContext.add( entry, BYPASS );
}
@@ -174,11 +175,11 @@ public class SchemaSubentryModifier
Dn dn = dnFactory.create(
"m-oid=" + syntaxCheckerDescription.getOid(),
SchemaConstants.SYNTAX_CHECKERS_PATH,
- "cn=" + schemaName,
+ "cn=" + schemaName,
SchemaConstants.OU_SCHEMA );
Entry entry = getEntry( dn, syntaxCheckerDescription );
- opContext.add( (Entry)entry, BYPASS );
+ opContext.add( entry, BYPASS );
}
@@ -206,7 +207,7 @@ public class SchemaSubentryModifier
Dn dn = dnFactory.create(
"m-oid=" + normalizerDescription.getOid(),
SchemaConstants.NORMALIZERS_PATH,
- "cn=" + schemaName,
+ "cn=" + schemaName,
SchemaConstants.OU_SCHEMA );
opContext.delete( dn );
@@ -217,7 +218,7 @@ public class SchemaSubentryModifier
{
String schemaName = getSchema( syntaxCheckerDescription );
Dn dn = dnFactory.create(
- "m-oid=" + syntaxCheckerDescription.getOid(),
+ "m-oid=" + syntaxCheckerDescription.getOid(),
SchemaConstants.SYNTAX_CHECKERS_PATH,
"cn=" + schemaName,
SchemaConstants.OU_SCHEMA );
@@ -242,8 +243,8 @@ public class SchemaSubentryModifier
{
Entry entry = new DefaultEntry( schemaManager, dn );
- entry.put( SchemaConstants.OBJECT_CLASS_AT,
- SchemaConstants.TOP_OC,
+ entry.put( SchemaConstants.OBJECT_CLASS_AT,
+ SchemaConstants.TOP_OC,
MetaSchemaConstants.META_TOP_OC,
MetaSchemaConstants.META_COMPARATOR_OC );
@@ -252,7 +253,7 @@ public class SchemaSubentryModifier
if ( comparatorDescription.getBytecode() != null )
{
- entry.put( MetaSchemaConstants.M_BYTECODE_AT,
+ entry.put( MetaSchemaConstants.M_BYTECODE_AT,
Base64.decode( comparatorDescription.getBytecode().toCharArray() ) );
}
@@ -269,8 +270,8 @@ public class SchemaSubentryModifier
{
Entry entry = new DefaultEntry( schemaManager, dn );
- entry.put( SchemaConstants.OBJECT_CLASS_AT,
- SchemaConstants.TOP_OC,
+ entry.put( SchemaConstants.OBJECT_CLASS_AT,
+ SchemaConstants.TOP_OC,
MetaSchemaConstants.META_TOP_OC,
MetaSchemaConstants.META_NORMALIZER_OC );
@@ -279,7 +280,7 @@ public class SchemaSubentryModifier
if ( normalizerDescription.getBytecode() != null )
{
- entry.put( MetaSchemaConstants.M_BYTECODE_AT,
+ entry.put( MetaSchemaConstants.M_BYTECODE_AT,
Base64.decode( normalizerDescription.getBytecode().toCharArray() ) );
}
@@ -292,7 +293,7 @@ public class SchemaSubentryModifier
}
- private String getSchema( SchemaObject desc )
+ private String getSchema( SchemaObject desc )
{
if ( desc.getExtensions().containsKey( MetaSchemaConstants.X_SCHEMA ) )
{
@@ -307,8 +308,8 @@ public class SchemaSubentryModifier
{
Entry entry = new DefaultEntry( schemaManager, dn );
- entry.put( SchemaConstants.OBJECT_CLASS_AT,
- SchemaConstants.TOP_OC,
+ entry.put( SchemaConstants.OBJECT_CLASS_AT,
+ SchemaConstants.TOP_OC,
MetaSchemaConstants.META_TOP_OC,
MetaSchemaConstants.META_SYNTAX_CHECKER_OC );
Modified: directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Sat Nov 12 15:37:42 2011
@@ -31,6 +31,7 @@ import org.apache.directory.server.const
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.LdapPrincipal;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.filtering.EntryFilter;
@@ -118,7 +119,15 @@ public class SubentryInterceptor extends
REMOVE,
REPLACE
}
-
+
+ /**
+ * Creates a new instance of SubentryInterceptor
+ */
+ public SubentryInterceptor()
+ {
+ super( InterceptorEnum.SUBENTRY_INTERCEPTOR );
+ }
+
//-------------------------------------------------------------------------------------------
// Search filter methods
Modified: directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Sat Nov 12 15:37:42 2011
@@ -29,6 +29,7 @@ import java.util.Map;
import org.apache.directory.server.core.api.CoreSession;
import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.InterceptorEnum;
import org.apache.directory.server.core.api.entry.ClonedServerEntry;
import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
@@ -96,6 +97,15 @@ public class TriggerInterceptor extends
private static SubentryUtils subentryUtils;
/**
+ * Creates a new instance of a TriggerInterceptor.
+ */
+ public TriggerInterceptor()
+ {
+ super( InterceptorEnum.TRIGGER_INTERCEPTOR );
+ }
+
+
+ /**
* Adds prescriptiveTrigger TriggerSpecificaitons to a collection of
* TriggerSpeficaitions by accessing the triggerSpecCache. The trigger
* specification cache is accessed for each trigger subentry associated
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java?rev=1201278&r1=1201277&r2=1201278&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java Sat Nov 12 15:37:42 2011
@@ -131,6 +131,11 @@ public class SearchLimitsIT extends Abst
class DelayInducingInterceptor extends BaseInterceptor
{
private Long delayMillis;
+
+ public DelayInducingInterceptor()
+ {
+ super( "DelayInterceptor" );
+ }
public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
@@ -184,7 +189,7 @@ public class SearchLimitsIT extends Abst
{
getLdapServer().setMaxTimeLimit( oldMaxTimeLimit );
getLdapServer().setMaxSizeLimit( oldMaxSizeLimit );
- getLdapServer().getDirectoryService().remove( DelayInducingInterceptor.class.getSimpleName() );
+ getLdapServer().getDirectoryService().remove( "DelayInterceptor" );
}