directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r918968 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/ apacheds/trunk/core/src/main/java/org/apache/direc...
Date Thu, 04 Mar 2010 12:38:23 GMT
Author: elecharny
Date: Thu Mar  4 12:38:23 2010
New Revision: 918968

URL: http://svn.apache.org/viewvc?rev=918968&view=rev
Log:
The aliasDerefMode is not anymore an argument to any constructor

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java
    directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java?rev=918968&r1=918967&r2=918968&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java
Thu Mar  4 12:38:23 2010
@@ -25,7 +25,6 @@
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
-import org.apache.directory.shared.ldap.message.AliasDerefMode;
 
 
 /**
@@ -58,19 +57,6 @@
 
 
     /**
-     * Creates a new instance of ListOperationContext.
-     *
-     * @param dn The DN to get the suffix from
-     * @param aliasDerefMode the alias dereferencing mode to use
-     */
-    public ListOperationContext( CoreSession session, DN dn, AliasDerefMode aliasDerefMode
)
-    {
-        super( session, dn );
-        this.aliasDerefMode = aliasDerefMode;
-    }
-
-    
-    /**
      * Creates a new instance of ListOperationContext with attributes to return.
      *
      * @param session the session associated with this {@link OperationContext}
@@ -78,11 +64,9 @@
      * @param aliasDerefMode the alias dereferencing mode to use
      * @param returningAttributes the attributes to return
      */
-    public ListOperationContext( CoreSession session, DN dn, AliasDerefMode aliasDerefMode,
-        Set<AttributeTypeOptions> returningAttributes )
+    public ListOperationContext( CoreSession session, DN dn, Set<AttributeTypeOptions>
returningAttributes )
     {
         super( session, dn, returningAttributes );
-        this.aliasDerefMode = aliasDerefMode;
     }
 
 

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java?rev=918968&r1=918967&r2=918968&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
(original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
Thu Mar  4 12:38:23 2010
@@ -445,8 +445,11 @@
         Set<AttributeTypeOptions> returningAttributes ) throws Exception
     {
         OperationManager operationManager = directoryService.getOperationManager();
-        return operationManager.list( 
-            new ListOperationContext( this, dn, aliasDerefMode, returningAttributes ) );
+        
+        ListOperationContext listOperationContext = new ListOperationContext( this, dn, returningAttributes
);
+        listOperationContext.setAliasDerefMode( aliasDerefMode );
+        
+        return operationManager.list( listOperationContext );
     }
 
 
@@ -456,11 +459,14 @@
     public EntryFilteringCursor list( DN dn, AliasDerefMode aliasDerefMode,
         Set<AttributeTypeOptions> returningAttributes, int sizeLimit, int timeLimit
) throws Exception
     {
-        ListOperationContext opContext = new ListOperationContext( this, dn, aliasDerefMode,
returningAttributes );
-        opContext.setSizeLimit( sizeLimit );
-        opContext.setTimeLimit( timeLimit );
         OperationManager operationManager = directoryService.getOperationManager();
-        return operationManager.list( opContext );
+
+        ListOperationContext listOperationContext = new ListOperationContext( this, dn, returningAttributes
);
+        listOperationContext.setSizeLimit( sizeLimit );
+        listOperationContext.setTimeLimit( timeLimit );
+        listOperationContext.setAliasDerefMode( aliasDerefMode );
+     
+        return operationManager.list( listOperationContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java?rev=918968&r1=918967&r2=918968&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
Thu Mar  4 12:38:23 2010
@@ -445,8 +445,11 @@
         Set<AttributeTypeOptions> returningAttributes ) throws Exception
     {
         OperationManager operationManager = directoryService.getOperationManager();
-        return operationManager.list( 
-            new ListOperationContext( this, dn, aliasDerefMode, returningAttributes ) );
+
+        ListOperationContext listOperationContext = new ListOperationContext( this, dn, returningAttributes
);
+        listOperationContext.setAliasDerefMode( aliasDerefMode );
+        
+        return operationManager.list( listOperationContext );
     }
 
 
@@ -456,11 +459,14 @@
     public EntryFilteringCursor list( DN dn, AliasDerefMode aliasDerefMode,
         Set<AttributeTypeOptions> returningAttributes, int sizeLimit, int timeLimit
) throws Exception
     {
-        ListOperationContext opContext = new ListOperationContext( this, dn, aliasDerefMode,
returningAttributes );
-        opContext.setSizeLimit( sizeLimit );
-        opContext.setTimeLimit( timeLimit );
         OperationManager operationManager = directoryService.getOperationManager();
-        return operationManager.list( opContext );
+
+        ListOperationContext listOperationContext = new ListOperationContext( this, dn, returningAttributes
);
+        listOperationContext.setSizeLimit( sizeLimit );
+        listOperationContext.setTimeLimit( timeLimit );
+        listOperationContext.setAliasDerefMode( aliasDerefMode );
+        
+        return operationManager.list( listOperationContext );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java?rev=918968&r1=918967&r2=918968&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchParams.java
Thu Mar  4 12:38:23 2010
@@ -23,6 +23,7 @@
 import java.util.Set;
 
 import javax.naming.NamingException;
+import javax.naming.directory.SearchControls;
 
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.control.Control;
@@ -49,10 +50,10 @@
     private SearchScope scope = SearchScope.OBJECT;
     
     /** The time limit. Default to 0 (infinite) */
-    private int timeLimit = 0;
+    private long timeLimit = 0;
     
     /** The size limit. Default to 0 (infinite) */
-    private int sizeLimit = 0;
+    private long sizeLimit = 0;
     
     /** If we should return only types. Default to false */
     private boolean typesOnly = false;
@@ -102,7 +103,7 @@
     /**
      * @return the timeLimit
      */
-    public int getTimeLimit()
+    public long getTimeLimit()
     {
         return timeLimit;
     }
@@ -120,7 +121,7 @@
     /**
      * @return the sizeLimit
      */
-    public int getSizeLimit()
+    public long getSizeLimit()
     {
         return sizeLimit;
     }
@@ -129,7 +130,7 @@
     /**
      * @param sizeLimit the sizeLimit to set
      */
-    public void setSizeLimit( int sizeLimit )
+    public void setSizeLimit( long sizeLimit )
     {
         this.sizeLimit = sizeLimit;
     }
@@ -270,6 +271,20 @@
     }
     
     
+    public static SearchParams toSearchParams( SearchControls searchControls, AliasDerefMode
aliasDerefMode )
+    {
+        SearchParams searchParams = new SearchParams();
+        
+        searchParams.setAliasDerefMode( aliasDerefMode );
+        searchParams.setTimeLimit( searchControls.getTimeLimit() );
+        searchParams.setSizeLimit( searchControls.getCountLimit() );
+        searchParams.setScope( SearchScope.getSearchScope( searchControls.getSearchScope()
) );
+        searchParams.setTypesOnly( searchControls.getReturningObjFlag() );
+        return searchParams;
+    }
+    
+    
+    
     /**
      * {@inheritDoc}
      */



Mime
View raw message