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/13 00:58:42 UTC
svn commit: r1201362 [4/6] - in /directory/apacheds/branches/apacheds-osgi:
interceptor-kerberos/
interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/
interceptors/admin/
interceptors/admin/src/main/java/org/apache/directory/se...
Modified: directory/apacheds/branches/apacheds-osgi/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java Sat Nov 12 23:58:40 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;
@@ -38,7 +39,6 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.api.event.NotificationCriteria;
import org.apache.directory.server.core.api.event.RegistrationEntry;
import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
-import org.apache.directory.server.core.api.interceptor.NextInterceptor;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;
@@ -67,11 +67,19 @@ public class EventInterceptor extends Ba
{
/** A logger for this class */
private final static Logger LOG = LoggerFactory.getLogger( EventInterceptor.class );
-
+
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.
@@ -105,9 +113,9 @@ public class EventInterceptor extends Ba
listener.entryAdded( ( AddOperationContext ) opContext );
}
} );
-
+
break;
-
+
case DELETE:
executor.execute( new Runnable()
{
@@ -116,9 +124,9 @@ public class EventInterceptor extends Ba
listener.entryDeleted( ( DeleteOperationContext ) opContext );
}
} );
-
+
break;
-
+
case MODIFY:
executor.execute( new Runnable()
{
@@ -127,9 +135,9 @@ public class EventInterceptor extends Ba
listener.entryModified( ( ModifyOperationContext ) opContext );
}
} );
-
+
break;
-
+
case MOVE:
executor.execute( new Runnable()
{
@@ -138,7 +146,7 @@ public class EventInterceptor extends Ba
listener.entryMoved( ( MoveOperationContext ) opContext );
}
} );
-
+
break;
case RENAME:
@@ -149,7 +157,7 @@ public class EventInterceptor extends Ba
listener.entryRenamed( ( RenameOperationContext ) opContext );
}
} );
-
+
break;
}
}
@@ -158,10 +166,10 @@ public class EventInterceptor extends Ba
/**
* {@inheritDoc}
*/
- public void add( NextInterceptor next, final AddOperationContext addContext ) throws LdapException
+ public void add( final AddOperationContext addContext ) throws LdapException
{
- next.add( addContext );
-
+ next( addContext );
+
List<RegistrationEntry> selecting = getSelectingRegistrations( addContext.getDn(), addContext.getEntry() );
if ( selecting.isEmpty() )
@@ -182,10 +190,10 @@ public class EventInterceptor extends Ba
/**
* {@inheritDoc}
*/
- public void delete( NextInterceptor next, final DeleteOperationContext deleteContext ) throws LdapException
+ public void delete( final DeleteOperationContext deleteContext ) throws LdapException
{
List<RegistrationEntry> selecting = getSelectingRegistrations( deleteContext.getDn(), deleteContext.getEntry() );
- next.delete( deleteContext );
+ next( deleteContext );
if ( selecting.isEmpty() )
{
@@ -205,13 +213,13 @@ public class EventInterceptor extends Ba
/**
* {@inheritDoc}
*/
- public void modify( NextInterceptor next, final ModifyOperationContext modifyContext ) throws LdapException
+ public void modify( final ModifyOperationContext modifyContext ) throws LdapException
{
Entry oriEntry = modifyContext.getEntry();
List<RegistrationEntry> selecting = getSelectingRegistrations( modifyContext.getDn(), oriEntry );
- next.modify( modifyContext );
+ next( modifyContext );
if ( selecting.isEmpty() )
{
@@ -222,7 +230,7 @@ public class EventInterceptor extends Ba
CoreSession session = modifyContext.getSession();
LookupOperationContext lookupContext = new LookupOperationContext( session, modifyContext.getDn() );
lookupContext.setAttrsId( SchemaConstants.ALL_ATTRIBUTES_ARRAY );
-
+
Entry alteredEntry = directoryService.getPartitionNexus().lookup( lookupContext );
modifyContext.setAlteredEntry( alteredEntry );
@@ -239,31 +247,23 @@ public class EventInterceptor extends Ba
/**
* {@inheritDoc}
*/
- public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
+ public void move( MoveOperationContext moveContext ) throws LdapException
{
- Entry oriEntry = ((ClonedServerEntry)renameContext.getEntry()).getOriginalEntry();
- List<RegistrationEntry> selecting = getSelectingRegistrations( renameContext.getDn(), oriEntry );
+ Entry oriEntry = moveContext.getOriginalEntry();
+ List<RegistrationEntry> selecting = getSelectingRegistrations( moveContext.getDn(), oriEntry );
- next.rename( renameContext );
+ next( moveContext );
if ( selecting.isEmpty() )
{
return;
}
- // Get the modifed entry
- CoreSession session = renameContext.getSession();
- LookupOperationContext lookupContext = new LookupOperationContext( session, renameContext.getNewDn() );
- lookupContext.setAttrsId( SchemaConstants.ALL_ATTRIBUTES_ARRAY );
-
- Entry alteredEntry = directoryService.getPartitionNexus().lookup( lookupContext );
- renameContext.setModifiedEntry( alteredEntry );
-
for ( final RegistrationEntry registration : selecting )
{
- if ( EventType.isRename( registration.getCriteria().getEventMask() ) )
+ if ( EventType.isMove( registration.getCriteria().getEventMask() ) )
{
- fire( renameContext, EventType.RENAME, registration.getListener() );
+ fire( moveContext, EventType.MOVE, registration.getListener() );
}
}
}
@@ -272,11 +272,11 @@ public class EventInterceptor extends Ba
/**
* {@inheritDoc}
*/
- public void moveAndRename( NextInterceptor next, final MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
+ public void moveAndRename( final MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
{
Entry oriEntry = moveAndRenameContext.getOriginalEntry();
List<RegistrationEntry> selecting = getSelectingRegistrations( moveAndRenameContext.getDn(), oriEntry );
- next.moveAndRename( moveAndRenameContext );
+ next( moveAndRenameContext );
if ( selecting.isEmpty() )
{
@@ -302,23 +302,31 @@ public class EventInterceptor extends Ba
/**
* {@inheritDoc}
*/
- public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+ public void rename( RenameOperationContext renameContext ) throws LdapException
{
- Entry oriEntry = moveContext.getOriginalEntry();
- List<RegistrationEntry> selecting = getSelectingRegistrations( moveContext.getDn(), oriEntry );
+ Entry oriEntry = ((ClonedServerEntry)renameContext.getEntry()).getOriginalEntry();
+ List<RegistrationEntry> selecting = getSelectingRegistrations( renameContext.getDn(), oriEntry );
- next.move( moveContext );
+ next( renameContext );
if ( selecting.isEmpty() )
{
return;
}
+ // Get the modifed entry
+ CoreSession session = renameContext.getSession();
+ LookupOperationContext lookupContext = new LookupOperationContext( session, renameContext.getNewDn() );
+ lookupContext.setAttrsId( SchemaConstants.ALL_ATTRIBUTES_ARRAY );
+
+ Entry alteredEntry = directoryService.getPartitionNexus().lookup( lookupContext );
+ renameContext.setModifiedEntry( alteredEntry );
+
for ( final RegistrationEntry registration : selecting )
{
- if ( EventType.isMove( registration.getCriteria().getEventMask() ) )
+ if ( EventType.isRename( registration.getCriteria().getEventMask() ) )
{
- fire( moveContext, EventType.MOVE, registration.getListener() );
+ fire( renameContext, EventType.RENAME, registration.getListener() );
}
}
}
Propchange: directory/apacheds/branches/apacheds-osgi/interceptors/exception/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Nov 12 23:58:40 2011
@@ -0,0 +1,10 @@
+/directory/apacheds/branches/apacheds-codec-merge/interceptors/exception:982369-987590
+/directory/apacheds/branches/apacheds-config/interceptors/exception:1023442-1029077
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptors/exception:1040956-1043765
+/directory/apacheds/branches/apacheds-replication/interceptors/exception:749790-764110
+/directory/apacheds/branches/apacheds-schema/interceptors/exception:806623-896441
+/directory/apacheds/branches/apacheds-subtree/interceptors/exception:965203-965686
+/directory/apacheds/branches/milestones/interceptors/exception:1072812-1075328
+/directory/apacheds/branches/xdbm-refactoring/interceptors/exception:945827-946347
+/directory/apacheds/trunk/interceptors/exception:1066126-1067785,1068026-1072718,1072800-1075329,1185681-1201347
+/directory/studio/trunk/interceptors/exception:1067786-1067997
Modified: directory/apacheds/branches/apacheds-osgi/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Sat Nov 12 23:58:40 2011
@@ -23,14 +23,14 @@ 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;
import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
-import org.apache.directory.server.core.api.interceptor.NextInterceptor;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
-import org.apache.directory.server.core.api.interceptor.context.EntryOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.HasEntryOperationContext;
import org.apache.directory.server.core.api.interceptor.context.ListOperationContext;
import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;
import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
@@ -97,14 +97,18 @@ public class ExceptionInterceptor extend
*/
public ExceptionInterceptor()
{
+ super( InterceptorEnum.EXCEPTION_INTERCEPTOR );
}
+ /**
+ * {@inheritDoc}
+ */
public void init( DirectoryService directoryService ) throws LdapException
{
super.init( directoryService );
nexus = directoryService.getPartitionNexus();
- Value<?> attr = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
+ Value<?> attr = nexus.getRootDse( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
subschemSubentryDn = directoryService.getDnFactory().create( attr.getString() );
}
@@ -118,7 +122,7 @@ public class ExceptionInterceptor extend
* In the pre-invocation state this interceptor method checks to see if the entry to be added already exists. If it
* does an exception is raised.
*/
- public void add( NextInterceptor nextInterceptor, AddOperationContext addContext ) throws LdapException
+ public void add( AddOperationContext addContext ) throws LdapException
{
Dn name = addContext.getDn();
@@ -132,7 +136,7 @@ public class ExceptionInterceptor extend
// we're adding the suffix entry so just ignore stuff to mess with the parent
if ( suffix.equals( name ) )
{
- nextInterceptor.add( addContext );
+ next( addContext );
return;
}
@@ -157,7 +161,7 @@ public class ExceptionInterceptor extend
CoreSession session = addContext.getSession();
LookupOperationContext lookupContext = new LookupOperationContext( session, parentDn );
lookupContext.setAttrsId( SchemaConstants.ALL_ATTRIBUTES_ARRAY );
-
+
attrs = directoryService.getPartitionNexus().lookup( lookupContext );
}
catch ( Exception e )
@@ -186,7 +190,7 @@ public class ExceptionInterceptor extend
}
}
- nextInterceptor.add( addContext );
+ next( addContext );
}
@@ -194,7 +198,7 @@ public class ExceptionInterceptor extend
* Checks to make sure the entry being deleted exists, and has no children, otherwise throws the appropriate
* LdapException.
*/
- public void delete( NextInterceptor nextInterceptor, DeleteOperationContext deleteContext ) throws LdapException
+ public void delete( DeleteOperationContext deleteContext ) throws LdapException
{
Dn dn = deleteContext.getDn();
@@ -204,7 +208,7 @@ public class ExceptionInterceptor extend
subschemSubentryDn ) );
}
- nextInterceptor.delete( deleteContext );
+ next( deleteContext );
// Update the alias cache
synchronized ( notAliasCache )
@@ -218,10 +222,9 @@ public class ExceptionInterceptor extend
/**
- * Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
+ * {@inheritDoc}
*/
- public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext listContext )
- throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
if ( listContext.getDn().getNormName().equals( subschemSubentryDn.getNormName() ) )
{
@@ -233,14 +236,14 @@ public class ExceptionInterceptor extend
//String msg = "Attempt to search under non-existant entry: ";
//assertHasEntry( listContext, msg, listContext.getDn() );
- return nextInterceptor.list( listContext );
+ return next( listContext );
}
/**
- * Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
+ * {@inheritDoc}
*/
- public Entry lookup( NextInterceptor nextInterceptor, LookupOperationContext lookupContext ) throws LdapException
+ public Entry lookup( LookupOperationContext lookupContext ) throws LdapException
{
Dn dn = lookupContext.getDn();
@@ -252,16 +255,16 @@ public class ExceptionInterceptor extend
return serverEntry;
}
- Entry result = nextInterceptor.lookup( lookupContext );
+ Entry result = next( lookupContext );
return result;
}
/**
- * Checks to see the entry being modified exists, otherwise throws the appropriate LdapException.
+ * {@inheritDoc}
*/
- public void modify( NextInterceptor nextInterceptor, ModifyOperationContext modifyContext ) throws LdapException
+ public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
// check if entry to modify exists
String msg = "Attempt to modify non-existant entry: ";
@@ -270,7 +273,7 @@ public class ExceptionInterceptor extend
// and never try to look it up in the nexus below
if ( modifyContext.getDn().equals( subschemSubentryDn ) )
{
- nextInterceptor.modify( modifyContext );
+ next( modifyContext );
return;
}
@@ -291,51 +294,14 @@ public class ExceptionInterceptor extend
}
}
- nextInterceptor.modify( modifyContext );
- }
-
-
- /**
- * Checks to see the entry being renamed exists, otherwise throws the appropriate LdapException.
- */
- public void rename( NextInterceptor nextInterceptor, RenameOperationContext renameContext ) throws LdapException
- {
- Dn dn = renameContext.getDn();
-
- if ( dn.equals( subschemSubentryDn ) )
- {
- throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_255,
- subschemSubentryDn, subschemSubentryDn ) );
- }
-
- // check to see if target entry exists
- Dn newDn = renameContext.getNewDn();
-
- if ( nextInterceptor.hasEntry( new EntryOperationContext( renameContext.getSession(), newDn ) ) )
- {
- LdapEntryAlreadyExistsException e;
- e = new LdapEntryAlreadyExistsException( I18n.err( I18n.ERR_250_ENTRY_ALREADY_EXISTS, newDn.getName() ) );
- //e.setResolvedName( DNFactory.create( newDn.getName() ) );
- throw e;
- }
-
- // Remove the previous entry from the notAnAlias cache
- synchronized ( notAliasCache )
- {
- if ( notAliasCache.containsKey( dn.getNormName() ) )
- {
- notAliasCache.remove( dn.getNormName() );
- }
- }
-
- nextInterceptor.rename( renameContext );
+ next( modifyContext );
}
/**
* {@inheritDoc}
*/
- public void move( NextInterceptor nextInterceptor, MoveOperationContext moveContext ) throws LdapException
+ public void move( MoveOperationContext moveContext ) throws LdapException
{
Dn oriChildName = moveContext.getDn();
@@ -345,7 +311,7 @@ public class ExceptionInterceptor extend
subschemSubentryDn, subschemSubentryDn ) );
}
- nextInterceptor.move( moveContext );
+ next( moveContext );
// Remove the original entry from the NotAlias cache, if needed
synchronized ( notAliasCache )
@@ -359,11 +325,9 @@ public class ExceptionInterceptor extend
/**
- * Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate
- * LdapException.
+ * {@inheritDoc}
*/
- public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext moveAndRenameContext )
- throws LdapException
+ public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
{
Dn oldDn = moveAndRenameContext.getDn();
@@ -383,42 +347,44 @@ public class ExceptionInterceptor extend
}
}
- nextInterceptor.moveAndRename( moveAndRenameContext );
+ next( moveAndRenameContext );
}
/**
- * Asserts that an entry is present and as a side effect if it is not, creates a LdapNoSuchObjectException, which is
- * used to set the before exception on the invocation - eventually the exception is thrown.
- *
- * @param msg the message to prefix to the distinguished name for explanation
- * @throws Exception if the entry does not exist
- * @param nextInterceptor the next interceptor in the chain
+ * {@inheritDoc}
*/
- private void assertHasEntry( OperationContext opContext, String msg ) throws LdapException
+ public void rename( RenameOperationContext renameContext ) throws LdapException
{
- Dn dn = opContext.getDn();
+ Dn dn = renameContext.getDn();
- if ( subschemSubentryDn.equals( dn ) )
+ if ( dn.equals( subschemSubentryDn ) )
{
- return;
+ throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_255,
+ subschemSubentryDn, subschemSubentryDn ) );
}
- if ( opContext.getEntry() == null )
+ // check to see if target entry exists
+ Dn newDn = renameContext.getNewDn();
+
+ if ( nexus.hasEntry( new HasEntryOperationContext( renameContext.getSession(), newDn ) ) )
{
- LdapNoSuchObjectException e;
+ LdapEntryAlreadyExistsException e;
+ e = new LdapEntryAlreadyExistsException( I18n.err( I18n.ERR_250_ENTRY_ALREADY_EXISTS, newDn.getName() ) );
+ //e.setResolvedName( DNFactory.create( newDn.getName() ) );
+ throw e;
+ }
- if ( msg != null )
- {
- e = new LdapNoSuchObjectException( msg + dn.getName() );
- }
- else
+ // Remove the previous entry from the notAnAlias cache
+ synchronized ( notAliasCache )
+ {
+ if ( notAliasCache.containsKey( dn.getNormName() ) )
{
- e = new LdapNoSuchObjectException( dn.getName() );
+ notAliasCache.remove( dn.getNormName() );
}
-
- throw e;
}
+
+ next( renameContext );
}
@@ -427,18 +393,19 @@ public class ExceptionInterceptor extend
* used to set the before exception on the invocation - eventually the exception is thrown.
*
* @param msg the message to prefix to the distinguished name for explanation
- * @param dn the distinguished name of the entry that is asserted
* @throws Exception if the entry does not exist
* @param nextInterceptor the next interceptor in the chain
- *
- private void assertHasEntry( OperationContext opContext, String msg, Dn dn ) throws LdapException
+ */
+ private void assertHasEntry( OperationContext opContext, String msg ) throws LdapException
{
+ Dn dn = opContext.getDn();
+
if ( subschemSubentryDn.equals( dn ) )
{
return;
}
- if ( !opContext.hasEntry( dn, ByPassConstants.HAS_ENTRY_BYPASS ) )
+ if ( opContext.getEntry() == null )
{
LdapNoSuchObjectException e;
@@ -453,5 +420,5 @@ public class ExceptionInterceptor extend
throw e;
}
- }*/
+ }
}
Propchange: directory/apacheds/branches/apacheds-osgi/interceptors/hash/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Nov 12 23:58:40 2011
@@ -0,0 +1,10 @@
+/directory/apacheds/branches/apacheds-codec-merge/interceptors/hash:982369-987590
+/directory/apacheds/branches/apacheds-config/interceptors/hash:1023442-1029077
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptors/hash:1040956-1043765
+/directory/apacheds/branches/apacheds-replication/interceptors/hash:749790-764110
+/directory/apacheds/branches/apacheds-schema/interceptors/hash:806623-896441
+/directory/apacheds/branches/apacheds-subtree/interceptors/hash:965203-965686
+/directory/apacheds/branches/milestones/interceptors/hash:1072812-1075328
+/directory/apacheds/branches/xdbm-refactoring/interceptors/hash:945827-946347
+/directory/apacheds/trunk/interceptors/hash:1066126-1067785,1068026-1072718,1072800-1075329,1185681-1201347
+/directory/studio/trunk/interceptors/hash:1067786-1067997
Modified: directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java Sat Nov 12 23:58:40 2011
@@ -23,16 +23,15 @@ package org.apache.directory.server.core
import java.util.List;
+import org.apache.directory.server.core.api.authn.PasswordUtil;
import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
-import org.apache.directory.server.core.api.interceptor.NextInterceptor;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
-import org.apache.directory.server.core.api.authn.PasswordUtil;
import org.apache.directory.shared.ldap.model.constants.LdapSecurityConstants;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.BinaryValue;
import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.Modification;
import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -43,42 +42,35 @@ 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
* incoming non-hashed password using the given algorithm.
* If the password is found already hashed then it will skip hashing it.
- *
+ *
* @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;
}
- @Override
- public void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException
+ /**
+ * {@inheritDoc}
+ */
+ public void add( AddOperationContext addContext ) throws LdapException
{
if ( algorithm == null )
{
- next.add( addContext );
+ next( addContext );
return;
}
@@ -88,16 +80,18 @@ public class PasswordHashingInterceptor
includeHashedPassword( pwdAt );
- next.add( addContext );
+ next( addContext );
}
- @Override
- public void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws LdapException
+ /**
+ * {@inheritDoc}
+ */
+ public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
if ( algorithm == null )
{
- next.modify( modifyContext );
+ next( modifyContext );
return;
}
@@ -107,7 +101,7 @@ public class PasswordHashingInterceptor
{
String oid = mod.getAttribute().getAttributeType().getOid();
- // check for modification on 'userPassword' AT
+ // check for modification on 'userPassword' AT
if ( SchemaConstants.USER_PASSWORD_AT_OID.equals( oid ) )
{
includeHashedPassword( mod.getAttribute() );
@@ -115,7 +109,7 @@ public class PasswordHashingInterceptor
}
}
- next.modify( modifyContext );
+ next( modifyContext );
}
Modified: directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java Sat Nov 12 23:58:40 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/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java Sat Nov 12 23:58:40 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 );
}
}
Propchange: directory/apacheds/branches/apacheds-osgi/interceptors/journal/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Nov 12 23:58:40 2011
@@ -0,0 +1,10 @@
+/directory/apacheds/branches/apacheds-codec-merge/interceptors/journal:982369-987590
+/directory/apacheds/branches/apacheds-config/interceptors/journal:1023442-1029077
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptors/journal:1040956-1043765
+/directory/apacheds/branches/apacheds-replication/interceptors/journal:749790-764110
+/directory/apacheds/branches/apacheds-schema/interceptors/journal:806623-896441
+/directory/apacheds/branches/apacheds-subtree/interceptors/journal:965203-965686
+/directory/apacheds/branches/milestones/interceptors/journal:1072812-1075328
+/directory/apacheds/branches/xdbm-refactoring/interceptors/journal:945827-946347
+/directory/apacheds/trunk/interceptors/journal:1066126-1067785,1068026-1072718,1072800-1075329,1185681-1201347
+/directory/studio/trunk/interceptors/journal:1067786-1067997
Modified: directory/apacheds/branches/apacheds-osgi/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java Sat Nov 12 23:58:40 2011
@@ -22,8 +22,8 @@ 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.NextInterceptor;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
@@ -53,39 +53,47 @@ public class JournalInterceptor extends
{
/** for debugging */
private static final Logger LOG = LoggerFactory.getLogger( JournalInterceptor.class );
-
+
/** A flag set to true if the journal interceptor is enabled */
private boolean journalEnabled;
-
- /** A shared number stored within each change */
+
+ /** A shared number stored within each change */
private AtomicLong revision;
-
+
/** 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
// -----------------------------------------------------------------------
/**
- * The init method will initialize the local variables and load the
+ * The init method will initialize the local variables and load the
* entryDeleted AttributeType.
*/
public void init( DirectoryService directoryService ) throws LdapException
{
super.init( directoryService );
-
+
if ( directoryService.getJournal().isEnabled() )
{
- journalEnabled = true;
+ journalEnabled = true;
journal = directoryService.getJournal();
revision = new AtomicLong( System.currentTimeMillis() );
}
LOG.debug( "JournalInterceptor has been initialized" );
}
-
-
+
+
/**
* Log the operation, manage the logs rotations.
*/
@@ -93,22 +101,22 @@ public class JournalInterceptor extends
{
journal.log( getPrincipal( opCtx ), revision, ldif );
}
-
-
+
+
// -----------------------------------------------------------------------
// Overridden (only change inducing) intercepted methods
// -----------------------------------------------------------------------
/**
* {@inheritDoc}
*/
- public void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException
+ public void add( AddOperationContext addContext ) throws LdapException
{
long opRevision = 0;
-
+
if ( journalEnabled )
{
opRevision = revision.incrementAndGet();
-
+
// Store the added entry
Entry addEntry = addContext.getEntry();
@@ -121,13 +129,13 @@ public class JournalInterceptor extends
AttributeType attributeType = attribute.getAttributeType();
ldif.addAttribute( addEntry.get( attributeType).clone() );
}
-
+
log( addContext, opRevision, ldif );
}
try
{
- next.add( addContext );
+ next( addContext );
if ( journalEnabled )
{
@@ -142,7 +150,7 @@ public class JournalInterceptor extends
// log the NACK
journal.nack( opRevision );
}
-
+
throw le;
}
}
@@ -151,25 +159,25 @@ public class JournalInterceptor extends
/**
* {@inheritDoc}
*/
- public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+ public void delete( DeleteOperationContext deleteContext ) throws LdapException
{
long opRevision = 0;
-
+
if ( journalEnabled )
{
opRevision = revision.incrementAndGet();
-
+
// Store the deleted entry
LdifEntry ldif = new LdifEntry();
ldif.setChangeType( ChangeType.Delete );
ldif.setDn( deleteContext.getDn() );
-
+
journal.log( getPrincipal( deleteContext ), opRevision, ldif );
}
try
{
- next.delete( deleteContext );
+ next( deleteContext );
if ( journalEnabled )
{
@@ -184,7 +192,7 @@ public class JournalInterceptor extends
// log the NACK
journal.nack( opRevision );
}
-
+
throw e;
}
}
@@ -193,31 +201,31 @@ public class JournalInterceptor extends
/**
* {@inheritDoc}
*/
- public void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws LdapException
+ public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
long opRevision = 0;
-
+
if ( journalEnabled )
{
opRevision = revision.incrementAndGet();
-
+
// Store the modified entry
LdifEntry ldif = new LdifEntry();
ldif.setChangeType( ChangeType.Modify );
ldif.setDn( modifyContext.getDn() );
-
- // Store the modifications
+
+ // Store the modifications
for ( Modification modification:modifyContext.getModItems() )
{
ldif.addModification( modification );
}
-
+
journal.log( getPrincipal( modifyContext ), opRevision, ldif );
}
-
+
try
{
- next.modify( modifyContext );
+ next( modifyContext );
if ( journalEnabled )
{
@@ -240,28 +248,27 @@ public class JournalInterceptor extends
/**
* {@inheritDoc}
*/
- public void rename ( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
+ public void move( MoveOperationContext moveContext ) throws LdapException
{
long opRevision = 0;
-
+
if ( journalEnabled )
{
opRevision = revision.incrementAndGet();
-
- // Store the renamed entry
+
+ // Store the moved entry
LdifEntry ldif = new LdifEntry();
- ldif.setChangeType( ChangeType.ModRdn );
- ldif.setDn( renameContext.getDn() );
- ldif.setNewRdn( renameContext.getNewRdn().getNormName() );
- ldif.setDeleteOldRdn( renameContext.getDeleteOldRdn() );
-
- journal.log( getPrincipal( renameContext ), opRevision, ldif );
+ ldif.setChangeType( ChangeType.ModDn );
+ ldif.setDn( moveContext.getDn() );
+ ldif.setNewSuperior( moveContext.getNewSuperior().getNormName() );
+
+ journal.log( getPrincipal( moveContext ), opRevision, ldif );
}
-
+
try
{
- next.rename( renameContext );
-
+ next( moveContext );
+
if ( journalEnabled )
{
// log the ACK
@@ -275,7 +282,7 @@ public class JournalInterceptor extends
// log the NACK
journal.nack( opRevision );
}
-
+
throw e;
}
}
@@ -284,15 +291,14 @@ public class JournalInterceptor extends
/**
* {@inheritDoc}
*/
- public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext )
- throws LdapException
+ public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
{
long opRevision = 0;
-
+
if ( journalEnabled )
{
opRevision = revision.incrementAndGet();
-
+
// Store the renamed entry
LdifEntry ldif = new LdifEntry();
ldif.setChangeType( ChangeType.ModDn );
@@ -300,14 +306,14 @@ public class JournalInterceptor extends
ldif.setNewRdn( moveAndRenameContext.getNewRdn().getNormName() );
ldif.setDeleteOldRdn( moveAndRenameContext.getDeleteOldRdn() );
ldif.setNewSuperior( moveAndRenameContext.getNewDn().getNormName() );
-
+
journal.log( getPrincipal( moveAndRenameContext ), opRevision, ldif );
}
-
+
try
{
- next.moveAndRename( moveAndRenameContext );
-
+ next( moveAndRenameContext );
+
if ( journalEnabled )
{
// log the ACK
@@ -321,7 +327,7 @@ public class JournalInterceptor extends
// log the NACK
journal.nack( opRevision );
}
-
+
throw e;
}
}
@@ -330,27 +336,28 @@ public class JournalInterceptor extends
/**
* {@inheritDoc}
*/
- public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+ public void rename( RenameOperationContext renameContext ) throws LdapException
{
long opRevision = 0;
-
+
if ( journalEnabled )
{
opRevision = revision.incrementAndGet();
-
- // Store the moved entry
+
+ // Store the renamed entry
LdifEntry ldif = new LdifEntry();
- ldif.setChangeType( ChangeType.ModDn );
- ldif.setDn( moveContext.getDn() );
- ldif.setNewSuperior( moveContext.getNewSuperior().getNormName() );
-
- journal.log( getPrincipal( moveContext ), opRevision, ldif );
+ ldif.setChangeType( ChangeType.ModRdn );
+ ldif.setDn( renameContext.getDn() );
+ ldif.setNewRdn( renameContext.getNewRdn().getNormName() );
+ ldif.setDeleteOldRdn( renameContext.getDeleteOldRdn() );
+
+ journal.log( getPrincipal( renameContext ), opRevision, ldif );
}
-
+
try
{
- next.move( moveContext );
-
+ next( renameContext );
+
if ( journalEnabled )
{
// log the ACK
@@ -364,8 +371,8 @@ public class JournalInterceptor extends
// log the NACK
journal.nack( opRevision );
}
-
+
throw e;
}
- }
+ }
}
\ No newline at end of file
Propchange: directory/apacheds/branches/apacheds-osgi/interceptors/logger/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Nov 12 23:58:40 2011
@@ -0,0 +1,10 @@
+/directory/apacheds/branches/apacheds-codec-merge/interceptors/logger:982369-987590
+/directory/apacheds/branches/apacheds-config/interceptors/logger:1023442-1029077
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptors/logger:1040956-1043765
+/directory/apacheds/branches/apacheds-replication/interceptors/logger:749790-764110
+/directory/apacheds/branches/apacheds-schema/interceptors/logger:806623-896441
+/directory/apacheds/branches/apacheds-subtree/interceptors/logger:965203-965686
+/directory/apacheds/branches/milestones/interceptors/logger:1072812-1075328
+/directory/apacheds/branches/xdbm-refactoring/interceptors/logger:945827-946347
+/directory/apacheds/trunk/interceptors/logger:1066126-1067785,1068026-1072718,1072800-1075329,1185681-1201347
+/directory/studio/trunk/interceptors/logger:1067786-1067997
Modified: directory/apacheds/branches/apacheds-osgi/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java?rev=1201362&r1=1201361&r2=1201362&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-osgi/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java Sat Nov 12 23:58:40 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.logger;
@@ -24,14 +24,13 @@ import java.util.concurrent.atomic.Atomi
import org.apache.directory.server.core.api.DirectoryService;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
-import org.apache.directory.server.core.api.interceptor.Interceptor;
-import org.apache.directory.server.core.api.interceptor.NextInterceptor;
+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.BindOperationContext;
import org.apache.directory.server.core.api.interceptor.context.CompareOperationContext;
import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
-import org.apache.directory.server.core.api.interceptor.context.EntryOperationContext;
-import org.apache.directory.server.core.api.interceptor.context.GetRootDSEOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.GetRootDseOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.HasEntryOperationContext;
import org.apache.directory.server.core.api.interceptor.context.ListOperationContext;
import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;
import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
@@ -48,8 +47,8 @@ import org.slf4j.LoggerFactory;
/**
* An interceptor used to log times to process each operation.
*
- * The way it works is that it gathers the time to process an operation
- * into a global counter, which is logged every 1000 operations (when
+ * The way it works is that it gathers the time to process an operation
+ * into a global counter, which is logged every 1000 operations (when
* using the OPERATION_STATS logger). It's also possible to get the time for
* each single operation if activating the OPERATION_TIME logger.
*
@@ -57,7 +56,7 @@ import org.slf4j.LoggerFactory;
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class TimerInterceptor implements Interceptor
+public class TimerInterceptor extends BaseInterceptor
{
/** A aggregating logger */
private static final Logger OPERATION_STATS = LoggerFactory.getLogger( "OPERATION_STATS" );
@@ -69,9 +68,6 @@ public class TimerInterceptor implements
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 );
@@ -87,11 +83,11 @@ public class TimerInterceptor implements
/** Stats for the delete operation */
private static AtomicLong totalDelete = new AtomicLong( 0 );
private static AtomicInteger nbDeleteCalls = new AtomicInteger( 0 );
-
- /** Stats for the GetRootDSE operation */
- private static AtomicLong totalGetRootDSE = new AtomicLong( 0 );
- private static AtomicInteger nbGetRootDSECalls = new AtomicInteger( 0 );
-
+
+ /** Stats for the GetRootDse operation */
+ private static AtomicLong totalGetRootDse = new AtomicLong( 0 );
+ private static AtomicInteger nbGetRootDseCalls = new AtomicInteger( 0 );
+
/** Stats for the HasEntry operation */
private static AtomicLong totalHasEntry = new AtomicLong( 0 );
private static AtomicInteger nbHasEntryCalls = new AtomicInteger( 0 );
@@ -99,71 +95,87 @@ public class TimerInterceptor implements
/** Stats for the list operation */
private static AtomicLong totalList = new AtomicLong( 0 );
private static AtomicInteger nbListCalls = new AtomicInteger( 0 );
-
+
/** Stats for the lookup operation */
private static AtomicLong totalLookup = new AtomicLong( 0 );
private static AtomicInteger nbLookupCalls = new AtomicInteger( 0 );
-
+
/** Stats for the modify operation */
private static AtomicLong totalModify = new AtomicLong( 0 );
private static AtomicInteger nbModifyCalls = new AtomicInteger( 0 );
-
+
/** Stats for the move operation */
private static AtomicLong totalMove = new AtomicLong( 0 );
private static AtomicInteger nbMoveCalls = new AtomicInteger( 0 );
-
+
/** Stats for the moveAndRename operation */
private static AtomicLong totalMoveAndRename = new AtomicLong( 0 );
private static AtomicInteger nbMoveAndRenameCalls = new AtomicInteger( 0 );
-
+
/** Stats for the rename operation */
private static AtomicLong totalRename = new AtomicLong( 0 );
private static AtomicInteger nbRenameCalls = new AtomicInteger( 0 );
-
+
/** Stats for the search operation */
private static AtomicLong totalSearch = new AtomicLong( 0 );
private static AtomicInteger nbSearchCalls = new AtomicInteger( 0 );
-
+
/** Stats for the unbind operation */
private static AtomicLong totalUnbind = new AtomicLong( 0 );
private static AtomicInteger nbUnbindCalls = new AtomicInteger( 0 );
-
+
/**
*
* 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 );
}
-
-
+
+
/**
* {@inheritDoc}
*/
- public void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException
+ public void init( DirectoryService directoryService ) throws LdapException
+ {
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void destroy()
+ {
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void add( AddOperationContext addContext ) throws LdapException
{
long t0 = System.nanoTime();
- next.add( addContext );
+ next( addContext );
long delta = System.nanoTime() - t0;
if ( IS_DEBUG_STATS )
{
nbAddCalls.incrementAndGet();
totalAdd.getAndAdd( delta );
-
+
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 );
}
}
@@ -171,27 +183,27 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public void bind( NextInterceptor next, BindOperationContext bindContext ) throws LdapException
+ public void bind( BindOperationContext bindContext ) throws LdapException
{
long t0 = System.nanoTime();
- next.bind( bindContext );
+ next( bindContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbBindCalls.incrementAndGet();
totalBind.getAndAdd( delta );
-
+
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 );
}
}
@@ -199,29 +211,29 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public boolean compare( NextInterceptor next, CompareOperationContext compareContext ) throws LdapException
+ public boolean compare( CompareOperationContext compareContext ) throws LdapException
{
long t0 = System.nanoTime();
- boolean compare = next.compare( compareContext );
+ boolean compare = next( compareContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbCompareCalls.incrementAndGet();
totalCompare.getAndAdd( delta );
-
+
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;
}
@@ -229,27 +241,27 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+ public void delete( DeleteOperationContext deleteContext ) throws LdapException
{
long t0 = System.nanoTime();
- next.delete( deleteContext );
+ next( deleteContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbDeleteCalls.incrementAndGet();
totalDelete.getAndAdd( delta );
-
+
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 );
}
}
@@ -257,115 +269,89 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public void destroy()
- {
- }
-
-
- /**
- * {@inheritDoc}
- */
- public String getName()
- {
- return name;
- }
-
-
- /**
- * {@inheritDoc}
- */
- public Entry getRootDSE( NextInterceptor next, GetRootDSEOperationContext getRootDseContext )
- throws LdapException
+ public Entry getRootDse( GetRootDseOperationContext getRootDseContext ) throws LdapException
{
long t0 = System.nanoTime();
- Entry rootDSE = next.getRootDSE( getRootDseContext );
+ Entry rootDse = next( getRootDseContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
- nbGetRootDSECalls.incrementAndGet();
- totalGetRootDSE.getAndAdd( delta );
-
- if ( nbGetRootDSECalls.get() % 1000 == 0 )
+ nbGetRootDseCalls.incrementAndGet();
+ totalGetRootDse.getAndAdd( delta );
+
+ if ( nbGetRootDseCalls.get() % 1000 == 0 )
{
- long average = totalGetRootDSE.get()/(nbGetRootDSECalls.get() * 1000);
- OPERATION_STATS.debug( name + " : Average getRootDSE = {} microseconds, nb getRootDSEs = {}", average, nbGetRootDSECalls.get() );
+ long average = totalGetRootDse.get()/(nbGetRootDseCalls.get() * 1000);
+ 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;
+
+ return rootDse;
}
/**
* {@inheritDoc}
*/
- public boolean hasEntry( NextInterceptor next, EntryOperationContext hasEntryContext ) throws LdapException
+ public boolean hasEntry( HasEntryOperationContext hasEntryContext ) throws LdapException
{
long t0 = System.nanoTime();
- boolean hasEntry = next.hasEntry( hasEntryContext );
+ boolean hasEntry = next( hasEntryContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbHasEntryCalls.incrementAndGet();
totalHasEntry.getAndAdd( delta );
-
+
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;
- }
-
- /**
- * {@inheritDoc}
- */
- public void init( DirectoryService directoryService ) throws LdapException
- {
+ return hasEntry;
}
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
long t0 = System.nanoTime();
- EntryFilteringCursor cursor = next.list( listContext );
+ EntryFilteringCursor cursor = next( listContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbListCalls.incrementAndGet();
totalList.getAndAdd( delta );
-
+
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;
}
@@ -373,27 +359,27 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public Entry lookup( NextInterceptor next, LookupOperationContext lookupContext ) throws LdapException
+ public Entry lookup( LookupOperationContext lookupContext ) throws LdapException
{
long t0 = System.nanoTime();
- Entry entry = next.lookup( lookupContext );
+ Entry entry = next( lookupContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbLookupCalls.incrementAndGet();
totalLookup.getAndAdd( delta );
-
+
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;
@@ -403,27 +389,27 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws LdapException
+ public void modify( ModifyOperationContext modifyContext ) throws LdapException
{
long t0 = System.nanoTime();
- next.modify( modifyContext );
+ next( modifyContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbModifyCalls.incrementAndGet();
totalModify.getAndAdd( delta );
-
+
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 );
}
}
@@ -431,27 +417,27 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+ public void move( MoveOperationContext moveContext ) throws LdapException
{
long t0 = System.nanoTime();
- next.move( moveContext );
+ next( moveContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbMoveCalls.incrementAndGet();
totalMove.getAndAdd( delta );
-
+
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 );
}
}
@@ -459,27 +445,27 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
+ public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
{
long t0 = System.nanoTime();
- next.moveAndRename( moveAndRenameContext );
+ next( moveAndRenameContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbMoveAndRenameCalls.incrementAndGet();
totalMoveAndRename.getAndAdd( delta );
-
+
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 );
}
}
@@ -487,27 +473,27 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
+ public void rename( RenameOperationContext renameContext ) throws LdapException
{
long t0 = System.nanoTime();
- next.rename( renameContext );
+ next( renameContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbRenameCalls.incrementAndGet();
totalRename.getAndAdd( delta );
-
+
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 );
}
}
@@ -515,29 +501,29 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext searchContext ) throws LdapException
+ public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
{
long t0 = System.nanoTime();
- EntryFilteringCursor cursor = next.search( searchContext );
+ EntryFilteringCursor cursor = next( searchContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbSearchCalls.incrementAndGet();
totalSearch.getAndAdd( delta );
-
+
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;
}
@@ -545,27 +531,27 @@ public class TimerInterceptor implements
/**
* {@inheritDoc}
*/
- public void unbind( NextInterceptor next, UnbindOperationContext unbindContext ) throws LdapException
+ public void unbind( UnbindOperationContext unbindContext ) throws LdapException
{
long t0 = System.nanoTime();
- next.unbind( unbindContext );
+ next( unbindContext );
long delta = System.nanoTime() - t0;
-
+
if ( IS_DEBUG_STATS )
{
nbUnbindCalls.incrementAndGet();
totalUnbind.getAndAdd( delta );
-
+
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 );
}
}
}
Propchange: directory/apacheds/branches/apacheds-osgi/interceptors/normalization/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Nov 12 23:58:40 2011
@@ -0,0 +1,10 @@
+/directory/apacheds/branches/apacheds-codec-merge/interceptors/normalization:982369-987590
+/directory/apacheds/branches/apacheds-config/interceptors/normalization:1023442-1029077
+/directory/apacheds/branches/apacheds-kerberos-codec-2.0/interceptors/normalization:1040956-1043765
+/directory/apacheds/branches/apacheds-replication/interceptors/normalization:749790-764110
+/directory/apacheds/branches/apacheds-schema/interceptors/normalization:806623-896441
+/directory/apacheds/branches/apacheds-subtree/interceptors/normalization:965203-965686
+/directory/apacheds/branches/milestones/interceptors/normalization:1072812-1075328
+/directory/apacheds/branches/xdbm-refactoring/interceptors/normalization:945827-946347
+/directory/apacheds/trunk/interceptors/normalization:1066126-1067785,1068026-1072718,1072800-1075329,1185681-1201347
+/directory/studio/trunk/interceptors/normalization:1067786-1067997