directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r987611 [11/13] - in /directory/apacheds/trunk: ./ all/ core-annotations/ core-api/ core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/event/ core-api/src/main/java/org/apache/di...
Date Fri, 20 Aug 2010 19:32:02 GMT
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchContext.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchContext.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchContext.java Fri Aug 20 19:31:58 2010
@@ -28,7 +28,7 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.message.internal.InternalSearchRequest;
+import org.apache.directory.shared.ldap.message.SearchRequest;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -43,7 +43,7 @@ import org.apache.directory.shared.ldap.
 public class PagedSearchContext
 {
     /** The previous search request */
-    private InternalSearchRequest previousSearchRequest;
+    private SearchRequest previousSearchRequest;
 
     /** The current position in the cursor */
     private int currentPosition;
@@ -60,7 +60,7 @@ public class PagedSearchContext
     /**
      * Creates a new instance of this class, storing the SearchRequest into it.
      */
-    public PagedSearchContext( InternalSearchRequest searchRequest )
+    public PagedSearchContext( SearchRequest searchRequest )
     {
         previousSearchRequest = searchRequest;
         currentPosition = 0;
@@ -110,7 +110,7 @@ public class PagedSearchContext
     /**
      * Build a set of OIDs from the list of attributes we have in the search request
      */
-    private Set<String> buildAttributeSet( InternalSearchRequest request,
+    private Set<String> buildAttributeSet( SearchRequest request,
         SchemaManager schemaManager )
     {
         Set<String> requestSet = new HashSet<String>();
@@ -147,7 +147,7 @@ public class PagedSearchContext
      * @param request The new SearchRequest
      * @return true if both request are equal.
      */
-    public boolean hasSameRequest( InternalSearchRequest request, LdapSession session )
+    public boolean hasSameRequest( SearchRequest request, LdapSession session )
     {
         // Compares the scope
         if ( request.getScope() != previousSearchRequest.getScope() )
@@ -282,7 +282,7 @@ public class PagedSearchContext
     /**
      * @return The previous search request
      */
-    public InternalSearchRequest getPreviousSearchRequest()
+    public SearchRequest getPreviousSearchRequest()
     {
         return previousSearchRequest;
     }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/CertGenerationRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/CertGenerationRequestHandler.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/CertGenerationRequestHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/CertGenerationRequestHandler.java Fri Aug 20 19:31:58 2010
@@ -36,11 +36,12 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.extended.operations.certGeneration.CertGenerationDecoder;
 import org.apache.directory.shared.ldap.codec.extended.operations.certGeneration.CertGenerationObject;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.message.extended.CertGenerationRequest;
 import org.apache.directory.shared.ldap.message.extended.CertGenerationResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.name.DN;
 
+
 /**
  * An extended handler for digital certificate generation
  * 
@@ -72,28 +73,29 @@ public class CertGenerationRequestHandle
     }
 
 
-    public void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception
+    public void handleExtendedOperation( LdapSession session, ExtendedRequest req ) throws Exception
     {
-        ByteBuffer bb = ByteBuffer.wrap( req.getPayload() );
+        ByteBuffer bb = ByteBuffer.wrap( req.getRequestValue() );
         Asn1Decoder decoder = new CertGenerationDecoder();
         CertGenerationContainer container = new CertGenerationContainer();
-        
+
         try
         {
             decoder.decode( bb, container );
         }
-        catch( DecoderException e )
+        catch ( DecoderException e )
         {
             throw e;
         }
-        
+
         CertGenerationObject certGenObj = container.getCertGenerationObject();
-        
+
         Entry entry = session.getCoreSession().lookup( new DN( certGenObj.getTargetDN() ) );
-        
+
         if ( entry != null )
         {
-            TlsKeyGenerator.addKeyPair( ((ClonedServerEntry)entry).getOriginalEntry(), certGenObj.getIssuerDN(), certGenObj.getSubjectDN(), certGenObj.getKeyAlgorithm() );
+            TlsKeyGenerator.addKeyPair( ( ( ClonedServerEntry ) entry ).getOriginalEntry(), certGenObj.getIssuerDN(),
+                certGenObj.getSubjectDN(), certGenObj.getKeyAlgorithm() );
         }
     }
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java Fri Aug 20 19:31:58 2010
@@ -31,12 +31,12 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.server.ldap.ExtendedOperationHandler;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.ldap.LdapSession;
+import org.apache.directory.shared.ldap.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.extended.GracefulDisconnect;
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownRequest;
 import org.apache.directory.shared.ldap.message.extended.GracefulShutdownResponse;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
-import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
 import org.apache.mina.core.future.WriteFuture;
 import org.apache.mina.core.service.IoAcceptor;
 import org.apache.mina.core.session.IoSession;
@@ -69,7 +69,7 @@ public class GracefulShutdownHandler imp
     }
 
 
-    public void handleExtendedOperation( LdapSession requestor, InternalExtendedRequest req ) throws Exception
+    public void handleExtendedOperation( LdapSession requestor, ExtendedRequest req ) throws Exception
     {
         // make sue only the administrator can issue this shutdown request if 
         // not we respond to the requestor with with insufficientAccessRights(50)

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java Fri Aug 20 19:31:58 2010
@@ -40,11 +40,11 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.server.ldap.ExtendedOperationHandler;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.ldap.LdapSession;
+import org.apache.directory.shared.ldap.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
+import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalExtendedResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalLdapResult;
 import org.apache.mina.core.filterchain.IoFilterChain;
 import org.apache.mina.filter.ssl.SslFilter;
 import org.slf4j.Logger;
@@ -63,25 +63,24 @@ public class StartTlsHandler implements 
 
     private static final Set<String> EXTENSION_OIDS;
     private static final Logger LOG = LoggerFactory.getLogger( StartTlsHandler.class );
-    
+
     private SSLContext sslContext;
 
-    
     static
     {
         Set<String> set = new HashSet<String>( 3 );
         set.add( EXTENSION_OID );
         EXTENSION_OIDS = Collections.unmodifiableSet( set );
     }
-    
 
-    public void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception
+
+    public void handleExtendedOperation( LdapSession session, ExtendedRequest req ) throws Exception
     {
         LOG.info( "Handling StartTLS request." );
-        
+
         IoFilterChain chain = session.getIoSession().getFilterChain();
         SslFilter sslFilter = ( SslFilter ) chain.get( "sslFilter" );
-        if( sslFilter == null )
+        if ( sslFilter == null )
         {
             sslFilter = new SslFilter( sslContext );
             chain.addFirst( "sslFilter", sslFilter );
@@ -90,19 +89,18 @@ public class StartTlsHandler implements 
         {
             sslFilter.startSsl( session.getIoSession() );
         }
-        
-        InternalExtendedResponse res = new ExtendedResponseImpl( req.getMessageId() );
-        InternalLdapResult result = res.getLdapResult();
+
+        ExtendedResponse res = new ExtendedResponseImpl( req.getMessageId() );
+        LdapResult result = res.getLdapResult();
         result.setResultCode( ResultCodeEnum.SUCCESS );
         res.setResponseName( EXTENSION_OID );
-        res.setResponse( new byte[ 0 ] );
+        res.setResponseValue( new byte[0] );
 
         // Send a response.
         session.getIoSession().setAttribute( SslFilter.DISABLE_ENCRYPTION_ONCE );
         session.getIoSession().write( res );
     }
-    
-    
+
     class ServerX509TrustManager implements X509TrustManager
     {
         public void checkClientTrusted( X509Certificate[] chain, String authType ) throws CertificateException
@@ -110,11 +108,13 @@ public class StartTlsHandler implements 
             LOG.debug( "checkClientTrusted() called" );
         }
 
+
         public void checkServerTrusted( X509Certificate[] chain, String authType ) throws CertificateException
         {
             LOG.debug( "checkServerTrusted() called" );
         }
 
+
         public X509Certificate[] getAcceptedIssuers()
         {
             LOG.debug( "getAcceptedIssuers() called" );
@@ -134,14 +134,16 @@ public class StartTlsHandler implements 
         return EXTENSION_OID;
     }
 
-    
+
     public void setLdapServer( LdapServer ldapServer )
     {
         LOG.debug( "Setting LDAP Service" );
         Provider provider = Security.getProvider( "SUN" );
         LOG.debug( "provider = {}", provider );
         CoreKeyStoreSpi coreKeyStoreSpi = new CoreKeyStoreSpi( ldapServer.getDirectoryService() );
-        KeyStore keyStore = new KeyStore( coreKeyStoreSpi, provider, "JKS" ) {};
+        KeyStore keyStore = new KeyStore( coreKeyStoreSpi, provider, "JKS" )
+        {
+        };
 
         try
         {
@@ -151,7 +153,7 @@ public class StartTlsHandler implements 
         {
             throw new RuntimeException( I18n.err( I18n.ERR_678 ) );
         }
-        
+
         KeyManagerFactory keyManagerFactory = null;
         try
         {
@@ -161,7 +163,7 @@ public class StartTlsHandler implements 
         {
             throw new RuntimeException( I18n.err( I18n.ERR_679 ), e );
         }
-        
+
         try
         {
             keyManagerFactory.init( keyStore, null );
@@ -170,7 +172,7 @@ public class StartTlsHandler implements 
         {
             throw new RuntimeException( I18n.err( I18n.ERR_680 ), e );
         }
-        
+
         try
         {
             sslContext = SSLContext.getInstance( "TLS" );
@@ -179,12 +181,11 @@ public class StartTlsHandler implements 
         {
             throw new RuntimeException( I18n.err( I18n.ERR_681 ), e );
         }
-        
+
         try
         {
-            sslContext.init( keyManagerFactory.getKeyManagers(), 
-                new TrustManager[] { new ServerX509TrustManager() }, 
-                new SecureRandom() );
+            sslContext.init( keyManagerFactory.getKeyManagers(), new TrustManager[]
+                { new ServerX509TrustManager() }, new SecureRandom() );
         }
         catch ( Exception e )
         {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java Fri Aug 20 19:31:58 2010
@@ -43,10 +43,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedureContainer;
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedureDecoder;
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedure.StoredProcedureParameter;
+import org.apache.directory.shared.ldap.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.message.extended.StoredProcedureRequest;
 import org.apache.directory.shared.ldap.message.extended.StoredProcedureResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalExtendedRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalExtendedResponse;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.sp.LdapContextParameter;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -60,8 +60,8 @@ public class StoredProcedureExtendedOper
 {
     private StoredProcExecutionManager manager;
     private static final Object[] EMPTY_CLASS_ARRAY = new Object[0];
-    
-    
+
+
     public StoredProcedureExtendedOperationHandler()
     {
         super();
@@ -75,40 +75,41 @@ public class StoredProcedureExtendedOper
     }
 
 
-    public void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception
+    public void handleExtendedOperation( LdapSession session, ExtendedRequest req ) throws Exception
     {
-        StoredProcedure spBean = decodeBean( req.getPayload() );
-        
+        StoredProcedure spBean = decodeBean( req.getRequestValue() );
+
         String procedure = StringTools.utf8ToString( spBean.getProcedure() );
         ClonedServerEntry spUnit = manager.findStoredProcUnit( session.getCoreSession(), procedure );
         StoredProcEngine engine = manager.getStoredProcEngineInstance( spUnit );
-        
+
         List<Object> valueList = new ArrayList<Object>( spBean.getParameters().size() );
-        
-        for ( StoredProcedureParameter pPojo:spBean.getParameters() )
+
+        for ( StoredProcedureParameter pPojo : spBean.getParameters() )
         {
             byte[] serializedValue = pPojo.getValue();
             Object value = SerializationUtils.deserialize( serializedValue );
-            
+
             if ( value.getClass().equals( LdapContextParameter.class ) )
             {
                 String paramCtx = ( ( LdapContextParameter ) value ).getValue();
                 value = session.getCoreSession().lookup( new DN( paramCtx ) );
             }
-            
+
             valueList.add( value );
         }
-        
+
         Object[] values = valueList.toArray( EMPTY_CLASS_ARRAY );
-        
+
         Object response = engine.invokeProcedure( session.getCoreSession(), procedure, values );
-        
+
         byte[] serializedResponse = SerializationUtils.serialize( ( Serializable ) response );
-        ( ( InternalExtendedResponse )( req.getResultResponse() ) ).setResponse( serializedResponse );
+        ( ( ExtendedResponse ) ( req.getResultResponse() ) ).setResponseValue( serializedResponse );
         session.getIoSession().write( req.getResultResponse() );
-        
+
     }
-    
+
+
     private StoredProcedure decodeBean( byte[] payload )
     {
         Asn1Decoder storedProcedureDecoder = new StoredProcedureDecoder();
@@ -125,19 +126,18 @@ public class StoredProcedureExtendedOper
         }
 
         StoredProcedure spBean = ( ( StoredProcedureContainer ) storedProcedureContainer ).getStoredProcedure();
-        
+
         return spBean;
     }
 
-    
+
     public String getOid()
     {
         return StoredProcedureRequest.EXTENSION_OID;
     }
 
-
     private static final Set<String> EXTENSION_OIDS;
-    
+
     static
     {
         Set<String> s = new HashSet<String>();
@@ -145,8 +145,8 @@ public class StoredProcedureExtendedOper
         s.add( StoredProcedureResponse.EXTENSION_OID );
         EXTENSION_OIDS = Collections.unmodifiableSet( s );
     }
-    
-    
+
+
     public Set<String> getExtensionOids()
     {
         return EXTENSION_OIDS;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaDitStoreUtil.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaDitStoreUtil.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaDitStoreUtil.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaDitStoreUtil.java Fri Aug 20 19:31:58 2010
@@ -26,8 +26,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.directory.ldap.client.api.message.SearchResponse;
-import org.apache.directory.ldap.client.api.message.SearchResultEntry;
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapCoreSessionConnection;
@@ -44,6 +42,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
+import org.apache.directory.shared.ldap.message.Response;
+import org.apache.directory.shared.ldap.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.slf4j.Logger;
@@ -68,13 +68,14 @@ public class ReplicaDitStoreUtil
     private Map<Integer, List<Modification>> modMap = new HashMap<Integer, List<Modification>>();
 
     private LdapCoreSessionConnection coreConnection;
-    
+
+
     public ReplicaDitStoreUtil( DirectoryService dirService ) throws Exception
     {
         this.adminSession = dirService.getAdminSession();
         this.schemaManager = dirService.getSchemaManager();
         coreConnection = new LdapCoreSessionConnection( adminSession );
-        
+
         init();
     }
 
@@ -93,7 +94,7 @@ public class ReplicaDitStoreUtil
 
             adminSession.add( entry );
         }
-        
+
     }
 
 
@@ -106,7 +107,7 @@ public class ReplicaDitStoreUtil
 
         Entry entry = new DefaultEntry( schemaManager );
         entry.setDn( new DN( "ads-dsReplicaId=" + replica.getId() + "," + REPL_CONSUMER_DN ) );
-        
+
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "ads-replConsumer" );
         entry.add( "ads-dsReplicaId", String.valueOf( replica.getId() ) );
         entry.add( "ads-replAliasDerefMode", String
@@ -115,25 +116,26 @@ public class ReplicaDitStoreUtil
         entry.add( "ads-replLastSentCsn", replica.getLastSentCsn() );
         entry.add( "ads-replSearchScope", String.valueOf( replica.getSearchCriteria().getScope().getScope() ) );
         entry.add( "ads-replSearchFilter", replica.getSearchFilter() );
-        
+
         adminSession.add( entry );
     }
 
 
     public void updateReplicaLastSentCsn( ReplicaEventLog replica ) throws Exception
     {
-     
+
         List<Modification> mods = modMap.get( replica.getId() );
         EntryAttribute lastSentCsnAt = null;
-        if( mods == null )
+        if ( mods == null )
         {
-            lastSentCsnAt = new DefaultEntryAttribute( schemaManager.lookupAttributeTypeRegistry( "ads-replLastSentCsn" ) );
+            lastSentCsnAt = new DefaultEntryAttribute( schemaManager
+                .lookupAttributeTypeRegistry( "ads-replLastSentCsn" ) );
             lastSentCsnAt.add( replica.getLastSentCsn() );
-            
+
             Modification mod = new DefaultModification();
             mod.setOperation( ModificationOperation.REPLACE_ATTRIBUTE );
             mod.setAttribute( lastSentCsnAt );
-            
+
             mods = new ArrayList<Modification>( 1 );
             mods.add( mod );
         }
@@ -147,55 +149,57 @@ public class ReplicaDitStoreUtil
         DN dn = new DN( "ads-dsReplicaId=" + replica.getId() + "," + REPL_CONSUMER_DN );
         adminSession.modify( dn, mods );
     }
-    
-    
+
+
     public List<ReplicaEventLog> getReplicaConsumers() throws Exception
     {
         List<ReplicaEventLog> replicas = new ArrayList<ReplicaEventLog>();
-        
-        Cursor<SearchResponse> cursor = coreConnection.search( REPL_CONSUMER_DN, "(objectClass=ads-replConsumer)", SearchScope.ONELEVEL, "+", "*" );
-        while( cursor.next() )
+
+        Cursor<Response> cursor = coreConnection.search( REPL_CONSUMER_DN, "(objectClass=ads-replConsumer)",
+            SearchScope.ONELEVEL, "+", "*" );
+
+        while ( cursor.next() )
         {
             Entry entry = ( ( SearchResultEntry ) cursor.get() ).getEntry();
             ReplicaEventLog replica = convertEntryToReplica( entry );
             replicas.add( replica );
         }
         cursor.close();
-        
+
         return replicas;
     }
 
-    
+
     private ReplicaEventLog convertEntryToReplica( Entry entry ) throws Exception
     {
         String id = entry.get( "ads-dsReplicaId" ).getString();
         ReplicaEventLog replica = new ReplicaEventLog( Integer.parseInt( id ) );
-        
+
         NotificationCriteria searchCriteria = new NotificationCriteria();
-        
+
         String aliasMode = entry.get( "ads-replAliasDerefMode" ).getString();
         searchCriteria.setAliasDerefMode( AliasDerefMode.getDerefMode( Integer.parseInt( aliasMode ) ) );
-        
+
         String baseDn = entry.get( "ads-searchBaseDN" ).getString();
         searchCriteria.setBase( baseDn );
-        
+
         String lastSentCsn = entry.get( "ads-replLastSentCsn" ).getString();
         replica.setLastSentCsn( lastSentCsn );
-        
+
         String scope = entry.get( "ads-replSearchScope" ).getString();
         searchCriteria.setScope( SearchScope.getSearchScope( Integer.parseInt( scope ) ) );
 
         String filter = entry.get( "ads-replSearchFilter" ).getString();
         searchCriteria.setFilter( filter );
         replica.setSearchFilter( filter );
-        
+
         searchCriteria.setEventMask( EventType.ALL_EVENT_TYPES_MASK );
         replica.setSearchCriteria( searchCriteria );
-        
+
         // explicitly mark the replica as not-dirty, cause we just loaded it from 
         // the store, this prevents updating the replica info immediately after loading
         replica.setDirty( false );
-        
+
         return replica;
     }
 }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationProvider.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationProvider.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationProvider.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationProvider.java Fri Aug 20 19:31:58 2010
@@ -23,7 +23,7 @@ package org.apache.directory.server.ldap
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.message.internal.InternalSearchRequest;
+import org.apache.directory.shared.ldap.message.SearchRequest;
 
 /**
  * Interface for a replication provider.
@@ -53,5 +53,5 @@ public interface ReplicationProvider
      * @param req the SearchRequest with the SyncRequest control
      * @throws LdapException
      */
-    void handleSyncRequest( LdapSession session, InternalSearchRequest req ) throws LdapException;
+    void handleSyncRequest( LdapSession session, SearchRequest req ) throws LdapException;
 }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java Fri Aug 20 19:31:58 2010
@@ -35,14 +35,6 @@ import java.util.Set;
 import org.apache.directory.ldap.client.api.ConnectionClosedEventListener;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.future.SearchFuture;
-import org.apache.directory.ldap.client.api.message.BindResponse;
-import org.apache.directory.ldap.client.api.message.LdapResult;
-import org.apache.directory.ldap.client.api.message.SearchIntermediateResponse;
-import org.apache.directory.ldap.client.api.message.SearchRequest;
-import org.apache.directory.ldap.client.api.message.SearchResponse;
-import org.apache.directory.ldap.client.api.message.SearchResultDone;
-import org.apache.directory.ldap.client.api.message.SearchResultEntry;
-import org.apache.directory.ldap.client.api.message.SearchResultReference;
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
@@ -74,7 +66,16 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
+import org.apache.directory.shared.ldap.message.BindResponse;
+import org.apache.directory.shared.ldap.message.IntermediateResponse;
+import org.apache.directory.shared.ldap.message.LdapResult;
+import org.apache.directory.shared.ldap.message.Response;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.SearchRequest;
+import org.apache.directory.shared.ldap.message.SearchRequestImpl;
+import org.apache.directory.shared.ldap.message.SearchResultDone;
+import org.apache.directory.shared.ldap.message.SearchResultEntry;
+import org.apache.directory.shared.ldap.message.SearchResultReference;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.message.control.replication.SyncModifyDnType;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
@@ -259,9 +260,9 @@ public class SyncReplConsumer implements
     {
         String baseDn = config.getBaseDn();
 
-        searchRequest = new SearchRequest();
+        searchRequest = new SearchRequestImpl();
 
-        searchRequest.setBaseDn( baseDn );
+        searchRequest.setBase( new DN( baseDn ) );
         searchRequest.setFilter( config.getFilter() );
         searchRequest.setSizeLimit( config.getSearchSizeLimit() );
         searchRequest.setTimeLimit( config.getSearchTimeout() );
@@ -274,7 +275,7 @@ public class SyncReplConsumer implements
 
         if ( !config.isChaseReferrals() )
         {
-            searchRequest.add( new ManageDsaITControl() );
+            searchRequest.addControl( new ManageDsaITControl() );
         }
     }
 
@@ -283,7 +284,7 @@ public class SyncReplConsumer implements
     {
         LOG.debug( "///////////////// handleSearchDone //////////////////" );
 
-        Control ctrl = searchDone.getControl( SyncDoneValueControl.CONTROL_OID );
+        Control ctrl = searchDone.getControls().get( SyncDoneValueControl.CONTROL_OID );
         SyncDoneValueControl syncDoneCtrl = new SyncDoneValueControl();
         try
         {
@@ -328,7 +329,7 @@ public class SyncReplConsumer implements
         {
             Entry remoteEntry = syncResult.getEntry();
 
-            Control ctrl = syncResult.getControl( SyncStateValueControl.CONTROL_OID );
+            Control ctrl = syncResult.getControls().get( SyncStateValueControl.CONTROL_OID );
 
             try
             {
@@ -380,7 +381,7 @@ public class SyncReplConsumer implements
                     break;
 
                 case MODDN:
-                    Control adsModDnControl = syncResult.getControl( SyncModifyDnControl.CONTROL_OID );
+                    Control adsModDnControl = syncResult.getControls().get( SyncModifyDnControl.CONTROL_OID );
                     //Apache Directory Server's special control
                     SyncModifyDnControl syncModDnControl = new SyncModifyDnControl();
 
@@ -422,7 +423,7 @@ public class SyncReplConsumer implements
     /**
      * {@inheritDoc}
      */
-    public void handleSyncInfo( SearchIntermediateResponse syncInfoResp )
+    public void handleSyncInfo( IntermediateResponse syncInfoResp )
     {
         try
         {
@@ -544,12 +545,12 @@ public class SyncReplConsumer implements
             syncReq.setCookie( syncCookie );
         }
 
-        searchRequest.add( syncReq );
+        searchRequest.addControl( syncReq );
 
         // Do the search
         SearchFuture sf = connection.searchAsync( searchRequest );
 
-        SearchResponse resp = sf.get();
+        Response resp = sf.get();
 
         while ( !( resp instanceof SearchResultDone ) && !sf.isCancelled() )
         {
@@ -561,9 +562,9 @@ public class SyncReplConsumer implements
             {
                 handleSearchReference( ( SearchResultReference ) resp );
             }
-            else if ( resp instanceof SearchIntermediateResponse )
+            else if ( resp instanceof IntermediateResponse )
             {
-                handleSyncInfo( ( SearchIntermediateResponse ) resp );
+                handleSyncInfo( ( IntermediateResponse ) resp );
             }
 
             resp = sf.get();
@@ -576,7 +577,7 @@ public class SyncReplConsumer implements
         {
             // log the error and handle it appropriately
             LOG.warn( "given replication base DN {} is not found on provider", config.getBaseDn() );
-            if( syncType == SynchronizationModeEnum.REFRESH_AND_PERSIST )
+            if ( syncType == SynchronizationModeEnum.REFRESH_AND_PERSIST )
             {
                 LOG.warn( "disconnecting the consumer running in refreshAndPersist mode from the provider" );
                 disconnet();
@@ -589,9 +590,12 @@ public class SyncReplConsumer implements
             {
                 deleteRecursive( new DN( config.getBaseDn() ), null );
             }
-            catch( Exception e )
+            catch ( Exception e )
             {
-                LOG.error( "Failed to delete the replica base as part of handling E_SYNC_REFRESH_REQUIRED, disconnecting the consumer", e );
+                LOG
+                    .error(
+                        "Failed to delete the replica base as part of handling E_SYNC_REFRESH_REQUIRED, disconnecting the consumer",
+                        e );
                 disconnet();
             }
 

Propchange: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,6 +1,7 @@
+/directory/apacheds/branches/apacheds-codec-merge/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java:980138-980936
-/directory/apacheds/branches/apacheds-replication/syncrepl/src/main/java/org/apache/directory/server/syncrepl/SyncReplConsumer.java:749790-764110
+/directory/apacheds/branches/apacheds-replication/syncrepl/src/main/java/org/apache/directory/server/syncrepl/SyncReplConsumer.java:749790-762530
 /directory/apacheds/branches/apacheds-schema/syncrepl/src/main/java/org/apache/directory/server/syncrepl/SyncReplConsumer.java:806623-896441
 /directory/apacheds/branches/apacheds-subtree/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java:965203-965686
 /directory/apacheds/branches/xdbm-refactoring/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java:945827-946347
-/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java:980025-980137
+/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java:498338-580500

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java Fri Aug 20 19:31:58 2010
@@ -69,21 +69,21 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.OrNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.message.IntermediateResponse;
 import org.apache.directory.shared.ldap.message.IntermediateResponseImpl;
+import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ReferralImpl;
+import org.apache.directory.shared.ldap.message.Response;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.message.SearchResponseEntryImpl;
-import org.apache.directory.shared.ldap.message.SearchResponseReferenceImpl;
+import org.apache.directory.shared.ldap.message.SearchRequest;
+import org.apache.directory.shared.ldap.message.SearchResultDone;
+import org.apache.directory.shared.ldap.message.SearchResultEntry;
+import org.apache.directory.shared.ldap.message.SearchResultEntryImpl;
+import org.apache.directory.shared.ldap.message.SearchResultReference;
+import org.apache.directory.shared.ldap.message.SearchResultReferenceImpl;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationInfoEnum;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationModeEnum;
-import org.apache.directory.shared.ldap.message.internal.InternalIntermediateResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalLdapResult;
-import org.apache.directory.shared.ldap.message.internal.InternalResponse;
-import org.apache.directory.shared.ldap.message.internal.InternalSearchRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalSearchResponseDone;
-import org.apache.directory.shared.ldap.message.internal.InternalSearchResponseEntry;
-import org.apache.directory.shared.ldap.message.internal.InternalSearchResponseReference;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -116,15 +116,16 @@ public class SyncReplProvider implements
     private Map<Integer, ReplicaEventLog> replicaLogMap = new HashMap<Integer, ReplicaEventLog>();
 
     private BrokerService brokerService;
-    
+
     private ActiveMQConnection amqConnection;
 
     private File syncReplData;
 
-    private AtomicInteger replicaCount = new AtomicInteger(0);
+    private AtomicInteger replicaCount = new AtomicInteger( 0 );
 
     private ReplicaDitStoreUtil replicaUtil;
-    
+
+
     public SyncReplProvider()
     {
     }
@@ -160,7 +161,7 @@ public class SyncReplProvider implements
 
             URI vmConnectorUri = new URI( "vm://localhost" );
             brokerService.setVmConnectorURI( vmConnectorUri );
-            
+
             brokerService.start();
             ActiveMQConnectionFactory amqFactory = new ActiveMQConnectionFactory( vmConnectorUri.toString() );
             amqFactory.setObjectMessageSerializationDefered( false );
@@ -172,15 +173,15 @@ public class SyncReplProvider implements
             ReplicaEventMessage.setSchemaManager( dirService.getSchemaManager() );
 
             replicaUtil = new ReplicaDitStoreUtil( dirService );
-            
+
             loadReplicaInfo();
-            
+
             registerPersistentSearches();
-            
+
             Thread consumerInfoUpdateThread = new Thread( createConsumerInfoUpdateTask() );
             consumerInfoUpdateThread.setDaemon( true );
             consumerInfoUpdateThread.start();
-            
+
             initialized = true;
             LOG.info( "syncrepl provider initialized successfully" );
         }
@@ -208,17 +209,17 @@ public class SyncReplProvider implements
     }
 
 
-    public void handleSyncRequest( LdapSession session, InternalSearchRequest req ) throws LdapException
+    public void handleSyncRequest( LdapSession session, SearchRequest req ) throws LdapException
     {
         try
         {
             SyncRequestValueControl syncControl = ( SyncRequestValueControl ) req.getControls().get(
                 SyncRequestValueControl.CONTROL_OID );
-            
+
             // cookie is in the format <replicaId>;<Csn value>
             byte[] cookieBytes = syncControl.getCookie();
             String cookieString = StringTools.utf8ToString( cookieBytes );
-            
+
             if ( cookieBytes == null )
             {
                 doInitialRefresh( session, req );
@@ -234,9 +235,10 @@ public class SyncReplProvider implements
                 else
                 {
                     ReplicaEventLog clientMsgLog = getReplicaEventLog( cookieString );
-                    if( clientMsgLog == null )
+                    if ( clientMsgLog == null )
                     {
-                        LOG.warn( "received a valid cookie {} but there is no event log associated with this replica", cookieString );
+                        LOG.warn( "received a valid cookie {} but there is no event log associated with this replica",
+                            cookieString );
                         sendESyncRefreshRequired( session, req );
                     }
                     else
@@ -257,8 +259,9 @@ public class SyncReplProvider implements
         }
     }
 
-    
-    private String sendContentFromLog( LdapSession session, InternalSearchRequest req, ReplicaEventLog clientMsgLog ) throws Exception
+
+    private String sendContentFromLog( LdapSession session, SearchRequest req, ReplicaEventLog clientMsgLog )
+        throws Exception
     {
         // do the search from the log
         String lastSentCsn = clientMsgLog.getLastSentCsn();
@@ -269,28 +272,28 @@ public class SyncReplProvider implements
             ReplicaEventMessage message = cursor.get();
             Entry entry = message.getEntry();
             LOG.debug( "received message from the queue {}", entry );
-            
+
             lastSentCsn = entry.get( SchemaConstants.ENTRY_CSN_AT ).getString();
-            
+
             EventType event = message.getEventType();
-            
+
             // if event type is null, then it is a MODDN operation
-            if( event == null )
+            if ( event == null )
             {
                 sendSearchResultEntry( session, req, entry, message.getModDnControl() );
             }
             else
             {
                 SyncStateTypeEnum syncStateType = null;
-                if( event == EventType.ADD || event == EventType.MODIFY )
+                if ( event == EventType.ADD || event == EventType.MODIFY )
                 {
                     syncStateType = SyncStateTypeEnum.ADD;
                 }
-                else if( event == EventType.DELETE )
+                else if ( event == EventType.DELETE )
                 {
                     syncStateType = SyncStateTypeEnum.DELETE;
                 }
-                
+
                 sendSearchResultEntry( session, req, entry, syncStateType );
             }
         }
@@ -299,71 +302,70 @@ public class SyncReplProvider implements
         return lastSentCsn;
     }
 
-    
-    private void doContentUpdate( LdapSession session, InternalSearchRequest req, ReplicaEventLog replicaLog )
+
+    private void doContentUpdate( LdapSession session, SearchRequest req, ReplicaEventLog replicaLog )
         throws Exception
     {
         boolean refreshNPersist = isRefreshNPersist( req );
-        
+
         // if this method is called with refreshAndPersist  
         // means the client was offline after it initiated a persistent synch session
         // we need to update the handler's session 
-        if( refreshNPersist )
+        if ( refreshNPersist )
         {
             SyncReplSearchListener handler = replicaLog.getPersistentListener();
             handler.setReq( req );
             handler.setSession( session );
         }
-        
+
         String lastSentCsn = sendContentFromLog( session, req, replicaLog );
-        
-        byte[] cookie = StringTools.getBytesUtf8( replicaLog.getId() + REPLICA_ID_DELIM + lastSentCsn ) ;
-        
-        if( refreshNPersist )
+
+        byte[] cookie = StringTools.getBytesUtf8( replicaLog.getId() + REPLICA_ID_DELIM + lastSentCsn );
+
+        if ( refreshNPersist )
         {
-            InternalIntermediateResponse intermResp = new IntermediateResponseImpl( req.getMessageId() );
+            IntermediateResponse intermResp = new IntermediateResponseImpl( req.getMessageId() );
             intermResp.setResponseName( SyncInfoValueControl.CONTROL_OID );
-            
+
             SyncInfoValueControl syncInfo = new SyncInfoValueControl( SynchronizationInfoEnum.NEW_COOKIE );
             syncInfo.setCookie( cookie );
             intermResp.setResponseValue( syncInfo.getValue() );
-            
+
             session.getIoSession().write( intermResp );
-            
+
             replicaLog.getPersistentListener().setPushInRealTime( refreshNPersist );
         }
         else
         {
-            InternalSearchResponseDone searchDoneResp = ( InternalSearchResponseDone ) req.getResultResponse();
+            SearchResultDone searchDoneResp = ( SearchResultDone ) req.getResultResponse();
             searchDoneResp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
             SyncDoneValueControl syncDone = new SyncDoneValueControl();
             syncDone.setCookie( cookie );
-            searchDoneResp.add( syncDone );
-            
+            searchDoneResp.addControl( syncDone );
+
             session.getIoSession().write( searchDoneResp );
         }
-        
+
         replicaLog.setLastSentCsn( lastSentCsn );
     }
 
 
-    private void doInitialRefresh( LdapSession session, InternalSearchRequest req )
-        throws Exception
+    private void doInitialRefresh( LdapSession session, SearchRequest req ) throws Exception
     {
 
         String originalFilter = req.getFilter().toString();
-        InetSocketAddress address = ( InetSocketAddress )session.getIoSession().getRemoteAddress();
+        InetSocketAddress address = ( InetSocketAddress ) session.getIoSession().getRemoteAddress();
         String hostName = address.getAddress().getHostName();
 
         ExprNode modifiedFilter = modifyFilter( session, req );
 
         String contextCsn = dirService.getContextCsn();
-        
+
         boolean refreshNPersist = isRefreshNPersist( req );
 
         // first register a persistent search handler before starting the initial content refresh
         // this is to log all the operations happen on DIT during initial content refresh
-        
+
         ReplicaEventLog replicaLog = createRelicaEventLog( hostName, originalFilter );
 
         replicaLog.setRefreshNPersist( refreshNPersist );
@@ -372,10 +374,10 @@ public class SyncReplProvider implements
         GreaterEqNode csnGeNode = new GreaterEqNode( SchemaConstants.ENTRY_CSN_AT, new StringValue( contextCsn ) );
         ExprNode postInitContentFilter = new AndNode( modifiedFilter, csnGeNode );
         req.setFilter( postInitContentFilter );
-        
+
         // now we process entries forever as they change
         LOG.info( "starting persistent search for the client {}", replicaLog );
-        
+
         // irrespective of the sync mode set the 'isRealtimePush' to false initially so that we can
         // store the modifications in the queue and later if it is a persist mode
         // we push this queue's content and switch to realtime mode
@@ -391,12 +393,11 @@ public class SyncReplProvider implements
         criteria.setFilter( req.getFilter() );
         criteria.setScope( req.getScope() );
         criteria.setEventMask( EventType.ALL_EVENT_TYPES_MASK );
-        
+
         replicaLog.setSearchCriteria( criteria );
-        
+
         dirService.getEventService().addListener( handler, criteria );
 
-        
         // then start pushing initial content
         LessEqNode csnNode = new LessEqNode( SchemaConstants.ENTRY_CSN_AT, new StringValue( contextCsn ) );
 
@@ -404,27 +405,27 @@ public class SyncReplProvider implements
         ExprNode initialContentFilter = new AndNode( modifiedFilter, csnNode );
         req.setFilter( initialContentFilter );
 
-        InternalSearchResponseDone searchDoneResp = doSimpleSearch( session, req );
-        
+        SearchResultDone searchDoneResp = doSimpleSearch( session, req );
+
         if ( searchDoneResp.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
         {
             replicaLog.setLastSentCsn( contextCsn );
-            byte[] cookie = StringTools.getBytesUtf8( replicaLog.getId() + REPLICA_ID_DELIM + contextCsn ) ;
-            
-            if( refreshNPersist ) // refreshAndPersist mode
+            byte[] cookie = StringTools.getBytesUtf8( replicaLog.getId() + REPLICA_ID_DELIM + contextCsn );
+
+            if ( refreshNPersist ) // refreshAndPersist mode
             {
                 contextCsn = sendContentFromLog( session, req, replicaLog );
-                cookie = StringTools.getBytesUtf8( replicaLog.getId() + REPLICA_ID_DELIM + contextCsn ) ;
-                
-                InternalIntermediateResponse intermResp = new IntermediateResponseImpl( req.getMessageId() );
+                cookie = StringTools.getBytesUtf8( replicaLog.getId() + REPLICA_ID_DELIM + contextCsn );
+
+                IntermediateResponse intermResp = new IntermediateResponseImpl( req.getMessageId() );
                 intermResp.setResponseName( SyncInfoValueControl.CONTROL_OID );
-                
+
                 SyncInfoValueControl syncInfo = new SyncInfoValueControl( SynchronizationInfoEnum.NEW_COOKIE );
                 syncInfo.setCookie( cookie );
                 intermResp.setResponseValue( syncInfo.getValue() );
-                
+
                 session.getIoSession().write( intermResp );
-                
+
                 // switch the handler mode to realtime push
                 handler.setPushInRealTime( refreshNPersist );
             }
@@ -433,35 +434,36 @@ public class SyncReplProvider implements
                 // no need to send from the log, that will be done in the next refreshOnly session
                 SyncDoneValueControl syncDone = new SyncDoneValueControl();
                 syncDone.setCookie( cookie );
-                searchDoneResp.add( syncDone );
+                searchDoneResp.addControl( syncDone );
                 session.getIoSession().write( searchDoneResp );
             }
         }
-        else // if not succeeded return
+        else
+        // if not succeeded return
         {
-            LOG.warn( "initial content refresh didn't succeed due to {}", searchDoneResp.getLdapResult().getResultCode() );
+            LOG.warn( "initial content refresh didn't succeed due to {}", searchDoneResp.getLdapResult()
+                .getResultCode() );
             replicaLog.truncate();
             replicaLog = null;
-            
+
             // remove the listener
             dirService.getEventService().removeListener( handler );
-            
+
             return;
         }
-        
+
         // if all is well then store the consumer infor
         replicaUtil.addConsumerEntry( replicaLog );
-        
+
         // add to the map only after storing in the DIT, else the Replica update thread barfs
         replicaLogMap.put( replicaLog.getId(), replicaLog );
     }
 
 
-    private InternalSearchResponseDone doSimpleSearch( LdapSession session, InternalSearchRequest req )
-        throws Exception
+    private SearchResultDone doSimpleSearch( LdapSession session, SearchRequest req ) throws Exception
     {
-        InternalSearchResponseDone searchDoneResp = ( InternalSearchResponseDone ) req.getResultResponse();
-        InternalLdapResult ldapResult = searchDoneResp.getLdapResult();
+        SearchResultDone searchDoneResp = ( SearchResultDone ) req.getResultResponse();
+        LdapResult ldapResult = searchDoneResp.getLdapResult();
 
         // A normal search
         // Check that we have a cursor or not. 
@@ -509,7 +511,7 @@ public class SyncReplProvider implements
     }
 
 
-    private void readResults( LdapSession session, InternalSearchRequest req, InternalLdapResult ldapResult,
+    private void readResults( LdapSession session, SearchRequest req, LdapResult ldapResult,
         EntryFilteringCursor cursor, long sizeLimit ) throws Exception
     {
         long count = 0;
@@ -553,7 +555,7 @@ public class SyncReplProvider implements
     }
 
 
-    private void sendSearchResultEntry( LdapSession session, InternalSearchRequest req, Entry entry,
+    private void sendSearchResultEntry( LdapSession session, SearchRequest req, Entry entry,
         SyncStateTypeEnum syncStateType ) throws Exception
     {
 
@@ -562,22 +564,22 @@ public class SyncReplProvider implements
         syncStateControl.setSyncStateType( syncStateType );
         syncStateControl.setEntryUUID( StringTools.uuidToBytes( uuid.getString() ) );
 
-        if( syncStateType == SyncStateTypeEnum.DELETE )
+        if ( syncStateType == SyncStateTypeEnum.DELETE )
         {
             // clear the entry's all attributes except the DN and entryUUID
             entry.clear();
             entry.add( uuid );
         }
-        
-        InternalResponse resp = generateResponse( session, req, entry );
-        resp.add( syncStateControl );
+
+        Response resp = generateResponse( session, req, entry );
+        resp.addControl( syncStateControl );
 
         session.getIoSession().write( resp );
         LOG.debug( "Sending {}", entry.getDn() );
     }
 
 
-    private void sendSearchResultEntry( LdapSession session, InternalSearchRequest req, Entry entry,
+    private void sendSearchResultEntry( LdapSession session, SearchRequest req, Entry entry,
         SyncModifyDnControl modDnControl ) throws Exception
     {
 
@@ -586,17 +588,16 @@ public class SyncReplProvider implements
         syncStateControl.setSyncStateType( SyncStateTypeEnum.MODDN );
         syncStateControl.setEntryUUID( StringTools.uuidToBytes( uuid.getString() ) );
 
-        InternalResponse resp = generateResponse( session, req, entry );
-        resp.add( syncStateControl );
-        resp.add( modDnControl );
-        
+        Response resp = generateResponse( session, req, entry );
+        resp.addControl( syncStateControl );
+        resp.addControl( modDnControl );
+
         session.getIoSession().write( resp );
         LOG.debug( "Sending {}", entry.getDn() );
     }
 
-    
-    private InternalResponse generateResponse( LdapSession session, InternalSearchRequest req, Entry entry )
-        throws Exception
+
+    private Response generateResponse( LdapSession session, SearchRequest req, Entry entry ) throws Exception
     {
         EntryAttribute ref = entry.get( SchemaConstants.REF_AT );
         boolean hasManageDsaItControl = req.getControls().containsKey( ManageDsaITControl.CONTROL_OID );
@@ -604,8 +605,8 @@ public class SyncReplProvider implements
         if ( ( ref != null ) && !hasManageDsaItControl )
         {
             // The entry is a referral.
-            InternalSearchResponseReference respRef;
-            respRef = new SearchResponseReferenceImpl( req.getMessageId() );
+            SearchResultReference respRef;
+            respRef = new SearchResultReferenceImpl( req.getMessageId() );
             respRef.setReferral( new ReferralImpl() );
 
             for ( Value<?> val : ref )
@@ -650,8 +651,8 @@ public class SyncReplProvider implements
         else
         {
             // The entry is not a referral, or the ManageDsaIt control is set
-            InternalSearchResponseEntry respEntry;
-            respEntry = new SearchResponseEntryImpl( req.getMessageId() );
+            SearchResultEntry respEntry;
+            respEntry = new SearchResultEntryImpl( req.getMessageId() );
             respEntry.setEntry( entry );
             respEntry.setObjectName( entry.getDn() );
 
@@ -670,7 +671,7 @@ public class SyncReplProvider implements
     /**
      * Return the server size limit
      */
-    private long getServerSizeLimit( LdapSession session, InternalSearchRequest request )
+    private long getServerSizeLimit( LdapSession session, SearchRequest request )
     {
         if ( session.getCoreSession().isAnAdministrator() )
         {
@@ -697,7 +698,7 @@ public class SyncReplProvider implements
     }
 
 
-    private void setTimeLimitsOnCursor( InternalSearchRequest req, LdapSession session,
+    private void setTimeLimitsOnCursor( SearchRequest req, LdapSession session,
         final EntryFilteringCursor cursor )
     {
         // Don't bother setting time limits for administrators
@@ -747,7 +748,7 @@ public class SyncReplProvider implements
     }
 
 
-    public ExprNode modifyFilter( LdapSession session, InternalSearchRequest req ) throws Exception
+    public ExprNode modifyFilter( LdapSession session, SearchRequest req ) throws Exception
     {
         /*
          * Do not add the OR'd (objectClass=referral) expression if the user 
@@ -809,10 +810,10 @@ public class SyncReplProvider implements
     {
         try
         {
-            for( Map.Entry<Integer, ReplicaEventLog> e : replicaLogMap.entrySet() )
+            for ( Map.Entry<Integer, ReplicaEventLog> e : replicaLogMap.entrySet() )
             {
                 ReplicaEventLog replica = e.getValue();
-                if( replica.isDirty() )
+                if ( replica.isDirty() )
                 {
                     LOG.debug( "updating the details of replica {}", replica );
                     replicaUtil.updateReplicaLastSentCsn( replica );
@@ -820,29 +821,29 @@ public class SyncReplProvider implements
                 }
             }
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
             LOG.error( "Failed to store the replica information", e );
         }
     }
-    
-    
+
+
     private void loadReplicaInfo()
     {
         try
         {
 
             List<ReplicaEventLog> replicas = replicaUtil.getReplicaConsumers();
-            if( !replicas.isEmpty() )
+            if ( !replicas.isEmpty() )
             {
-                for( ReplicaEventLog r : replicas )
+                for ( ReplicaEventLog r : replicas )
                 {
                     LOG.debug( "initializing the replica log from {}", r.getId() );
                     r.configure( amqConnection, brokerService );
                     replicaLogMap.put( r.getId(), r );
-                    
+
                     // update the replicaCount's value to assign a correct value to the new replica(s) 
-                    if( replicaCount.get() < r.getId() )
+                    if ( replicaCount.get() < r.getId() )
                     {
                         replicaCount.set( r.getId() );
                     }
@@ -853,146 +854,148 @@ public class SyncReplProvider implements
                 LOG.debug( "no replica logs found to initialize" );
             }
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
             LOG.error( "Failed to load the replica information", e );
         }
     }
-    
- 
+
+
     private void registerPersistentSearches() throws Exception
     {
-        for( Map.Entry<Integer, ReplicaEventLog> e : replicaLogMap.entrySet() )
+        for ( Map.Entry<Integer, ReplicaEventLog> e : replicaLogMap.entrySet() )
         {
             ReplicaEventLog log = e.getValue();
-            
-            if( log.getSearchCriteria() != null )
+
+            if ( log.getSearchCriteria() != null )
             {
                 LOG.debug( "registering peristent search for the replica {}", log.getId() );
                 SyncReplSearchListener handler = new SyncReplSearchListener( null, null, log, false );
                 log.setPersistentListener( handler );
-                
+
                 dirService.getEventService().addListener( handler, log.getSearchCriteria() );
             }
             else
             {
-                LOG.warn( "invalid peristent search criteria {} for the replica {}", log.getSearchCriteria(), log.getId() );
+                LOG.warn( "invalid peristent search criteria {} for the replica {}", log.getSearchCriteria(), log
+                    .getId() );
             }
-        }    
+        }
     }
-    
-    
+
+
     private Runnable createConsumerInfoUpdateTask()
     {
         Runnable task = new Runnable()
         {
             public void run()
             {
-                while( true )
+                while ( true )
                 {
                     storeReplicaInfo();
                     try
                     {
                         Thread.sleep( 10000 );
                     }
-                    catch( InterruptedException e )
+                    catch ( InterruptedException e )
                     {
                         LOG.warn( "thread storing the replica information was interrupted", e );
                     }
                 }
             }
         };
-        
+
         return task;
     }
-    
- 
+
+
     private boolean isValidCookie( String cookieString )
     {
-        if( cookieString == null || cookieString.trim().length() == 0 )
+        if ( cookieString == null || cookieString.trim().length() == 0 )
         {
             return false;
         }
-        
+
         int pos = cookieString.indexOf( REPLICA_ID_DELIM );
-        if( pos <= 0 ) // position should start from 1 or higher cause a cookie can be like "0;<csn>" or "11;<csn>"
+        if ( pos <= 0 ) // position should start from 1 or higher cause a cookie can be like "0;<csn>" or "11;<csn>"
         {
             return false;
         }
-        
+
         String replicaId = cookieString.substring( 0, pos );
         try
         {
             Integer.parseInt( replicaId );
         }
-        catch( NumberFormatException e )
+        catch ( NumberFormatException e )
         {
             LOG.debug( "Failed to parse the replica id {}", replicaId );
             return false;
         }
-        
-        if( pos == cookieString.length() )
+
+        if ( pos == cookieString.length() )
         {
             return false;
         }
-        
+
         String csnString = cookieString.substring( pos + 1 );
-        
+
         return Csn.isValid( csnString );
     }
-    
-    
+
+
     private int getReplicaId( String cookieString )
     {
         String replicaId = cookieString.substring( 0, cookieString.indexOf( REPLICA_ID_DELIM ) );
         return Integer.parseInt( replicaId );
     }
-    
-    
+
+
     private ReplicaEventLog getReplicaEventLog( String cookieString ) throws Exception
     {
         ReplicaEventLog replicaLog = null;
-        
-        if( isValidCookie( cookieString ) )
+
+        if ( isValidCookie( cookieString ) )
         {
             int clientId = getReplicaId( cookieString );
             replicaLog = replicaLogMap.get( clientId );
         }
-        
+
         return replicaLog;
     }
-    
-    
+
+
     private ReplicaEventLog createRelicaEventLog( String hostName, String filter ) throws Exception
     {
         int replicaId = replicaCount.incrementAndGet();
-        
+
         LOG.debug( "creating a new event log for the replica with id {}", replicaId );
-        
+
         ReplicaEventLog replicaLog = new ReplicaEventLog( replicaId );
         replicaLog.setHostName( hostName );
         replicaLog.setSearchFilter( filter );
-        
+
         replicaLog.configure( amqConnection, brokerService );
-        
+
         return replicaLog;
     }
-    
-    
-    private void sendESyncRefreshRequired( LdapSession session, InternalSearchRequest req ) throws Exception
+
+
+    private void sendESyncRefreshRequired( LdapSession session, SearchRequest req ) throws Exception
     {
-        InternalSearchResponseDone searchDoneResp = ( InternalSearchResponseDone ) req.getResultResponse();
+        SearchResultDone searchDoneResp = ( SearchResultDone ) req.getResultResponse();
         searchDoneResp.getLdapResult().setResultCode( ResultCodeEnum.E_SYNC_REFRESH_REQUIRED );
         SyncDoneValueControl syncDone = new SyncDoneValueControl();
-        searchDoneResp.add( syncDone );
-        
+        searchDoneResp.addControl( syncDone );
+
         session.getIoSession().write( searchDoneResp );
     }
-    
-    
-    private boolean isRefreshNPersist( InternalSearchRequest req )
+
+
+    private boolean isRefreshNPersist( SearchRequest req )
     {
-        SyncRequestValueControl control = ( SyncRequestValueControl ) req.getControls().get( SyncRequestValueControl.CONTROL_OID );
+        SyncRequestValueControl control = ( SyncRequestValueControl ) req.getControls().get(
+            SyncRequestValueControl.CONTROL_OID );
         return ( control.getMode() == SynchronizationModeEnum.REFRESH_AND_PERSIST ? true : false );
     }
 }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java Fri Aug 20 19:31:58 2010
@@ -36,12 +36,12 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.message.AbandonListener;
-import org.apache.directory.shared.ldap.message.SearchResponseEntryImpl;
+import org.apache.directory.shared.ldap.message.AbandonableRequest;
+import org.apache.directory.shared.ldap.message.SearchRequest;
+import org.apache.directory.shared.ldap.message.SearchResultEntry;
+import org.apache.directory.shared.ldap.message.SearchResultEntryImpl;
 import org.apache.directory.shared.ldap.message.control.replication.SyncModifyDnType;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
-import org.apache.directory.shared.ldap.message.internal.InternalAbandonableRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalSearchRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalSearchResponseEntry;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.mina.core.future.WriteFuture;
 import org.slf4j.Logger;
@@ -60,14 +60,14 @@ public class SyncReplSearchListener impl
     private static final Logger LOG = LoggerFactory.getLogger( SyncReplSearchListener.class );
 
     private LdapSession session;
-    private InternalSearchRequest req;
+    private SearchRequest req;
 
     private volatile boolean pushInRealTime;
 
     private final ReplicaEventLog clientMsgLog;
 
 
-    SyncReplSearchListener( LdapSession session, InternalSearchRequest req, ReplicaEventLog clientMsgLog,
+    SyncReplSearchListener( LdapSession session, SearchRequest req, ReplicaEventLog clientMsgLog,
         boolean pushInRealTime )
     {
         this.pushInRealTime = pushInRealTime;
@@ -84,7 +84,7 @@ public class SyncReplSearchListener impl
     }
 
 
-    public void setReq( InternalSearchRequest req )
+    public void setReq( SearchRequest req )
     {
         this.req = req;
         if ( req != null )
@@ -117,7 +117,7 @@ public class SyncReplSearchListener impl
     }
 
 
-    public void requestAbandoned( InternalAbandonableRequest req )
+    public void requestAbandoned( AbandonableRequest req )
     {
         try
         {
@@ -135,22 +135,22 @@ public class SyncReplSearchListener impl
         Entry entry = addContext.getEntry();
 
         LOG.debug( "sending added entry {}", entry.getDn() );
-        
+
         try
         {
             if ( pushInRealTime )
             {
-                
-                InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() );
+
+                SearchResultEntry respEntry = new SearchResultEntryImpl( req.getMessageId() );
                 respEntry.setObjectName( entry.getDn() );
                 respEntry.setEntry( entry );
 
                 SyncStateValueControl syncAdd = new SyncStateValueControl();
                 syncAdd.setSyncStateType( SyncStateTypeEnum.ADD );
-                syncAdd.setEntryUUID( StringTools.uuidToBytes( entry.get( SchemaConstants.ENTRY_UUID_AT )
-                    .getString() ) );
+                syncAdd
+                    .setEntryUUID( StringTools.uuidToBytes( entry.get( SchemaConstants.ENTRY_UUID_AT ).getString() ) );
                 syncAdd.setCookie( getCookie( entry ) );
-                respEntry.add( syncAdd );
+                respEntry.addControl( syncAdd );
 
                 WriteFuture future = session.getIoSession().write( respEntry );
                 handleWriteFuture( future, entry, EventType.ADD, null );
@@ -182,19 +182,19 @@ public class SyncReplSearchListener impl
         {
             if ( pushInRealTime )
             {
-                InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() );
+                SearchResultEntry respEntry = new SearchResultEntryImpl( req.getMessageId() );
                 respEntry.setObjectName( entry.getDn() );
                 respEntry.setEntry( entry );
 
                 SyncStateValueControl syncDelete = new SyncStateValueControl();
                 syncDelete.setSyncStateType( SyncStateTypeEnum.DELETE );
-                syncDelete.setEntryUUID( StringTools.uuidToBytes( entry.get(
-                    SchemaConstants.ENTRY_UUID_AT ).getString() ) );
+                syncDelete.setEntryUUID( StringTools.uuidToBytes( entry.get( SchemaConstants.ENTRY_UUID_AT )
+                    .getString() ) );
                 syncDelete.setCookie( getCookie( entry ) );
-                respEntry.add( syncDelete );
+                respEntry.addControl( syncDelete );
 
                 WriteFuture future = session.getIoSession().write( respEntry );
-                
+
                 handleWriteFuture( future, entry, EventType.DELETE, null );
             }
             else
@@ -208,8 +208,8 @@ public class SyncReplSearchListener impl
             LOG.error( e.getMessage(), e );
         }
     }
-    
-    
+
+
     public void entryModified( ModifyOperationContext modifyContext )
     {
         Entry alteredEntry = modifyContext.getAlteredEntry();
@@ -220,20 +220,20 @@ public class SyncReplSearchListener impl
         {
             if ( pushInRealTime )
             {
-                
-                InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() );
+
+                SearchResultEntry respEntry = new SearchResultEntryImpl( req.getMessageId() );
                 respEntry.setObjectName( modifyContext.getDn() );
                 respEntry.setEntry( alteredEntry );
 
                 SyncStateValueControl syncModify = new SyncStateValueControl();
                 syncModify.setSyncStateType( SyncStateTypeEnum.MODIFY );
-                syncModify.setEntryUUID( StringTools.uuidToBytes( alteredEntry.get(
-                    SchemaConstants.ENTRY_UUID_AT ).getString() ) );
+                syncModify.setEntryUUID( StringTools.uuidToBytes( alteredEntry.get( SchemaConstants.ENTRY_UUID_AT )
+                    .getString() ) );
                 syncModify.setCookie( getCookie( alteredEntry ) );
-                respEntry.add( syncModify );
+                respEntry.addControl( syncModify );
 
                 WriteFuture future = session.getIoSession().write( respEntry );
-                
+
                 // store altered entry cause that holds the updated CSN
                 handleWriteFuture( future, alteredEntry, EventType.MODIFY, null );
             }
@@ -257,32 +257,32 @@ public class SyncReplSearchListener impl
 
         try
         {
-            if( ! moveContext.getNewSuperior().isChildOf( clientMsgLog.getSearchCriteria().getBase() ) )
+            if ( !moveContext.getNewSuperior().isChildOf( clientMsgLog.getSearchCriteria().getBase() ) )
             {
                 sendDeletedEntry( moveContext.getEntry() );
                 return;
             }
-            
+
             SyncModifyDnControl modDnControl = new SyncModifyDnControl( SyncModifyDnType.MOVE );
             modDnControl.setEntryDn( moveContext.getDn().getNormName() );
             modDnControl.setNewSuperiorDn( moveContext.getNewSuperior().getNormName() );
 
             if ( pushInRealTime )
             {
-                InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() );
+                SearchResultEntry respEntry = new SearchResultEntryImpl( req.getMessageId() );
                 respEntry.setObjectName( moveContext.getDn() );
                 respEntry.setEntry( entry );
 
                 SyncStateValueControl syncModify = new SyncStateValueControl();
                 syncModify.setSyncStateType( SyncStateTypeEnum.MODDN );
-                syncModify.setEntryUUID( StringTools.uuidToBytes( entry.get(
-                    SchemaConstants.ENTRY_UUID_AT ).getString() ) );
+                syncModify.setEntryUUID( StringTools.uuidToBytes( entry.get( SchemaConstants.ENTRY_UUID_AT )
+                    .getString() ) );
                 syncModify.setCookie( getCookie( entry ) );
-                respEntry.add( syncModify );
-                respEntry.add( modDnControl );
-                
+                respEntry.addControl( syncModify );
+                respEntry.addControl( modDnControl );
+
                 WriteFuture future = session.getIoSession().write( respEntry );
-                
+
                 handleWriteFuture( future, entry, null, modDnControl );
             }
             else
@@ -299,12 +299,12 @@ public class SyncReplSearchListener impl
 
     public void entryMovedAndRenamed( MoveAndRenameOperationContext moveAndRenameContext )
     {
-        
+
         LOG.debug( "sending moveAndRenamed entry {}", moveAndRenameContext.getDn() );
 
         try
         {
-            if( ! moveAndRenameContext.getNewSuperiorDn().isChildOf( clientMsgLog.getSearchCriteria().getBase() ) )
+            if ( !moveAndRenameContext.getNewSuperiorDn().isChildOf( clientMsgLog.getSearchCriteria().getBase() ) )
             {
                 sendDeletedEntry( moveAndRenameContext.getEntry() );
                 return;
@@ -319,21 +319,21 @@ public class SyncReplSearchListener impl
             if ( pushInRealTime )
             {
                 Entry alteredEntry = moveAndRenameContext.getModifiedEntry();
-                
-                InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() );
+
+                SearchResultEntry respEntry = new SearchResultEntryImpl( req.getMessageId() );
                 respEntry.setObjectName( moveAndRenameContext.getModifiedEntry().getDn() );
                 respEntry.setEntry( alteredEntry );
 
                 SyncStateValueControl syncModify = new SyncStateValueControl();
                 syncModify.setSyncStateType( SyncStateTypeEnum.MODDN );
-                syncModify.setEntryUUID( StringTools.uuidToBytes( alteredEntry.get(
-                    SchemaConstants.ENTRY_UUID_AT ).getString() ) );
+                syncModify.setEntryUUID( StringTools.uuidToBytes( alteredEntry.get( SchemaConstants.ENTRY_UUID_AT )
+                    .getString() ) );
                 syncModify.setCookie( getCookie( alteredEntry ) );
-                respEntry.add( syncModify );
-                respEntry.add( modDnControl );
+                respEntry.addControl( syncModify );
+                respEntry.addControl( modDnControl );
 
                 WriteFuture future = session.getIoSession().write( respEntry );
-                
+
                 handleWriteFuture( future, alteredEntry, null, modDnControl );
             }
             else
@@ -351,9 +351,9 @@ public class SyncReplSearchListener impl
     public void entryRenamed( RenameOperationContext renameContext )
     {
         Entry entry = renameContext.getEntry();
-        
+
         LOG.debug( "sending renamed entry {}", entry.getDn() );
-        
+
         try
         {
             SyncModifyDnControl modDnControl = new SyncModifyDnControl();
@@ -364,20 +364,20 @@ public class SyncReplSearchListener impl
 
             if ( pushInRealTime )
             {
-                InternalSearchResponseEntry respEntry = new SearchResponseEntryImpl( req.getMessageId() );
+                SearchResultEntry respEntry = new SearchResultEntryImpl( req.getMessageId() );
                 respEntry.setObjectName( entry.getDn() );
                 respEntry.setEntry( entry );
 
                 SyncStateValueControl syncModify = new SyncStateValueControl();
                 syncModify.setSyncStateType( SyncStateTypeEnum.MODDN );
-                syncModify.setEntryUUID( StringTools.uuidToBytes( entry.get(
-                    SchemaConstants.ENTRY_UUID_AT ).getString() ) );
+                syncModify.setEntryUUID( StringTools.uuidToBytes( entry.get( SchemaConstants.ENTRY_UUID_AT )
+                    .getString() ) );
                 syncModify.setCookie( getCookie( renameContext.getModifiedEntry() ) );
-                respEntry.add( syncModify );
-                respEntry.add( modDnControl );
-                
+                respEntry.addControl( syncModify );
+                respEntry.addControl( modDnControl );
+
                 WriteFuture future = session.getIoSession().write( respEntry );
-                
+
                 handleWriteFuture( future, renameContext.getModifiedEntry(), null, modDnControl );
             }
             else
@@ -390,8 +390,8 @@ public class SyncReplSearchListener impl
             LOG.error( e.getMessage(), e );
         }
     }
-    
-    
+
+
     public boolean isPushInRealTime()
     {
         return pushInRealTime;
@@ -409,21 +409,21 @@ public class SyncReplSearchListener impl
         String csn = entry.get( SchemaConstants.ENTRY_CSN_AT ).getString();
         return StringTools.getBytesUtf8( clientMsgLog.getId() + SyncReplProvider.REPLICA_ID_DELIM + csn );
     }
-    
-    
+
+
     private void handleWriteFuture( WriteFuture future, Entry entry, EventType event, SyncModifyDnControl modDnControl )
     {
         future.awaitUninterruptibly();
-        if( !future.isWritten() )
+        if ( !future.isWritten() )
         {
             LOG.error( "Failed to write to the consumer {}", clientMsgLog.getId() );
             LOG.error( "", future.getException() );
-            
+
             // set realtime push to false, will be set back to true when the client
             // comes back and sends another request this flag will be set to true
             pushInRealTime = false;
-            
-            if( modDnControl != null )
+
+            if ( modDnControl != null )
             {
                 clientMsgLog.log( new ReplicaEventMessage( modDnControl, entry ) );
             }

Modified: directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java?rev=987611&r1=987610&r2=987611&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java Fri Aug 20 19:31:58 2010
@@ -35,15 +35,15 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.handlers.SearchHandler;
 import org.apache.directory.server.ldap.handlers.UnbindHandler;
 import org.apache.directory.shared.ldap.NotImplementedException;
-import org.apache.directory.shared.ldap.message.internal.InternalAbandonRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalAddRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalBindRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalCompareRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalModifyRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalSearchRequest;
-import org.apache.directory.shared.ldap.message.internal.InternalUnbindRequest;
+import org.apache.directory.shared.ldap.message.AbandonRequest;
+import org.apache.directory.shared.ldap.message.AddRequest;
+import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.CompareRequest;
+import org.apache.directory.shared.ldap.message.DeleteRequest;
+import org.apache.directory.shared.ldap.message.ModifyDnRequest;
+import org.apache.directory.shared.ldap.message.ModifyRequest;
+import org.apache.directory.shared.ldap.message.SearchRequest;
+import org.apache.directory.shared.ldap.message.UnbindRequest;
 import org.apache.mina.core.session.IoSession;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -108,7 +108,7 @@ public class SettingAlternativeHandlersT
     
     public static class BogusAbandonHandler extends AbandonHandler
     {
-        public void abandonMessageReceived( IoSession session, InternalAbandonRequest request )
+        public void abandonMessageReceived( IoSession session, AbandonRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -117,7 +117,7 @@ public class SettingAlternativeHandlersT
     
     public static class BogusUnbindHandler extends UnbindHandler
     {
-        public void unbindMessageReceived( IoSession session, InternalUnbindRequest request )
+        public void unbindMessageReceived( IoSession session, UnbindRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -125,7 +125,7 @@ public class SettingAlternativeHandlersT
 
     public static class BogusAddHandler extends AddHandler
     {
-        public void addMessageReceived( IoSession session, InternalAddRequest request )
+        public void addMessageReceived( IoSession session, AddRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -138,7 +138,7 @@ public class SettingAlternativeHandlersT
         }
 
 
-        public void bindMessageReceived( IoSession session, InternalBindRequest request )
+        public void bindMessageReceived( IoSession session, BindRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -146,7 +146,7 @@ public class SettingAlternativeHandlersT
 
     public static class BogusCompareHandler extends CompareHandler
     {
-        public void compareMessageReceived( IoSession session, InternalCompareRequest request )
+        public void compareMessageReceived( IoSession session, CompareRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -154,7 +154,7 @@ public class SettingAlternativeHandlersT
 
     public static class BogusDeleteHandler extends  DeleteHandler
     {
-        public void deleteMessageReceived( IoSession session, InternalDeleteRequest request )
+        public void deleteMessageReceived( IoSession session, DeleteRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -162,7 +162,7 @@ public class SettingAlternativeHandlersT
 
     public static class BogusModifyDnHandler extends  ModifyDnHandler
     {
-        public void modifyDnMessageReceived( IoSession session, InternalModifyDnRequest request )
+        public void modifyDnMessageReceived( IoSession session, ModifyDnRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -170,7 +170,7 @@ public class SettingAlternativeHandlersT
 
     public static class BogusModifyHandler extends ModifyHandler
     {
-        public void modifyMessageReceived( IoSession session, InternalModifyRequest request )
+        public void modifyMessageReceived( IoSession session, ModifyRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -178,7 +178,7 @@ public class SettingAlternativeHandlersT
 
     public static class BogusSearchHandler extends SearchHandler
     {
-        public void searchMessageReceived( IoSession session, InternalSearchRequest request )
+        public void searchMessageReceived( IoSession session, SearchRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }

Propchange: directory/apacheds/trunk/protocol-ntp/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1 +1,2 @@
+/directory/apacheds/branches/apacheds-codec-merge/protocol-ntp:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-ntp:980138-980936

Propchange: directory/apacheds/trunk/protocol-shared/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,2 +1,2 @@
+/directory/apacheds/branches/apacheds-codec-merge/protocol-shared:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/protocol-shared:980138-980936
-/directory/apacheds/trunk/protocol-shared:980025-980137

Propchange: directory/apacheds/trunk/server-annotations/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,2 +1,2 @@
+/directory/apacheds/branches/apacheds-codec-merge/server-annotations:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-annotations:980138-980937
-/directory/apacheds/trunk/server-annotations:980025-980137

Propchange: directory/apacheds/trunk/server-config/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,2 +1,2 @@
+/directory/apacheds/branches/apacheds-codec-merge/server-config:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-config:980138-980938
-/directory/apacheds/trunk/server-config:980025-980137

Propchange: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 20 19:31:58 2010
@@ -1,6 +1,6 @@
+/directory/apacheds/branches/apacheds-codec-merge/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:980138-980938
 /directory/apacheds/branches/apacheds-replication/core-annotations/src/main/java/org/apache/directory/server/core/factory/ConfigPartitionReader.java:749790-764110
 /directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/ConfigPartitionReader.java:806623-896441
 /directory/apacheds/branches/apacheds-subtree/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:965203-965686
 /directory/apacheds/branches/xdbm-refactoring/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:945827-946347
-/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:980025-980137



Mime
View raw message