directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r764131 [4/16] - in /directory: apacheds/trunk/ apacheds/trunk/core-avl/ apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ apached...
Date Sat, 11 Apr 2009 01:03:25 GMT
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java Sat Apr 11 01:03:00 2009
@@ -40,17 +40,17 @@
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.OrNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
-import org.apache.directory.shared.ldap.message.LdapResult;
+import org.apache.directory.shared.ldap.message.InternalLdapResult;
 import org.apache.directory.shared.ldap.message.ReferralImpl;
-import org.apache.directory.shared.ldap.message.Response;
+import org.apache.directory.shared.ldap.message.InternalResponse;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.filter.SearchScope;
-import org.apache.directory.shared.ldap.message.Referral;
-import org.apache.directory.shared.ldap.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchResponseDone;
-import org.apache.directory.shared.ldap.message.SearchResponseEntry;
+import org.apache.directory.shared.ldap.message.InternalReferral;
+import org.apache.directory.shared.ldap.message.InternalSearchRequest;
+import org.apache.directory.shared.ldap.message.InternalSearchResponseDone;
+import org.apache.directory.shared.ldap.message.InternalSearchResponseEntry;
 import org.apache.directory.shared.ldap.message.SearchResponseEntryImpl;
-import org.apache.directory.shared.ldap.message.SearchResponseReference;
+import org.apache.directory.shared.ldap.message.InternalSearchResponseReference;
 import org.apache.directory.shared.ldap.message.SearchResponseReferenceImpl;
 import org.apache.directory.shared.ldap.message.control.ManageDsaITControl;
 import org.apache.directory.shared.ldap.message.control.PagedSearchControl;
@@ -78,7 +78,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 664302 $
  */
-public class SearchHandler extends ReferralAwareRequestHandler<SearchRequest>
+public class SearchHandler extends ReferralAwareRequestHandler<InternalSearchRequest>
 {
     private static final Logger LOG = LoggerFactory.getLogger( SearchHandler.class );
 
@@ -122,7 +122,7 @@
      * @param psearchControl the persistent search control extracted
      * @throws Exception if failures are encountered while searching
      */
-    private void handlePersistentSearch( LdapSession session, SearchRequest req, 
+    private void handlePersistentSearch( LdapSession session, InternalSearchRequest req, 
         PersistentSearchControl psearchControl ) throws Exception 
     {
         /*
@@ -131,7 +131,7 @@
          */
         if ( ! psearchControl.isChangesOnly() )
         {
-            SearchResponseDone done = doSimpleSearch( session, req );
+            InternalSearchResponseDone done = doSimpleSearch( session, req );
             
             // ok if normal search beforehand failed somehow quickly abandon psearch
             if ( done.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS )
@@ -171,7 +171,7 @@
      * @param req the search request on the RootDSE
      * @throws Exception if failures are encountered while searching
      */
-    private void handleRootDseSearch( LdapSession session, SearchRequest req ) throws Exception
+    private void handleRootDseSearch( LdapSession session, InternalSearchRequest req ) throws Exception
     {
         EntryFilteringCursor cursor = null;
         
@@ -227,11 +227,11 @@
      * the Cursor when either server mandated or request mandated time limits 
      * are reached.
      *
-     * @param req the {@link SearchRequest} issued
+     * @param req the {@link InternalSearchRequest} issued
      * @param session the {@link LdapSession} on which search was requested
      * @param cursor the {@link EntryFilteringCursor} over the search results
      */
-    private void setTimeLimitsOnCursor( SearchRequest req, LdapSession session, final EntryFilteringCursor cursor )
+    private void setTimeLimitsOnCursor( InternalSearchRequest req, LdapSession session, final EntryFilteringCursor cursor )
     {
         // Don't bother setting time limits for administrators
         if ( session.getCoreSession().isAnAdministrator() && req.getTimeLimit() == NO_TIME_LIMIT )
@@ -283,7 +283,7 @@
     /**
      * Return the server size limit
      */
-    private int getServerSizeLimit( LdapSession session, SearchRequest request )
+    private int getServerSizeLimit( LdapSession session, InternalSearchRequest request )
     {
         if ( session.getCoreSession().isAnAdministrator() )
         {
@@ -310,7 +310,7 @@
     }
     
     
-    private void readResults( LdapSession session, SearchRequest req, LdapResult ldapResult,
+    private void readResults( LdapSession session, InternalSearchRequest req, InternalLdapResult ldapResult,
     EntryFilteringCursor cursor, int sizeLimit ) throws Exception
     {
         int count = 0;
@@ -342,7 +342,7 @@
     }
     
     
-    private void readPagedResults( LdapSession session, SearchRequest req, LdapResult ldapResult,  
+    private void readPagedResults( LdapSession session, InternalSearchRequest req, InternalLdapResult ldapResult,  
         EntryFilteringCursor cursor, int sizeLimit, int pagedLimit, boolean isPaged, 
         PagedSearchContext pagedContext, PagedResultsControl pagedResultsControl ) throws Exception
     {
@@ -438,7 +438,7 @@
      * Manage the abandoned Paged Search (when paged size = 0). We have to
      * remove the cookie and its associated cursor from the session.
      */
-    private SearchResponseDone abandonPagedSearch( LdapSession session, SearchRequest req ) 
+    private InternalSearchResponseDone abandonPagedSearch( LdapSession session, InternalSearchRequest req ) 
         throws Exception
     {
         PagedResultsControl pagedResultsControl = null;
@@ -469,10 +469,10 @@
         
         // and return
         // DO NOT WRITE THE RESPONSE - JUST RETURN IT
-        LdapResult ldapResult = req.getResultResponse().getLdapResult();
+        InternalLdapResult ldapResult = req.getResultResponse().getLdapResult();
         ldapResult.setResultCode( ResultCodeEnum.SUCCESS );
         req.getResultResponse().add( pagedResultsControl );
-        return ( SearchResponseDone ) req.getResultResponse();
+        return ( InternalSearchResponseDone ) req.getResultResponse();
     }
     
     
@@ -495,7 +495,7 @@
     /**
      * Handle a Paged Search request.
      */
-    private SearchResponseDone doPagedSearch( LdapSession session, SearchRequest req, PagedSearchControl control )
+    private InternalSearchResponseDone doPagedSearch( LdapSession session, InternalSearchRequest req, PagedSearchControl control )
         throws Exception
     {
         PagedSearchControl pagedSearchControl = ( PagedSearchControl )control;
@@ -536,7 +536,7 @@
         
         // Now, depending on the cookie, we will deal with case 2, 3, 4 and 5
         byte [] cookie= pagedSearchControl.getCookie();
-        LdapResult ldapResult = req.getResultResponse().getLdapResult();
+        InternalLdapResult ldapResult = req.getResultResponse().getLdapResult();
         
         if ( StringTools.isEmpty( cookie ) )
         {
@@ -571,7 +571,7 @@
                 
                 // If we had a cookie in the session, remove it
                 removeContext( session, pagedContext );
-                return ( SearchResponseDone ) req.getResultResponse();
+                return ( InternalSearchResponseDone ) req.getResultResponse();
             }
             else
             {
@@ -606,7 +606,7 @@
                 ldapResult.setErrorMessage( "Invalid cookie for this PagedSearch request." );
                 ldapResult.setResultCode( ResultCodeEnum.UNWILLING_TO_PERFORM );
                 
-                return ( SearchResponseDone ) req.getResultResponse();
+                return ( InternalSearchResponseDone ) req.getResultResponse();
             }
             
             if ( pagedContext.hasSameRequest( req, session ) )
@@ -663,7 +663,7 @@
             }
         }
         
-        return ( SearchResponseDone ) req.getResultResponse();
+        return ( InternalSearchResponseDone ) req.getResultResponse();
     }
 
     
@@ -678,10 +678,10 @@
      * @return the result done 
      * @throws Exception if there are failures while processing the request
      */
-    private SearchResponseDone doSimpleSearch( LdapSession session, SearchRequest req ) 
+    private InternalSearchResponseDone doSimpleSearch( LdapSession session, InternalSearchRequest req ) 
         throws Exception
     {
-        LdapResult ldapResult = req.getResultResponse().getLdapResult();
+        InternalLdapResult ldapResult = req.getResultResponse().getLdapResult();
         
         // Check if we are using the Paged Search Control
         Object control = req.getControls().get( PagedSearchControl.CONTROL_OID );
@@ -735,7 +735,7 @@
             }
         }
         
-        return ( SearchResponseDone ) req.getResultResponse();
+        return ( InternalSearchResponseDone ) req.getResultResponse();
     }
     
 
@@ -751,7 +751,7 @@
      * @return the response for the entry
      * @throws Exception if there are problems in generating the response
      */
-    private Response generateResponse( LdapSession session, SearchRequest req, ClonedServerEntry entry ) throws Exception
+    private InternalResponse generateResponse( LdapSession session, InternalSearchRequest req, ClonedServerEntry entry ) throws Exception
     {
         EntryAttribute ref = entry.getOriginalEntry().get( SchemaConstants.REF_AT );
         boolean hasManageDsaItControl = req.getControls().containsKey( ManageDsaITControl.CONTROL_OID );
@@ -759,7 +759,7 @@
         if ( ( ref != null ) && ! hasManageDsaItControl )
         {
             // The entry is a referral.
-            SearchResponseReference respRef;
+            InternalSearchResponseReference respRef;
             respRef = new SearchResponseReferenceImpl( req.getMessageId() );
             respRef.setReferral( new ReferralImpl() );
             
@@ -805,7 +805,7 @@
         else 
         {
             // The entry is not a referral, or the ManageDsaIt control is set
-            SearchResponseEntry respEntry;
+            InternalSearchResponseEntry respEntry;
             respEntry = new SearchResponseEntryImpl( req.getMessageId() );
             respEntry.setEntry( entry );
             respEntry.setObjectName( entry.getDn() );
@@ -841,7 +841,7 @@
      * @param req the request to get the original filter from
      * @throws Exception if there are schema access problems
      */
-    public void modifyFilter( LdapSession session, SearchRequest req ) throws Exception
+    public void modifyFilter( LdapSession session, InternalSearchRequest req ) throws Exception
     {
         if ( req.hasControl( ManageDsaITControl.CONTROL_OID ) )
         {
@@ -893,7 +893,7 @@
      * @param session the associated session
      * @param req the received SearchRequest
      */
-    public void handleIgnoringReferrals( LdapSession session, SearchRequest req )
+    public void handleIgnoringReferrals( LdapSession session, InternalSearchRequest req )
     {
         if ( IS_DEBUG )
         {
@@ -947,7 +947,7 @@
             // Handle regular search requests from here down
             // ===============================================================
 
-            SearchResponseDone done = doSimpleSearch( session, req );
+            InternalSearchResponseDone done = doSimpleSearch( session, req );
             session.getIoSession().write( done );
         }
         catch ( Exception e )
@@ -994,9 +994,9 @@
     /**
      * Handles processing with referrals without ManageDsaIT control.
      */
-    public void handleWithReferrals( LdapSession session, LdapDN reqTargetDn, SearchRequest req ) throws NamingException
+    public void handleWithReferrals( LdapSession session, LdapDN reqTargetDn, InternalSearchRequest req ) throws NamingException
     {
-        LdapResult result = req.getResultResponse().getLdapResult();
+        InternalLdapResult result = req.getResultResponse().getLdapResult();
         ClonedServerEntry entry = null;
         boolean isReferral = false;
         boolean isparentReferral = false;
@@ -1062,7 +1062,7 @@
                 {
                     LOG.debug( "Entry is a referral: {}", entry );
                     
-                    handleReferralEntryForSearch( session, ( SearchRequest ) req, entry );
+                    handleReferralEntryForSearch( session, ( InternalSearchRequest ) req, entry );
 
                     return;
                 }
@@ -1106,7 +1106,7 @@
                 // if we get here then we have a valid referral ancestor
                 try
                 {
-                    Referral referral = getReferralOnAncestorForSearch( session, ( SearchRequest ) req, referralAncestor );
+                    InternalReferral referral = getReferralOnAncestorForSearch( session, ( InternalSearchRequest ) req, referralAncestor );
                     
                     result.setResultCode( ResultCodeEnum.REFERRAL );
                     result.setReferral( referral );
@@ -1131,10 +1131,10 @@
      * @param req the request
      * @param entry the entry associated with the request
      */
-    private void handleReferralEntryForSearch( LdapSession session, SearchRequest req, ClonedServerEntry entry )
+    private void handleReferralEntryForSearch( LdapSession session, InternalSearchRequest req, ClonedServerEntry entry )
         throws Exception
     {
-        LdapResult result = req.getResultResponse().getLdapResult();
+        InternalLdapResult result = req.getResultResponse().getLdapResult();
         ReferralImpl referral = new ReferralImpl();
         result.setReferral( referral );
         result.setResultCode( ResultCodeEnum.REFERRAL );
@@ -1189,7 +1189,7 @@
      * @param req the request issued
      * @return true if the search is on the RootDSE false otherwise
      */
-    private static boolean isRootDSESearch( SearchRequest req )
+    private static boolean isRootDSESearch( InternalSearchRequest req )
     {
         boolean isBaseIsRoot = req.getBase().isEmpty();
         boolean isBaseScope = req.getScope() == SearchScope.OBJECT;
@@ -1229,7 +1229,7 @@
      * 
      * @throws Exception the exception
      */
-    private static boolean isSubSchemaSubEntrySearch( LdapSession session, SearchRequest req ) throws Exception
+    private static boolean isSubSchemaSubEntrySearch( LdapSession session, InternalSearchRequest req ) throws Exception
     {
         LdapDN base = req.getBase();
         String baseNormForm = ( base.isNormalized() ? base.getNormName() : base.toNormName() );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchTimeLimitingMonitor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchTimeLimitingMonitor.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchTimeLimitingMonitor.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchTimeLimitingMonitor.java Sat Apr 11 01:03:00 2009
@@ -22,8 +22,8 @@
 
 import java.util.concurrent.TimeUnit;
 
-import org.apache.directory.server.core.cursor.ClosureMonitor;
-import org.apache.directory.server.core.cursor.CursorClosedException;
+import org.apache.directory.shared.ldap.cursor.ClosureMonitor;
+import org.apache.directory.shared.ldap.cursor.CursorClosedException;
 import org.apache.directory.shared.ldap.exception.LdapTimeLimitExceededException;
 
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java Sat Apr 11 01:03:00 2009
@@ -21,7 +21,7 @@
 
 
 import org.apache.directory.server.ldap.LdapSession;
-import org.apache.directory.shared.ldap.message.UnbindRequest;
+import org.apache.directory.shared.ldap.message.InternalUnbindRequest;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -29,17 +29,17 @@
 
 /**
  * A no reply protocol handler implementation for LDAP {@link
- * org.apache.directory.shared.ldap.message.UnbindRequest}s.
+ * org.apache.directory.shared.ldap.message.InternalUnbindRequest}s.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 664463 $
  */
-public class UnbindHandler extends LdapRequestHandler<UnbindRequest>
+public class UnbindHandler extends LdapRequestHandler<InternalUnbindRequest>
 {
     private static final Logger LOG = LoggerFactory.getLogger( UnbindHandler.class );
 
 
-    public void handle( LdapSession session, UnbindRequest request ) throws Exception
+    public void handle( LdapSession session, InternalUnbindRequest request ) throws Exception
     {
         try
         {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java Sat Apr 11 01:03:00 2009
@@ -27,9 +27,9 @@
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.message.BindRequest;
-import org.apache.directory.shared.ldap.message.LdapResult;
-import org.apache.directory.shared.ldap.message.MutableControl;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
+import org.apache.directory.shared.ldap.message.InternalLdapResult;
+import org.apache.directory.shared.ldap.message.InternalControl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
@@ -65,7 +65,7 @@
     private static final Logger LOG = LoggerFactory.getLogger( AbstractSaslCallbackHandler.class );
 
     /** An empty control array */ 
-    private static final MutableControl[] EMPTY = new MutableControl[0];
+    private static final InternalControl[] EMPTY = new InternalControl[0];
 
     private String username;
     private String realm;
@@ -80,7 +80,7 @@
     protected final DirectoryService directoryService;
     
     /** The associated BindRequest */
-    protected final BindRequest bindRequest;
+    protected final InternalBindRequest bindRequest;
 
 
     /**
@@ -88,7 +88,7 @@
      *
      * @param directoryService
      */
-    protected AbstractSaslCallbackHandler( DirectoryService directoryService, BindRequest bindRequest )
+    protected AbstractSaslCallbackHandler( DirectoryService directoryService, InternalBindRequest bindRequest )
     {
         this.directoryService = directoryService;
         this.bindRequest = bindRequest;
@@ -229,15 +229,15 @@
      * @param env An environment to be used to acquire an {@link LdapContext}.
      * @return An {@link LdapContext} for the client.
      */
-    protected LdapContext getContext( IoSession session, BindRequest bindRequest, Hashtable<String, Object> env )
+    protected LdapContext getContext( IoSession session, InternalBindRequest bindRequest, Hashtable<String, Object> env )
     {
-        LdapResult result = bindRequest.getResultResponse().getLdapResult();
+        InternalLdapResult result = bindRequest.getResultResponse().getLdapResult();
 
         LdapContext ctx = null;
 
         try
         {
-            MutableControl[] connCtls = bindRequest.getControls().values().toArray( EMPTY );
+            InternalControl[] connCtls = bindRequest.getControls().values().toArray( EMPTY );
             env.put( DirectoryService.JNDI_KEY, directoryService );
             ctx = new InitialLdapContext( env, connCtls );
         }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslServer.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslServer.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslServer.java Sat Apr 11 01:03:00 2009
@@ -24,7 +24,7 @@
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.ldap.LdapSession;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -38,7 +38,7 @@
 public abstract class AbstractSaslServer implements SaslServer 
 {
     /** The associated BindRequest */
-    private final BindRequest bindRequest;
+    private final InternalBindRequest bindRequest;
     
     /** The associated LdapSession instance */
     private final LdapSession ldapSession;
@@ -47,7 +47,7 @@
     private CoreSession adminSession;
     
     
-    public AbstractSaslServer( LdapSession ldapSession, CoreSession adminSession, BindRequest bindRequest )
+    public AbstractSaslServer( LdapSession ldapSession, CoreSession adminSession, InternalBindRequest bindRequest )
     {
         this.bindRequest = bindRequest;
         this.ldapSession = ldapSession;
@@ -80,7 +80,7 @@
     /**
      *  @return the associated BindRequest object
      */
-    public BindRequest getBindRequest()
+    public InternalBindRequest getBindRequest()
     {
         return bindRequest;
     }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/MechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/MechanismHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/MechanismHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/MechanismHandler.java Sat Apr 11 01:03:00 2009
@@ -23,7 +23,7 @@
 import javax.security.sasl.SaslServer;
 
 import org.apache.directory.server.ldap.LdapSession;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 
 
 /**
@@ -44,7 +44,7 @@
      * @return The {@link SaslServer} to use for the duration of the bound session.
      * @throws Exception
      */
-    public SaslServer handleMechanism( LdapSession session, BindRequest bindRequest ) throws Exception;
+    public SaslServer handleMechanism( LdapSession session, InternalBindRequest bindRequest ) throws Exception;
     
     
     /**

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java Sat Apr 11 01:03:00 2009
@@ -26,9 +26,9 @@
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.message.BindRequest;
-import org.apache.directory.shared.ldap.message.BindResponse;
-import org.apache.directory.shared.ldap.message.LdapResult;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindResponse;
+import org.apache.directory.shared.ldap.message.InternalLdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
@@ -53,7 +53,7 @@
     private static final Logger LOG = LoggerFactory.getLogger( SimpleMechanismHandler.class );
 
     
-    public SaslServer handleMechanism( LdapSession ldapSession, BindRequest bindRequest ) throws Exception
+    public SaslServer handleMechanism( LdapSession ldapSession, InternalBindRequest bindRequest ) throws Exception
     {
         // create a new Bind context, with a null session, as we don't have 
         // any context yet.
@@ -77,7 +77,7 @@
             ldapSession.setCoreSession( opContext.getSession() );
             
             // Return the successful response
-            BindResponse response = ( BindResponse ) bindRequest.getResultResponse();
+            InternalBindResponse response = ( InternalBindResponse ) bindRequest.getResultResponse();
             response.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
             LdapProtocolUtils.setResponseControls( opContext, response );
             
@@ -89,7 +89,7 @@
         {
             // Something went wrong. Write back an error message            
             ResultCodeEnum code = null;
-            LdapResult result = bindRequest.getResultResponse().getLdapResult();
+            InternalLdapResult result = bindRequest.getResultResponse().getLdapResult();
 
             if ( e instanceof LdapException )
             {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/cramMD5/CramMd5CallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/cramMD5/CramMd5CallbackHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/cramMD5/CramMd5CallbackHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/cramMD5/CramMd5CallbackHandler.java Sat Apr 11 01:03:00 2009
@@ -37,7 +37,7 @@
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
@@ -68,7 +68,7 @@
      * @param bindRequest the bind message
      * @param directoryService the directory service core
      */
-    public CramMd5CallbackHandler( LdapSession ldapSession, CoreSession adminSession, BindRequest bindRequest )
+    public CramMd5CallbackHandler( LdapSession ldapSession, CoreSession adminSession, InternalBindRequest bindRequest )
     {
         super( adminSession.getDirectoryService(), bindRequest );
         this.ldapSession = ldapSession;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/cramMD5/CramMd5MechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/cramMD5/CramMd5MechanismHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/cramMD5/CramMd5MechanismHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/cramMD5/CramMd5MechanismHandler.java Sat Apr 11 01:03:00 2009
@@ -25,7 +25,7 @@
 import org.apache.directory.server.ldap.handlers.bind.AbstractMechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.SaslConstants;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.sasl.Sasl;
@@ -43,7 +43,7 @@
  */
 public class CramMd5MechanismHandler extends AbstractMechanismHandler
 {
-    public SaslServer handleMechanism( LdapSession ldapSession, BindRequest bindRequest ) throws Exception
+    public SaslServer handleMechanism( LdapSession ldapSession, InternalBindRequest bindRequest ) throws Exception
     {
         SaslServer ss = (SaslServer)ldapSession.getSaslProperty( SaslConstants.SASL_SERVER );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5CallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5CallbackHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5CallbackHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5CallbackHandler.java Sat Apr 11 01:03:00 2009
@@ -37,7 +37,7 @@
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
@@ -67,7 +67,7 @@
      * @param bindRequest the bind message
      * @param directoryService the directory service core
      */
-    public DigestMd5CallbackHandler( LdapSession ldapSession, CoreSession adminSession, BindRequest bindRequest )
+    public DigestMd5CallbackHandler( LdapSession ldapSession, CoreSession adminSession, InternalBindRequest bindRequest )
     {
         super( adminSession.getDirectoryService(), bindRequest );
         this.ldapSession = ldapSession;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5MechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5MechanismHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5MechanismHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5MechanismHandler.java Sat Apr 11 01:03:00 2009
@@ -26,7 +26,7 @@
 import org.apache.directory.server.ldap.handlers.bind.AbstractMechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.SaslConstants;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.sasl.Sasl;
@@ -75,7 +75,7 @@
 
 
     
-    public SaslServer handleMechanism( LdapSession ldapSession, BindRequest bindRequest ) throws Exception
+    public SaslServer handleMechanism( LdapSession ldapSession, InternalBindRequest bindRequest ) throws Exception
     {
         SaslServer ss = (SaslServer)ldapSession.getSaslProperty( SaslConstants.SASL_SERVER );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/gssapi/GssapiCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/gssapi/GssapiCallbackHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/gssapi/GssapiCallbackHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/gssapi/GssapiCallbackHandler.java Sat Apr 11 01:03:00 2009
@@ -26,7 +26,7 @@
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.server.ldap.handlers.bind.AbstractSaslCallbackHandler;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -56,7 +56,7 @@
      * @param bindRequest the bind message
      * @param directoryService the directory service core
      */
-    public GssapiCallbackHandler( DirectoryService directoryService, LdapSession ldapSession, BindRequest bindRequest )
+    public GssapiCallbackHandler( DirectoryService directoryService, LdapSession ldapSession, InternalBindRequest bindRequest )
     {
         super( directoryService, bindRequest );
         this.ldapSession = ldapSession;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/gssapi/GssapiMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/gssapi/GssapiMechanismHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/gssapi/GssapiMechanismHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/gssapi/GssapiMechanismHandler.java Sat Apr 11 01:03:00 2009
@@ -24,7 +24,7 @@
 import org.apache.directory.server.ldap.handlers.bind.AbstractMechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.SaslConstants;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 
 import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;
@@ -43,7 +43,7 @@
  */
 public class GssapiMechanismHandler extends AbstractMechanismHandler
 {
-    public SaslServer handleMechanism( LdapSession ldapSession, BindRequest bindRequest ) throws Exception
+    public SaslServer handleMechanism( LdapSession ldapSession, InternalBindRequest bindRequest ) throws Exception
     {
         SaslServer ss = (SaslServer)ldapSession.getSaslProperty( SaslConstants.SASL_SERVER );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmMechanismHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmMechanismHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmMechanismHandler.java Sat Apr 11 01:03:00 2009
@@ -23,7 +23,7 @@
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.server.ldap.handlers.bind.AbstractMechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.SaslConstants;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 
 import javax.security.sasl.SaslServer;
 
@@ -55,7 +55,7 @@
     }
 
 
-    public SaslServer handleMechanism( LdapSession ldapSession, BindRequest bindRequest ) throws Exception
+    public SaslServer handleMechanism( LdapSession ldapSession, InternalBindRequest bindRequest ) throws Exception
     {
         SaslServer ss = ( SaslServer ) ldapSession.getSaslProperty( SaslConstants.SASL_SERVER );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/ntlm/NtlmSaslServer.java Sat Apr 11 01:03:00 2009
@@ -28,7 +28,7 @@
 import org.apache.directory.server.ldap.handlers.bind.SaslConstants;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -55,7 +55,7 @@
     private final NtlmProvider provider;
 
     
-    public NtlmSaslServer( NtlmProvider provider, BindRequest bindRequest, LdapSession ldapSession )
+    public NtlmSaslServer( NtlmProvider provider, InternalBindRequest bindRequest, LdapSession ldapSession )
     {
         super( ldapSession, null, bindRequest );
         this.provider = provider;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/plain/PlainMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/plain/PlainMechanismHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/plain/PlainMechanismHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/plain/PlainMechanismHandler.java Sat Apr 11 01:03:00 2009
@@ -24,7 +24,7 @@
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.server.ldap.handlers.bind.AbstractMechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.SaslConstants;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 
 import javax.security.sasl.SaslServer;
 
@@ -42,7 +42,7 @@
     /**
      * {@inheritDoc}
      */
-    public SaslServer handleMechanism( LdapSession ldapSession, BindRequest bindRequest ) throws Exception
+    public SaslServer handleMechanism( LdapSession ldapSession, InternalBindRequest bindRequest ) throws Exception
     {
         SaslServer ss = ( SaslServer ) ldapSession.getSaslProperty( SaslConstants.SASL_SERVER );
         

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/plain/PlainSaslServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/plain/PlainSaslServer.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/plain/PlainSaslServer.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/plain/PlainSaslServer.java Sat Apr 11 01:03:00 2009
@@ -27,7 +27,7 @@
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.server.ldap.handlers.bind.AbstractSaslServer;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.PrepareString;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -88,7 +88,7 @@
      * @param bindRequest The associated BindRequest object
      * @param ldapSession The associated LdapSession instance 
      */
-    public PlainSaslServer( LdapSession ldapSession, CoreSession adminSession, BindRequest bindRequest )
+    public PlainSaslServer( LdapSession ldapSession, CoreSession adminSession, InternalBindRequest bindRequest )
     {
         super( ldapSession, adminSession, bindRequest );
         state = NegotiationState.INITIALIZED;

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=764131&r1=764130&r2=764131&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 Sat Apr 11 01:03:00 2009
@@ -29,7 +29,7 @@
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.message.SearchRequest;
+import org.apache.directory.shared.ldap.message.InternalSearchRequest;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -44,7 +44,7 @@
 public class PagedSearchContext
 {
     /** The previous search request */
-    private SearchRequest previousSearchRequest;
+    private InternalSearchRequest previousSearchRequest;
     
     /** The current position in the cursor */
     private int currentPosition;
@@ -61,7 +61,7 @@
     /**
      * Creates a new instance of this class, storing the Searchrequest into it.
      */
-    public PagedSearchContext( SearchRequest searchRequest )
+    public PagedSearchContext( InternalSearchRequest searchRequest )
     {
         previousSearchRequest = searchRequest;
         currentPosition = 0;
@@ -112,7 +112,7 @@
     /**
      * Build a set of OIDs from the list of attributes we have in the search request
      */
-    private Set<String> buildAttributeSet( SearchRequest request, LdapSession session, 
+    private Set<String> buildAttributeSet( InternalSearchRequest request, LdapSession session, 
         AttributeTypeRegistry atRegistry )
     {
         Set<String> requestSet = new HashSet<String>();
@@ -149,7 +149,7 @@
      * @param request The new SearchRequest
      * @return true if both request are equal.
      */
-    public boolean hasSameRequest( SearchRequest request, LdapSession session )
+    public boolean hasSameRequest( InternalSearchRequest request, LdapSession session )
     {
         // Compares the scope
         if ( request.getScope() != previousSearchRequest.getScope() )
@@ -284,7 +284,7 @@
     /**
      * @return The previous search request
      */
-    public SearchRequest getPreviousSearchRequest()
+    public InternalSearchRequest 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=764131&r1=764130&r2=764131&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 Sat Apr 11 01:03:00 2009
@@ -32,10 +32,10 @@
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.extended.operations.CertGenerationContainer;
-import org.apache.directory.shared.ldap.codec.extended.operations.CertGenerationDecoder;
-import org.apache.directory.shared.ldap.codec.extended.operations.CertGenerationObject;
-import org.apache.directory.shared.ldap.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.codec.extended.operations.certGeneration.CertGenerationContainer;
+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.message.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.message.extended.CertGenerationRequest;
 import org.apache.directory.shared.ldap.message.extended.CertGenerationResponse;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -78,7 +78,7 @@
     }
 
 
-    public void handleExtendedOperation( LdapSession session, ExtendedRequest req ) throws Exception
+    public void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception
     {
         ByteBuffer bb = ByteBuffer.wrap( req.getPayload() );
         Asn1Decoder decoder = new CertGenerationDecoder();

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=764131&r1=764130&r2=764131&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 Sat Apr 11 01:03:00 2009
@@ -30,7 +30,7 @@
 import org.apache.directory.server.ldap.ExtendedOperationHandler;
 import org.apache.directory.server.ldap.LdapService;
 import org.apache.directory.server.ldap.LdapSession;
-import org.apache.directory.shared.ldap.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.message.InternalExtendedRequest;
 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;
@@ -68,7 +68,7 @@
     }
 
 
-    public void handleExtendedOperation( LdapSession requestor, ExtendedRequest req ) throws Exception
+    public void handleExtendedOperation( LdapSession requestor, InternalExtendedRequest req ) throws Exception
     {
         // make sue only the administrator can issue this shutdown request if 
         // not we respond to the requestor with with insufficientAccessRights(50)
@@ -201,7 +201,7 @@
         {
             try
             {
-                future.join( 1000 );
+                future.awaitUninterruptibly( 1000 );
             }
             catch ( Exception e )
             {
@@ -253,7 +253,7 @@
         {
             try
             {
-                future.join( 1000 );
+                future.awaitUninterruptibly( 1000 );
                 sessionIt.next().close( true );
             }
             catch ( Exception e )

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java Sat Apr 11 01:03:00 2009
@@ -43,7 +43,7 @@
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.server.ldap.gui.SessionsFrame;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
-import org.apache.directory.shared.ldap.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.message.InternalExtendedRequest;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.extended.LaunchDiagnosticUiRequest;
 import org.apache.directory.shared.ldap.message.extended.LaunchDiagnosticUiResponse;
@@ -75,7 +75,7 @@
     }
 
 
-    public void handleExtendedOperation( LdapSession requestor, ExtendedRequest req )
+    public void handleExtendedOperation( LdapSession requestor, InternalExtendedRequest req )
         throws Exception
     {
         DirectoryService service = requestor.getCoreSession().getDirectoryService();

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=764131&r1=764130&r2=764131&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 Sat Apr 11 01:03:00 2009
@@ -39,10 +39,10 @@
 import org.apache.directory.server.ldap.ExtendedOperationHandler;
 import org.apache.directory.server.ldap.LdapService;
 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.InternalExtendedRequest;
+import org.apache.directory.shared.ldap.message.InternalExtendedResponse;
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
-import org.apache.directory.shared.ldap.message.LdapResult;
+import org.apache.directory.shared.ldap.message.InternalLdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.mina.core.filterchain.IoFilterChain;
 import org.apache.mina.filter.ssl.SslFilter;
@@ -77,7 +77,7 @@
     }
     
 
-    public void handleExtendedOperation( LdapSession session, ExtendedRequest req ) throws Exception
+    public void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception
     {
         LOG.info( "Handling StartTLS request." );
         
@@ -93,8 +93,8 @@
             sslFilter.startSsl( session.getIoSession() );
         }
         
-        ExtendedResponse res = new ExtendedResponseImpl( req.getMessageId() );
-        LdapResult result = res.getLdapResult();
+        InternalExtendedResponse res = new ExtendedResponseImpl( req.getMessageId() );
+        InternalLdapResult result = res.getLdapResult();
         result.setResultCode( ResultCodeEnum.SUCCESS );
         res.setResponseName( EXTENSION_OID );
         res.setResponse( new byte[ 0 ] );

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=764131&r1=764130&r2=764131&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 Sat Apr 11 01:03:00 2009
@@ -17,8 +17,6 @@
  *  under the License. 
  *  
  */
-
-
 package org.apache.directory.server.ldap.handlers.extended;
 
 
@@ -41,12 +39,12 @@
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
-import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedure;
-import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedureContainer;
-import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedureDecoder;
-import org.apache.directory.shared.ldap.codec.extended.operations.StoredProcedure.StoredProcedureParameter;
-import org.apache.directory.shared.ldap.message.ExtendedRequest;
-import org.apache.directory.shared.ldap.message.ExtendedResponse;
+import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedure;
+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.InternalExtendedRequest;
+import org.apache.directory.shared.ldap.message.InternalExtendedResponse;
 import org.apache.directory.shared.ldap.message.extended.StoredProcedureRequest;
 import org.apache.directory.shared.ldap.message.extended.StoredProcedureResponse;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -79,7 +77,7 @@
     }
 
 
-    public void handleExtendedOperation( LdapSession session, ExtendedRequest req ) throws Exception
+    public void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception
     {
         StoredProcedure spBean = decodeBean( req.getPayload() );
         
@@ -108,7 +106,7 @@
         Object response = engine.invokeProcedure( session.getCoreSession(), procedure, values );
         
         byte[] serializedResponse = SerializationUtils.serialize( ( Serializable ) response );
-        ( ( ExtendedResponse )( req.getResultResponse() ) ).setResponse( serializedResponse );
+        ( ( InternalExtendedResponse )( req.getResultResponse() ) ).setResponse( serializedResponse );
         session.getIoSession().write( req.getResultResponse() );
         
     }

Added: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaPeerConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaPeerConfiguration.java?rev=764131&view=auto
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaPeerConfiguration.java (added)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaPeerConfiguration.java Sat Apr 11 01:03:00 2009
@@ -0,0 +1,236 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package org.apache.directory.server.ldap.replication;
+
+
+import javax.naming.InvalidNameException;
+
+import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.util.StringTools;
+
+/**
+ * A configuration for a replica peer. We may have many replications relation
+ * set for a server, each one of them being described with this structure. 
+ *
+ * @org.apache.xbean.XBean
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ReplicaPeerConfiguration
+{
+    /** A flag used when the replication use the RefreshOnly system */
+    private boolean refreshOnly;
+    
+    /** The time to wait between two consecutive RefreshOnly replication*/
+    private long interval;
+    
+    /** Default interval is 5 minutes */
+    private static final long DEFAULT_INTERVAL = 1000L*5L*60L;
+    
+    /** The default host */
+    private static final String DEFAULT_HOST = "localhost";
+    
+    /** The default ssl port */
+    private static final int DEFAULT_PORT = 10389;
+    
+    /** The default port */
+    private static final int DEFAULT_SSL_PORT = 10686;
+    
+    /** The producer we want to replicate */
+    private LdapURL producer;
+    
+    /** The principal to use to connect to the producer */
+    private LdapDN principalDN;
+    
+    /** The principal's password */
+    private String password;
+    
+    /** The producer's host */
+    private String host;
+    
+    /** The producer's port */
+    private int port;
+    
+    /** The base DN used for replication */
+    private LdapDN baseDN;
+    
+    /** A flag to tell the server to use an SSL connection */
+    private boolean useSSL;
+
+    
+    /**
+     * 
+     * Creates a new instance of ConsumerConfiguration.
+     *
+     */
+    public ReplicaPeerConfiguration()
+    {
+        interval = DEFAULT_INTERVAL;
+    }
+    
+    /**
+     * Set the type of replication wanted. If false, it will default
+     * to RefreshAndPersist.
+     * @param refreshOnly true if the refreshOnly replication is requested
+     */
+    public void setRefreshOnly( boolean refreshOnly )
+    {
+        this.refreshOnly = refreshOnly;
+    }
+
+    /**
+     * @return the refreshOnly flag
+     */
+    public boolean isRefreshOnly()
+    {
+        return refreshOnly;
+    }
+
+    /**
+     * Set the delay between two RefreshOnly replication. Its given in seconds.
+     * @param interval the interval to set
+     */
+    public void setInterval( long interval )
+    {
+        // Convert to milliseconds
+        this.interval = interval*1000L;
+    }
+
+    /**
+     * @return the interval
+     */
+    public long getInterval()
+    {
+        return interval;
+    }
+
+    /**
+     * @return the baseDN
+     */
+    public LdapDN getBaseDN()
+    {
+        return baseDN;
+    }
+
+    /**
+     * @param principalDN the principalDN to set
+     */
+    public void setPrincipalDN( String principalDN ) throws InvalidNameException
+    {
+        this.principalDN = new LdapDN( principalDN );
+    }
+
+
+    /**
+     * @return the principalDN
+     */
+    public LdapDN getPrincipalDN()
+    {
+        return principalDN;
+    }
+
+    
+    /**
+     * @param password the password to set
+     */
+    public void setPassword( String password )
+    {
+        this.password = password;
+    }
+
+    /**
+     * @return the password
+     */
+    public String getPassword()
+    {
+        return password;
+    }
+
+    /**
+     * @param producer the producer to set
+     */
+    public void setProducer( String producer ) throws LdapURLEncodingException
+    {
+        this.producer = new LdapURL( producer );
+        
+        // Update the other fields
+        baseDN = this.producer.getDn();
+        useSSL = "ldaps".equalsIgnoreCase( this.producer.getScheme() );
+        host = this.producer.getHost();
+        
+        if ( StringTools.isEmpty( host ) )
+        {
+            host = DEFAULT_HOST;
+        }
+        
+        port = this.producer.getPort();
+        
+        if ( port == -1 )
+        {
+            if ( useSSL )
+            {
+                port = DEFAULT_SSL_PORT;
+            }
+            else
+            {
+                port = DEFAULT_PORT;
+            }
+        }
+    }
+
+    
+    /**
+     * @return the producer
+     */
+    public LdapURL getProducer()
+    {
+        return producer;
+    }
+
+
+    /**
+     * @return true if the connection with the producer is done using SSL
+     */
+    public boolean isUseSSL()
+    {
+        return useSSL;
+    }
+
+
+    /**
+     * @return the producer's host
+     */
+    public String getHost()
+    {
+        return host;
+    }
+
+
+    /**
+     * @return the producer's port
+     */
+    public int getPort()
+    {
+        return port;
+    }
+}

Added: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationManager.java?rev=764131&view=auto
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationManager.java (added)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationManager.java Sat Apr 11 01:03:00 2009
@@ -0,0 +1,25 @@
+
+package org.apache.directory.server.ldap.replication;
+
+import org.apache.mina.core.service.IoConnector;
+import org.apache.mina.transport.socket.nio.NioSocketConnector;
+
+public class ReplicationManager
+{
+    /** The connector use to connect to the replicas */
+    IoConnector connector;
+    
+    /**
+     * 
+     * Creates a new instance of ReplicationManager. It initialize the 
+     * connections to the replicas.
+     *
+     */
+    public ReplicationManager()
+    {
+        // Create the connector
+        connector = new NioSocketConnector();
+        
+        
+    }
+}

Added: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationSystem.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationSystem.java?rev=764131&view=auto
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationSystem.java (added)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicationSystem.java Sat Apr 11 01:03:00 2009
@@ -0,0 +1,60 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.ldap.replication;
+
+import java.util.HashSet;
+import java.util.Set;
+
+
+/**
+ * The replication sub-system.
+ *
+ * @org.apache.xbean.XBean
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ReplicationSystem
+{
+    /** The list of servers this server is connected to */
+    private Set<ReplicaPeerConfiguration> replicaPeers;
+    
+    
+    public ReplicationSystem()
+    {
+        replicaPeers = new HashSet<ReplicaPeerConfiguration>();
+    }
+    
+    
+    /**
+     * Set the list of replica peers this server is connected to
+     *
+     * @param replicaPeers The list of replicas
+     */
+    public void setReplicaPeers( Set<ReplicaPeerConfiguration> replicaPeers )
+    {
+        this.replicaPeers = replicaPeers;
+    }
+    
+    public Set<ReplicaPeerConfiguration> getReplicaPeers()
+    {
+        return replicaPeers;
+    }
+}

Added: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SearchResultDoneResponseHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SearchResultDoneResponseHandler.java?rev=764131&view=auto
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SearchResultDoneResponseHandler.java (added)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SearchResultDoneResponseHandler.java Sat Apr 11 01:03:00 2009
@@ -0,0 +1,100 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.ldap.replication;
+
+
+import org.apache.directory.server.ldap.LdapSession;
+import org.apache.directory.shared.ldap.codec.ControlCodec;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlCodec;
+import org.apache.directory.shared.ldap.codec.search.SearchResultDoneCodec;
+import org.apache.directory.shared.ldap.message.InternalSearchResponseDone;
+import org.apache.directory.shared.ldap.util.StringTools;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Handle the SearchResultDone response, received from a producer server, when
+ * replication is set.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SearchResultDoneResponseHandler<T extends InternalSearchResponseDone>
+{
+    private static final Logger LOG = LoggerFactory.getLogger( SearchResultDoneResponseHandler.class );
+    
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+    
+    public final void handle( LdapSession session, T response ) throws Exception
+    {
+        LOG.debug( "Handling single searchResultDone response: {}", response );
+        
+        SearchResultDoneCodec searchResult = (SearchResultDoneCodec)response;
+        
+        // Get the control
+        ControlCodec control = searchResult.getCurrentControl();
+        SyncDoneValueControlCodec syncDoneCtrl = ( SyncDoneValueControlCodec ) control.getControlValue();
+
+        /** the sync cookie sent by the server */
+        byte[] syncCookie;
+
+        if ( syncDoneCtrl.getCookie() != null )
+        {
+            syncCookie = syncDoneCtrl.getCookie();
+            LOG.debug( "assigning cookie from sync done value control: {}", StringTools.utf8ToString( syncCookie ) );
+        }
+        else
+        {
+            LOG.info( "cookie in syncdone message is null" );
+        }
+
+        SyncreplConfiguration config = (SyncreplConfiguration)session.getIoSession().getAttribute( "SYNC_COOKIE" );
+        
+        if ( !config.isRefreshPersist() )
+        {
+            // Now, switch to refreshAndPresist
+            config.setRefreshPersist( true );
+            LOG.debug( "Swithing to RefreshAndPersist" );
+         
+            try
+            {
+                // the below call is required to send the updated cookie
+                // and refresh mode change (i.e to refreshAndPersist stage)
+                // cause while the startSync() method sleeps even after the 'sync done'
+                // message arrives as part of initial searchRequest with 'refreshOnly' mode.
+                // During this sleep time any 'modifications' happened on the server 
+                // to already fetched entries will be sent as SearchResultEntries with
+                // SyncState value as 'ADD' which will conflict with the DNs of initially received entries
+                
+                // TODO thinking of alternative ways to implement this in case of large DITs 
+                // where the modification to entry(ies) can happen before the initial sync is done
+                //doSyncSearch();
+            }
+            catch( Exception e )
+            {
+                LOG.error( "Failed to send a search request with RefreshAndPersist mode", e );
+            }
+        }
+    }
+}

Added: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java?rev=764131&view=auto
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java (added)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java Sat Apr 11 01:03:00 2009
@@ -0,0 +1,284 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.ldap.replication;
+
+import org.apache.directory.shared.ldap.filter.SearchScope;
+
+/**
+ * 
+ * A class for holding the syncrepl consumer's configuration.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SyncreplConfiguration
+{
+    /** host name of the syncrepl provider server */
+    private String providerHost;
+
+    /** port number of the syncrepl provider server */
+    private int port;
+
+    /** bind dn */
+    private String bindDn;
+
+    /** password for binding with bind dn */
+    private String credentials;
+
+    /** flag to represent refresh and persist or refreh only mode */
+    private boolean refreshPersist = true;
+
+    /** time interval for successive sync requests */
+    private long consumerInterval = 5 * 1000;
+
+    /** the base DN whose content will be searched for syncing */
+    private String baseDn;
+
+    /** the ldap filter for fetching the entries */
+    private String filter;
+
+    /** a comma separated string of attribute names */
+    private String attributes;
+
+    /** the numer for setting the limit on numer of search results to be fteched
+     * default value is 0 (i.e no limit) */
+    private int searchSizeLimit = 0;
+
+    /** the timeout value to be used while doing a search 
+     * default value is 0 (i.e no limit)*/
+    private int searchTimeout = 0;
+
+    /** the search scope */
+    private int searchScope = SearchScope.ONELEVEL.getJndiScope();
+
+    /** the replica's id */
+    private int replicaId;
+    
+    /**
+     * @return the providerHost
+     */
+    public String getProviderHost()
+    {
+        return providerHost;
+    }
+
+    /**
+     * @param providerHost the providerHost to set
+     */
+    public void setProviderHost( String providerHost )
+    {
+        this.providerHost = providerHost;
+    }
+
+    /**
+     * @return the port
+     */
+    public int getPort()
+    {
+        return port;
+    }
+
+    /**
+     * @param port the port to set
+     */
+    public void setPort( int port )
+    {
+        this.port = port;
+    }
+
+    /**
+     * @return the bindDn
+     */
+    public String getBindDn()
+    {
+        return bindDn;
+    }
+
+    /**
+     * @param bindDn the bindDn to set
+     */
+    public void setBindDn( String bindDn )
+    {
+        this.bindDn = bindDn;
+    }
+
+    /**
+     * @return the credentials
+     */
+    public String getCredentials()
+    {
+        return credentials;
+    }
+
+    /**
+     * @param credentials the credentials to set
+     */
+    public void setCredentials( String credentials )
+    {
+        this.credentials = credentials;
+    }
+
+    /**
+     * @return the refreshPersist
+     */
+    public boolean isRefreshPersist()
+    {
+        return refreshPersist;
+    }
+
+    /**
+     * @param refreshPersist the refreshPersist to set
+     */
+    public void setRefreshPersist( boolean refreshPersist )
+    {
+        this.refreshPersist = refreshPersist;
+    }
+
+    /**
+     * @return the consumerInterval
+     */
+    public long getConsumerInterval()
+    {
+        return consumerInterval;
+    }
+
+    /**
+     * @param consumerInterval the consumerInterval to set
+     */
+    public void setConsumerInterval( long consumerInterval )
+    {
+        this.consumerInterval = consumerInterval;
+    }
+
+    /**
+     * @return the baseDn
+     */
+    public String getBaseDn()
+    {
+        return baseDn;
+    }
+
+    /**
+     * @param baseDn the baseDn to set
+     */
+    public void setBaseDn( String baseDn )
+    {
+        this.baseDn = baseDn;
+    }
+
+    /**
+     * @return the filter
+     */
+    public String getFilter()
+    {
+        return filter;
+    }
+
+    /**
+     * @param filter the filter to set
+     */
+    public void setFilter( String filter )
+    {
+        this.filter = filter;
+    }
+
+    /**
+     * @return the attributes
+     */
+    public String getAttributes()
+    {
+        return attributes;
+    }
+
+    /**
+     * @param attributes the attributes to set
+     */
+    public void setAttributes( String attributes )
+    {
+        this.attributes = attributes;
+    }
+
+    /**
+     * @return the searchSizeLimit
+     */
+    public int getSearchSizeLimit()
+    {
+        return searchSizeLimit;
+    }
+
+    /**
+     * @param searchSizeLimit the searchSizeLimit to set
+     */
+    public void setSearchSizeLimit( int searchSizeLimit )
+    {
+        this.searchSizeLimit = searchSizeLimit;
+    }
+
+    /**
+     * @return the searchTimeout
+     */
+    public int getSearchTimeout()
+    {
+        return searchTimeout;
+    }
+
+    /**
+     * @param searchTimeout the searchTimeout to set
+     */
+    public void setSearchTimeout( int searchTimeout )
+    {
+        this.searchTimeout = searchTimeout;
+    }
+
+    /**
+     * @return the searchScope
+     */
+    public int getSearchScope()
+    {
+        return searchScope;
+    }
+
+    /**
+     * @param searchScope the searchScope to set
+     */
+    public void setSearchScope( int searchScope )
+    {
+        this.searchScope = searchScope;
+    }
+
+    /**
+     * @return the replicaId
+     */
+    public int getReplicaId()
+    {
+        return replicaId;
+    }
+
+    /**
+     * @param replicaId the replicaId to set
+     */
+    public void setReplicaId( int replicaId )
+    {
+        this.replicaId = replicaId;
+    }
+
+    
+    
+}

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=764131&r1=764130&r2=764131&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 Sat Apr 11 01:03:00 2009
@@ -34,15 +34,15 @@
 import org.apache.directory.server.ldap.handlers.UnbindHandler;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
-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.directory.shared.ldap.message.InternalAbandonRequest;
+import org.apache.directory.shared.ldap.message.InternalAddRequest;
+import org.apache.directory.shared.ldap.message.InternalBindRequest;
+import org.apache.directory.shared.ldap.message.InternalCompareRequest;
+import org.apache.directory.shared.ldap.message.InternalDeleteRequest;
+import org.apache.directory.shared.ldap.message.InternalModifyDnRequest;
+import org.apache.directory.shared.ldap.message.InternalModifyRequest;
+import org.apache.directory.shared.ldap.message.InternalSearchRequest;
+import org.apache.directory.shared.ldap.message.InternalUnbindRequest;
 import org.apache.mina.core.session.IoSession;
 
 
@@ -113,7 +113,7 @@
     
     public static class BogusAbandonHandler extends AbandonHandler
     {
-        public void abandonMessageReceived( IoSession session, AbandonRequest request )
+        public void abandonMessageReceived( IoSession session, InternalAbandonRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -122,7 +122,7 @@
     
     public static class BogusUnbindHandler extends UnbindHandler
     {
-        public void unbindMessageReceived( IoSession session, UnbindRequest request )
+        public void unbindMessageReceived( IoSession session, InternalUnbindRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -130,7 +130,7 @@
 
     public static class BogusAddHandler extends AddHandler
     {
-        public void addMessageReceived( IoSession session, AddRequest request )
+        public void addMessageReceived( IoSession session, InternalAddRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -143,7 +143,7 @@
         }
 
 
-        public void bindMessageReceived( IoSession session, BindRequest request )
+        public void bindMessageReceived( IoSession session, InternalBindRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -151,7 +151,7 @@
 
     public static class BogusCompareHandler extends CompareHandler
     {
-        public void compareMessageReceived( IoSession session, CompareRequest request )
+        public void compareMessageReceived( IoSession session, InternalCompareRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -159,7 +159,7 @@
 
     public static class BogusDeleteHandler extends  DeleteHandler
     {
-        public void deleteMessageReceived( IoSession session, DeleteRequest request )
+        public void deleteMessageReceived( IoSession session, InternalDeleteRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -167,7 +167,7 @@
 
     public static class BogusModifyDnHandler extends  ModifyDnHandler
     {
-        public void modifyDnMessageReceived( IoSession session, ModifyDnRequest request )
+        public void modifyDnMessageReceived( IoSession session, InternalModifyDnRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -175,7 +175,7 @@
 
     public static class BogusModifyHandler extends ModifyHandler
     {
-        public void modifyMessageReceived( IoSession session, ModifyRequest request )
+        public void modifyMessageReceived( IoSession session, InternalModifyRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }
@@ -183,7 +183,7 @@
 
     public static class BogusSearchHandler extends SearchHandler
     {
-        public void searchMessageReceived( IoSession session, SearchRequest request )
+        public void searchMessageReceived( IoSession session, InternalSearchRequest request )
         {
             throw new NotImplementedException( "handler not implemented!" );
         }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java?rev=764131&r1=764130&r2=764131&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java Sat Apr 11 01:03:00 2009
@@ -60,7 +60,7 @@
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.directory.shared.ldap.message.MutableControl;
+import org.apache.directory.shared.ldap.message.InternalControl;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
 import org.apache.mina.util.AvailablePortFinder;
 import org.junit.After;
@@ -392,7 +392,7 @@
     @Test
     public void testFailureWithUnsupportedControl() throws Exception
     {
-        MutableControl unsupported = new MutableControl()
+        InternalControl unsupported = new InternalControl()
         {
             boolean isCritical = true;
             private static final long serialVersionUID = 1L;
@@ -468,7 +468,7 @@
         user.put( oc );
         user.put( "sn", "Bush" );
         user.put( "userPassword", "Aerial" );
-        ctx.setRequestControls( new MutableControl[]
+        ctx.setRequestControls( new InternalControl[]
                 {unsupported} );
 
         try



Mime
View raw message