directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r894391 - in /directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core: annotations/DSBuilder.java factory/DSBuilderAnnotationProcessor.java factory/DefaultDirectoryServiceFactory.java
Date Tue, 29 Dec 2009 13:54:52 GMT
Author: kayyagari
Date: Tue Dec 29 13:54:51 2009
New Revision: 894391

URL: http://svn.apache.org/viewvc?rev=894391&view=rev
Log:
o modified the way a DirectoryService instance is created in the factory
o added two more config options to DSBuilder

Modified:
    directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java
    directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSBuilderAnnotationProcessor.java
    directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java

Modified: directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java?rev=894391&r1=894390&r2=894391&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/annotations/DSBuilder.java
Tue Dec 29 13:54:51 2009
@@ -40,4 +40,10 @@
     
     /** The DS name */
     String name() default "defaultDS";
+    
+    /** flag to enable/disable access control, default is false */
+    boolean enableAccessControl() default false;
+    
+    /** flag to enable/disable anonymous access, default is false */
+    boolean allowAnonAccess() default false;
 }

Modified: directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSBuilderAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSBuilderAnnotationProcessor.java?rev=894391&r1=894390&r2=894391&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSBuilderAnnotationProcessor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSBuilderAnnotationProcessor.java
Tue Dec 29 13:54:51 2009
@@ -32,9 +32,12 @@
                 LOG.debug( "Starting DS {}...", dsBuilder.name() );
                 Class<?> factory = dsBuilder.factory();
                 DirectoryServiceFactory dsf = ( DirectoryServiceFactory ) factory.newInstance();
-                dsf.init( dsBuilder.name() );
                 
                 DirectoryService service = dsf.getDirectoryService();
+                service.setAccessControlEnabled( dsBuilder.enableAccessControl() );
+                service.setAllowAnonymousAccess( dsBuilder.allowAnonAccess() );
+                
+                dsf.init( dsBuilder.name() );
                 
                 return service;
             }

Modified: directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java?rev=894391&r1=894390&r2=894391&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
Tue Dec 29 13:54:51 2009
@@ -61,6 +61,21 @@
      */
     public static final DirectoryServiceFactory DEFAULT = new DefaultDirectoryServiceFactory();
 
+    /* default access */ DefaultDirectoryServiceFactory()
+    {
+        try
+        {
+            // creating the instance here so that
+            // we we can set some properties like accesscontrol, anon access
+            // before starting up the service
+            directoryService = new DefaultDirectoryService();
+        }
+        catch( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+    }
+    
     
     public void init( String name ) throws Exception
     {
@@ -69,7 +84,6 @@
             return;
         }
 
-        directoryService = new DefaultDirectoryService();
         build( name );
     }
     



Mime
View raw message