directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r440462 - in /directory/sandbox/ersiner/sptriggerdemo/src/main: java/sptriggerdemo/TriggersMainDemo.java resources/base.ldif resources/persons.ldif resources/sptriggerdemo.ldif
Date Tue, 05 Sep 2006 19:54:08 GMT
Author: ersiner
Date: Tue Sep  5 12:54:08 2006
New Revision: 440462

URL: http://svn.apache.org/viewvc?view=rev&rev=440462
Log:
Added a new simple ldif for person entries.
Added TriggerDemo, but may not yet work.

Added:
    directory/sandbox/ersiner/sptriggerdemo/src/main/java/sptriggerdemo/TriggersMainDemo.java
      - copied, changed from r439954, directory/sandbox/ersiner/sptriggerdemo/src/main/java/sptriggerdemo/DemoTool.java
    directory/sandbox/ersiner/sptriggerdemo/src/main/resources/base.ldif
      - copied unchanged from r440196, directory/sandbox/ersiner/sptriggerdemo/src/main/resources/sptriggerdemo.ldif
    directory/sandbox/ersiner/sptriggerdemo/src/main/resources/persons.ldif
Removed:
    directory/sandbox/ersiner/sptriggerdemo/src/main/resources/sptriggerdemo.ldif

Copied: directory/sandbox/ersiner/sptriggerdemo/src/main/java/sptriggerdemo/TriggersMainDemo.java
(from r439954, directory/sandbox/ersiner/sptriggerdemo/src/main/java/sptriggerdemo/DemoTool.java)
URL: http://svn.apache.org/viewvc/directory/sandbox/ersiner/sptriggerdemo/src/main/java/sptriggerdemo/TriggersMainDemo.java?view=diff&rev=440462&p1=directory/sandbox/ersiner/sptriggerdemo/src/main/java/sptriggerdemo/DemoTool.java&r1=439954&p2=directory/sandbox/ersiner/sptriggerdemo/src/main/java/sptriggerdemo/TriggersMainDemo.java&r2=440462
==============================================================================
--- directory/sandbox/ersiner/sptriggerdemo/src/main/java/sptriggerdemo/DemoTool.java (original)
+++ directory/sandbox/ersiner/sptriggerdemo/src/main/java/sptriggerdemo/TriggersMainDemo.java
Tue Sep  5 12:54:08 2006
@@ -24,19 +24,22 @@
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
-import org.apache.directory.shared.ldap.sp.StoredProcedureUtils;
+import org.apache.directory.shared.ldap.sp.JavaStoredProcedureUtils;
 import org.apache.directory.shared.ldap.trigger.TriggerUtils;
 
+import sptriggerdemo.common.Greeter;
+import sptriggerdemo.common.MailingListManager;
+
 
 /**
  * Demo utility for Stored Procedures and Triggers.
  * 
  * @author <a href="mailto:ersiner@apache.org">Ersin Er</a>
  */
-public class DemoTool
+public class TriggersMainDemo
 {
     private static String host = "localhost";
-    private static int port = 10389;
+    private static int port = 1027;
 
 
     private static LdapContext connectToServer() throws NamingException
@@ -60,10 +63,10 @@
 
         // Load the first Stored Procedure with the loader utility
         // which really is there for some abstraction only (no non-standard action inside).

-        StoredProcedureUtils.loadStoredProcedureClass( spCtx, Greeter.class.getName(), DemoTool.class
);
+        JavaStoredProcedureUtils.loadStoredProcedureClass( spCtx, Greeter.class );
 
         // Now, call the Stored Procedure with two arguments and get the response.
-        Object result = StoredProcedureUtils.callStoredProcedure( ctx, Greeter.class.getName()
+ ".sayHello",
+        Object result = JavaStoredProcedureUtils.callStoredProcedure( ctx, Greeter.class.getName()
+ ".sayHello",
             new Object[]
                 { "Ersin", new Integer( 3 ) } );
         System.out.println( "Stored Procedure response: " + result );
@@ -72,7 +75,7 @@
         // then the Stored Procedure test is OK with calling, sending parameters and getting
response.
 
         // Now, load the mailing list manager Stored Procedures for working with Triggers.
-        StoredProcedureUtils.loadStoredProcedureClass( spCtx, MailingListManager.class.getName(),
DemoTool.class );
+        JavaStoredProcedureUtils.loadStoredProcedureClass( spCtx, MailingListManager.class
);
 
         // Specify the subtree refinement for the set of entries
         // which will be handled by the mailing list manager.
@@ -88,9 +91,12 @@
         String triggerSpec2 = "AFTER delete CALL \"" + MailingListManager.class.getName()
             + ".unsubscribeDeletedPersonFromAllLists\" ( $rootDSE, $name )";
 
+        TriggerUtils.createTriggerExecutionSubentry( ctx, "triggerSubentry1", subtreeSpec
);
+        TriggerUtils.createTriggerExecutionSubentry( ctx, "triggerSubentry1", subtreeSpec
);
+        
         // Load both Trigger Specifications within Trigger Subentries.
-        TriggerUtils.loadTriggerSpecification( ctx, "triggerSubentry1", subtreeSpec, triggerSpec1
);
-        TriggerUtils.loadTriggerSpecification( ctx, "triggerSubentry2", subtreeSpec, triggerSpec2
);
+        TriggerUtils.loadPrescriptiveTriggerSpecification( ctx, "triggerSubentry1",   triggerSpec1
);
+        TriggerUtils.loadPrescriptiveTriggerSpecification( ctx, "triggerSubentry2", triggerSpec2
);
 
         System.out.println( "Now, it's time to play with your LDAP client ;-)" );
     }

Added: directory/sandbox/ersiner/sptriggerdemo/src/main/resources/persons.ldif
URL: http://svn.apache.org/viewvc/directory/sandbox/ersiner/sptriggerdemo/src/main/resources/persons.ldif?view=auto&rev=440462
==============================================================================
--- directory/sandbox/ersiner/sptriggerdemo/src/main/resources/persons.ldif (added)
+++ directory/sandbox/ersiner/sptriggerdemo/src/main/resources/persons.ldif Tue Sep  5 12:54:08
2006
@@ -0,0 +1,24 @@
+dn: cn=Jim, ou=Managers, ou=People, ou=system
+objectclass: person
+objectclass: top
+cn: Jim
+sn: Jim
+
+dn: cn=John, ou=Managers, ou=People, ou=system
+objectclass: person
+objectclass: top
+cn: John
+sn: John
+
+dn: cn=Bob, ou=Engineers, ou=People, ou=system
+objectclass: person
+objectclass: top
+cn: Bob
+sn: Bob
+
+dn: cn=Ben, ou=Engineers, ou=People, ou=system
+objectclass: person
+objectclass: top
+cn: Ben
+sn: Ben
+



Mime
View raw message