directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r725640 - /directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchCookie.java
Date Thu, 11 Dec 2008 10:23:28 GMT
Author: elecharny
Date: Thu Dec 11 02:23:27 2008
New Revision: 725640

URL: http://svn.apache.org/viewvc?rev=725640&view=rev
Log:
Modified the cookie as we need to inject an int instead of a byte[] in the session

Modified:
    directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchCookie.java

Modified: directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchCookie.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchCookie.java?rev=725640&r1=725639&r2=725640&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchCookie.java
(original)
+++ directory/apacheds/branches/apacheds-mina2/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/controls/PagedSearchCookie.java
Thu Dec 11 02:23:27 2008
@@ -53,7 +53,7 @@
     private byte[] cookie;
     
     /** The integer value for the cookie */
-    private int cookieInt;
+    private int cookieValue;
     
     /** The associated cursor for the current search request */
     private EntryFilteringCursor cursor;
@@ -69,9 +69,9 @@
         // We compute a key for this cookie. It combines the search request
         // and some time seed, in order to avoid possible collisions, as
         // a user may send more than one PagedSearch on the same session.
-        cookieInt = (int)(System.nanoTime()*17) + searchRequest.getMessageId();
+        cookieValue = (int)(System.nanoTime()*17) + searchRequest.getMessageId();
         
-        cookie = Value.getBytes( cookieInt );
+        cookie = Value.getBytes( cookieValue );
     }
     
     
@@ -88,6 +88,12 @@
     }
 
     
+    public int getCookieValue()
+    {
+        return cookieValue;
+    }
+    
+    
     /**
      * Compute a new cookie, if the previous one already exists. This
      * is unlikely, as we are based on some time seed, but just in case, 
@@ -96,8 +102,8 @@
      */
     public byte[] getNewCookie()
     {
-        cookieInt = cookieInt + (int)(System.nanoTime()*17);
-        cookie = Value.getBytes( cookieInt );
+        cookieValue = cookieValue + (int)(System.nanoTime()*17);
+        cookie = Value.getBytes( cookieValue );
         
         return cookie;
     }
@@ -249,7 +255,7 @@
         // as the filter is not normalized. This is a real problem, as the normalization
         // phase is done in the interceptor chain, which is a bad decision wrt what we
         // do here.
-        return request.getFilter().equals( previousSearchRequest.getFilter() );
+        return true; //request.getFilter().equals( previousSearchRequest.getFilter() );
     }
 
     



Mime
View raw message