directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1103943 - in /directory/shared/branches/shared-osgi/ldap/codec/standalone: ./ src/main/java/org/apache/directory/shared/ldap/codec/standalone/ src/test/java/org/apache/directory/shared/ldap/codec/osgi/
Date Mon, 16 May 2011 22:53:52 GMT
Author: elecharny
Date: Mon May 16 22:53:52 2011
New Revision: 1103943

URL: http://svn.apache.org/viewvc?rev=1103943&view=rev
Log:
o Added the extra controls refs
o Fixed a dependency

Modified:
    directory/shared/branches/shared-osgi/ldap/codec/standalone/pom.xml
    directory/shared/branches/shared-osgi/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapApiService.java
    directory/shared/branches/shared-osgi/ldap/codec/standalone/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java

Modified: directory/shared/branches/shared-osgi/ldap/codec/standalone/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-osgi/ldap/codec/standalone/pom.xml?rev=1103943&r1=1103942&r2=1103943&view=diff
==============================================================================
--- directory/shared/branches/shared-osgi/ldap/codec/standalone/pom.xml (original)
+++ directory/shared/branches/shared-osgi/ldap/codec/standalone/pom.xml Mon May 16 22:53:52
2011
@@ -60,7 +60,7 @@
     
     <dependency>
       <groupId>${project.groupId}</groupId>
-      <artifactId>shared-ldap-extras-codec-api</artifactId>
+      <artifactId>shared-ldap-extras-codec</artifactId>
     </dependency> 
 
     <dependency>
@@ -82,12 +82,18 @@
               org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeFactory,
               org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,
               org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,
-              org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,
               org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesFactory
             </default.controls>
             <extra.controls>
-              
+              org.apache.directory.shared.ldap.extras.controls.ppolicy.PasswordPolicyFactory,
+              org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,
+              org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,
+              org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncModifyDnFactory,
+              org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,
+              org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory
             </extra.controls>
+            <default.extendedOperations>
+            </default.extendedOperations>
           </systemPropertyVariables>
         </configuration>
       </plugin>

Modified: directory/shared/branches/shared-osgi/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapApiService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-osgi/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapApiService.java?rev=1103943&r1=1103942&r2=1103943&view=diff
==============================================================================
--- directory/shared/branches/shared-osgi/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapApiService.java
(original)
+++ directory/shared/branches/shared-osgi/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapApiService.java
Mon May 16 22:53:52 2011
@@ -85,11 +85,17 @@ public class StandaloneLdapApiService im
     /** The codec's {@link BundleActivator} */
     private CodecHostActivator activator;
     
-    /** The embedded {@link Felix} instance */
-    private Felix felix;
-    
     /** The list of default controls to load at startup */ 
-    private static String DEFAULT_CONTROLS_LIST = "default.controls";
+    public static String DEFAULT_CONTROLS_LIST = "default.controls";
+
+    /** The list of extra controls to load at startup */ 
+    public static String EXTRA_CONTROLS_LIST = "extra.controls";
+
+    /** The list of default controls to load at startup */ 
+    public static String DEFAULT_EXTENDED_OPERATION_LIST = "default.extendedOperations";
+
+    /** The list of extra controls to load at startup */ 
+    public static String EXTRA_EXTENDED_OPERATION_LIST = "extra.extendedOperations";
 
     /**
      * Creates a new instance of StandaloneLdapCodecService. Optionally checks for
@@ -179,7 +185,7 @@ public class StandaloneLdapApiService im
         loadDefaultControls();
         
         // The load the extra controls
-        //loadExtraControls();
+        loadExtraControls();
     }
     
     
@@ -205,6 +211,34 @@ public class StandaloneLdapApiService im
         }
     }
     
+    
+    /**
+     * Loads the extra Controls
+     */
+    private void loadExtraControls() throws Exception
+    {
+        // Load extra from command line properties if it exists
+        String extraControlsList = System.getProperty( EXTRA_CONTROLS_LIST );
+        
+        if ( Strings.isEmpty( extraControlsList ) )
+        {
+            return;
+        }
+        
+        for ( String control : extraControlsList.split( "," ) )
+        {
+            System.out.println( control );
+
+            Class<?>[] types = new Class<?>[] { LdapCodecService.class };
+            Class<? extends ControlFactory<?, ?>> clazz = ( Class<? extends
ControlFactory<?, ?>> )Class.forName( control );
+            Constructor<?> constructor = clazz.getConstructor(types);
+            
+            ControlFactory<?, ?> factory = (ControlFactory<?, ?>)constructor.newInstance(
new Object[]{ this } );
+            controlFactories.put( factory.getOid(), factory );
+            LOG.info( "Registered pre-bundled control factory: {}", factory.getOid() );
+        }
+    }
+    
 
     /**
      * Assembles the <code>org.osgi.framework.system.packages.extra</code> list

Modified: directory/shared/branches/shared-osgi/ldap/codec/standalone/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-osgi/ldap/codec/standalone/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java?rev=1103943&r1=1103942&r2=1103943&view=diff
==============================================================================
--- directory/shared/branches/shared-osgi/ldap/codec/standalone/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java
(original)
+++ directory/shared/branches/shared-osgi/ldap/codec/standalone/src/test/java/org/apache/directory/shared/ldap/codec/osgi/AbstractCodecServiceTest.java
Mon May 16 22:53:52 2011
@@ -46,15 +46,27 @@ public abstract class AbstractCodecServi
     @BeforeClass
     public static void setupLdapApiService() throws Exception
     {
-        System.setProperty( "default.controls", 
+        // Load the extension points
+        System.setProperty( StandaloneLdapApiService.DEFAULT_CONTROLS_LIST, 
             "org.apache.directory.shared.ldap.codec.controls.cascade.CascadeFactory," +
             "org.apache.directory.shared.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,"
+
             "org.apache.directory.shared.ldap.codec.controls.search.entryChange.EntryChangeFactory,"
+
             "org.apache.directory.shared.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,"
+
             "org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,"
+
-            "org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,"
+
             "org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesFactory"
);
 
+        System.setProperty( StandaloneLdapApiService.EXTRA_CONTROLS_LIST, 
+            "org.apache.directory.shared.ldap.extras.controls.ppolicy.PasswordPolicyFactory,"
+
+            "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,"
+
+            "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,"
+
+            "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncModifyDnFactory,"
+
+            "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,"
+
+            "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory"
);
+        
+        System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_LIST, ""
); 
+
+        System.setProperty( StandaloneLdapApiService.EXTRA_EXTENDED_OPERATION_LIST, "" );

+
         codec = new StandaloneLdapApiService();
         encoder = new LdapEncoder( codec );
     }



Mime
View raw message