directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r464020 - in /directory/sandbox/ersiner/apachecon-us06-fr14: ./ src/main/java/apachecon/us06/fr14/spdemo/ src/main/java/apachecon/us06/fr14/triggerdemo/ src/main/resources/
Date Sat, 14 Oct 2006 20:49:24 GMT
Author: ersiner
Date: Sat Oct 14 13:49:23 2006
New Revision: 464020

URL: http://svn.apache.org/viewvc?view=rev&rev=464020
Log:
Almost finalized ApacheCon FR14 presentation material.

Removed:
    directory/sandbox/ersiner/apachecon-us06-fr14/src/main/resources/base.ldif
    directory/sandbox/ersiner/apachecon-us06-fr14/src/main/resources/persons.ldif
Modified:
    directory/sandbox/ersiner/apachecon-us06-fr14/pom.xml
    directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo01.java
    directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo02.java
    directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo03.java
    directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo01.java
    directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo02.java

Modified: directory/sandbox/ersiner/apachecon-us06-fr14/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/ersiner/apachecon-us06-fr14/pom.xml?view=diff&rev=464020&r1=464019&r2=464020
==============================================================================
--- directory/sandbox/ersiner/apachecon-us06-fr14/pom.xml (original)
+++ directory/sandbox/ersiner/apachecon-us06-fr14/pom.xml Sat Oct 14 13:49:23 2006
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <project>
   <modelVersion>4.0.0</modelVersion>
-  <groupId>sp-trigger-demo</groupId>
-  <artifactId>sp-trigger-demo</artifactId>
-  <version>0.1-SNAPSHOT</version>
-  <name>LDAP Stored Procedures and Triggers Demo</name>
+  <groupId>apachecon-us06-fr14</groupId>
+  <artifactId>apachecon-us06-fr14</artifactId>
+  <version>1.0</version>
+  <name>FR14: LDAP Stored Procedures and Triggers Arrive in ApacheDS - Demos</name>
   <packaging>jar</packaging>
   <dependencies>
     <dependency>

Modified: directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo01.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo01.java?view=diff&rev=464020&r1=464019&r2=464020
==============================================================================
--- directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo01.java
(original)
+++ directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo01.java
Sat Oct 14 13:49:23 2006
@@ -18,48 +18,31 @@
 package apachecon.us06.fr14.spdemo;
 
 
-import java.util.Hashtable;
-
 import javax.naming.NamingException;
-import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.shared.ldap.sp.JavaStoredProcedureUtils;
 
 import apachecon.us06.fr14.sp.Greeter;
-
+import apachecon.us06.fr14.tool.ServerTools;
 
 
 /**
- * SPDemo01
+ * ApacheCon US 2006
+ * LDAP Stored Procedures and Triggers Arrive in ApacheDS
+ * SPDemo01: Simple SP Call
  * 
  * @author <a href="mailto:ersiner@apache.org">Ersin Er</a>
  */
 public class SPDemo01
 {
-    private static String host = "localhost";
-    private static int port = 1024;
-
-
-    private static LdapContext connectToServer() throws NamingException
-    {
-        Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port + "/ou=system"
);
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.security.authentication", "simple" );
-        return new InitialLdapContext( env, null );
-    }
-
-
     public static void main( String[] args ) throws NamingException
     {
-        LdapContext ctx = connectToServer();
+        LdapContext ctx = ServerTools.connectToServer();
 
         LdapContext spCtx = ( LdapContext ) ctx.lookup( "ou=Stored Procedures" );
 
-        //JavaStoredProcedureUtils.loadStoredProcedureClass( spCtx, Greeter.class );
+        JavaStoredProcedureUtils.loadStoredProcedureClass( spCtx, Greeter.class );
 
         String spName = Greeter.class.getName() + ".helloWorld";
         Object[] params = new Object[] {};

Modified: directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo02.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo02.java?view=diff&rev=464020&r1=464019&r2=464020
==============================================================================
--- directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo02.java
(original)
+++ directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo02.java
Sat Oct 14 13:49:23 2006
@@ -18,48 +18,31 @@
 package apachecon.us06.fr14.spdemo;
 
 
-import java.util.Hashtable;
-
 import javax.naming.NamingException;
-import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.shared.ldap.sp.JavaStoredProcedureUtils;
 
 import apachecon.us06.fr14.sp.Greeter;
-
+import apachecon.us06.fr14.tool.ServerTools;
 
 
 /**
- * SPDemo02
+ * ApacheCon US 2006
+ * LDAP Stored Procedures and Triggers Arrive in ApacheDS
+ * SPDemo02: SP Call with Parameters and Return Value
  * 
  * @author <a href="mailto:ersiner@apache.org">Ersin Er</a>
  */
 public class SPDemo02
 {
-    private static String host = "localhost";
-    private static int port = 1024;
-
-
-    private static LdapContext connectToServer() throws NamingException
-    {
-        Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port + "/ou=system"
);
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.security.authentication", "simple" );
-        return new InitialLdapContext( env, null );
-    }
-
-
     public static void main( String[] args ) throws NamingException
     {
-        LdapContext ctx = connectToServer();
+        LdapContext ctx = ServerTools.connectToServer();
 
         LdapContext spCtx = ( LdapContext ) ctx.lookup( "ou=Stored Procedures" );
 
-        //JavaStoredProcedureUtils.loadStoredProcedureClass( spCtx, Greeter.class );
+        JavaStoredProcedureUtils.loadStoredProcedureClass( spCtx, Greeter.class );
 
         String spName = Greeter.class.getName() + ".sayHello";
         Object[] params = new Object[] {

Modified: directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo03.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo03.java?view=diff&rev=464020&r1=464019&r2=464020
==============================================================================
--- directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo03.java
(original)
+++ directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/spdemo/SPDemo03.java
Sat Oct 14 13:49:23 2006
@@ -18,10 +18,7 @@
 package apachecon.us06.fr14.spdemo;
 
 
-import java.util.Hashtable;
-
 import javax.naming.NamingException;
-import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -29,35 +26,21 @@
 import org.apache.directory.shared.ldap.sp.LdapContextParameter;
 
 import apachecon.us06.fr14.sp.BulkOperations;
-
+import apachecon.us06.fr14.tool.ServerTools;
 
 
 /**
- * SPDemo03
+ * ApacheCon US 2006
+ * LDAP Stored Procedures and Triggers Arrive in ApacheDS
+ * SPDemo03: Real World SP Usage: LDAP DeleteSubtree 
  * 
  * @author <a href="mailto:ersiner@apache.org">Ersin Er</a>
  */
 public class SPDemo03
 {
-    private static String host = "localhost";
-    private static int port = 1024;
-
-
-    private static LdapContext connectToServer() throws NamingException
-    {
-        Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port + "/ou=system"
);
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.security.authentication", "simple" );
-        return new InitialLdapContext( env, null );
-    }
-
-
     public static void main( String[] args ) throws NamingException
     {
-        LdapContext ctx = connectToServer();
+        LdapContext ctx = ServerTools.connectToServer();
 
         LdapContext spCtx = ( LdapContext ) ctx.lookup( "ou=Stored Procedures" );
 

Modified: directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo01.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo01.java?view=diff&rev=464020&r1=464019&r2=464020
==============================================================================
--- directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo01.java
(original)
+++ directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo01.java
Sat Oct 14 13:49:23 2006
@@ -18,61 +18,38 @@
 package apachecon.us06.fr14.triggerdemo;
 
 
-import java.util.Hashtable;
-
 import javax.naming.NamingException;
-import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.shared.ldap.sp.JavaStoredProcedureUtils;
 import org.apache.directory.shared.ldap.trigger.TriggerUtils;
 
 import apachecon.us06.fr14.sp.BackupUtilities;
-
+import apachecon.us06.fr14.tool.ServerTools;
 
 
 /**
- * Demo utility for Stored Procedures and Triggers.
+ * ApacheCon US 2006
+ * LDAP Stored Procedures and Triggers Arrive in ApacheDS
+ * TriggerDemo01: Entry Triggers
  * 
  * @author <a href="mailto:ersiner@apache.org">Ersin Er</a>
  */
 public class TriggerDemo01
 {
-    private static String host = "localhost";
-    private static int port = 1024;
-
-
-    private static LdapContext connectToServer() throws NamingException
-    {
-        Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port + "/ou=system"
);
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.security.authentication", "simple" );
-        return new InitialLdapContext( env, null );
-    }
-
-
     public static void main( String[] args ) throws NamingException
     {
-        LdapContext ctx = connectToServer();
+        LdapContext ctx = ServerTools.connectToServer();
 
         TriggerUtils.defineTriggerExecutionSpecificPoint( ctx );
         
-        // Load the stored procedure unit which has the stored procedure to be triggered.
         JavaStoredProcedureUtils.loadStoredProcedureClass( ctx, BackupUtilities.class );
 
-        LdapContext entry = ( LdapContext ) ctx.lookup( "ou=Test Entry 01" );
+        LdapContext entry = ( LdapContext ) ctx.lookup( "ou=Test Entry" );
         
-        /**
-         * AFTER Delete CALL "<package>.BackupUtilities.backupDeleted"
-         *      ( $ldapContext "", $name, $operationPrincipal, $deletedEntry );
-         */
         String triggerSpec = "AFTER Delete CALL \"" + BackupUtilities.class.getName() +
             ".backupDeleted\" ( $ldapContext \"\", $name, $operationPrincipal, $deletedEntry
)";
         
         TriggerUtils.loadEntryTriggerSpecification( entry, triggerSpec );
     }
-
 }

Modified: directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo02.java
URL: http://svn.apache.org/viewvc/directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo02.java?view=diff&rev=464020&r1=464019&r2=464020
==============================================================================
--- directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo02.java
(original)
+++ directory/sandbox/ersiner/apachecon-us06-fr14/src/main/java/apachecon/us06/fr14/triggerdemo/TriggerDemo02.java
Sat Oct 14 13:49:23 2006
@@ -18,47 +18,28 @@
 package apachecon.us06.fr14.triggerdemo;
 
 
-import java.util.Hashtable;
-
 import javax.naming.NamingException;
-import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.shared.ldap.sp.JavaStoredProcedureUtils;
 import org.apache.directory.shared.ldap.trigger.TriggerUtils;
 
 import apachecon.us06.fr14.sp.BackupUtilities;
-
+import apachecon.us06.fr14.tool.ServerTools;
 
 
 /**
  * ApacheCon US 2006
  * LDAP Stored Procedures and Triggers Arrive in ApacheDS
- * TriggerDemo02: Prescriptive Triggers.
+ * TriggerDemo02: Prescriptive Triggers
  * 
  * @author <a href="mailto:ersiner@apache.org">Ersin Er</a>
  */
 public class TriggerDemo02
 {
-    private static String host = "localhost";
-    private static int port = 1024;
-
-
-    private static LdapContext connectToServer() throws NamingException
-    {
-        Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port + "/ou=system"
);
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.security.authentication", "simple" );
-        return new InitialLdapContext( env, null );
-    }
-
-
     public static void main( String[] args ) throws NamingException
     {
-        LdapContext ctx = connectToServer();
+        LdapContext ctx = ServerTools.connectToServer();
 
         TriggerUtils.defineTriggerExecutionSpecificPoint( ctx );
         
@@ -71,5 +52,4 @@
 
         TriggerUtils.createTriggerExecutionSubentry( ctx, "triggerSubentry1", subtreeSpec,
triggerSpec );
     }
-    
 }



Mime
View raw message