directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r555892 - in /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core: sp/ sp/java/ trigger/
Date Fri, 13 Jul 2007 06:49:50 GMT
Author: ersiner
Date: Thu Jul 12 23:49:49 2007
New Revision: 555892

URL: http://svn.apache.org/viewvc?view=rev&rev=555892
Log:
Cleaning up and Javadoc.

Added:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngine.java
      - copied, changed from r555600, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngine.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngineConfig.java
      - copied, changed from r555600, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngineConfig.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/LdapJavaStoredProcClassLoader.java
      - copied, changed from r555600, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapJavaStoredProcClassLoader.java
Removed:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngine.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngineConfig.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapJavaStoredProcClassLoader.java
Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngine.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngineConfig.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcUtils.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngine.java?view=diff&rev=555892&r1=555891&r2=555892
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngine.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngine.java
Thu Jul 12 23:49:49 2007
@@ -25,12 +25,41 @@
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapContext;
 
+
+/**
+ * An abstraction over stored procedure execution depending on the type of the language supported.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$ $Date$
+ */
 public interface StoredProcEngine
 {
+    
+    /**
+     * Returns the unique identifier of the supported stored procedure language.
+     * 
+     */
     public String getSPLangId();
     
+    
+    /**
+     * Registers an entry found to be contaning a stored procedure unit which this engine
can operate on.
+     *
+     * <p>
+     * This method should be called before an attempt to invoke a stored procedure via this
Engine.
+     */
     public void setSPUnitEntry( final Attributes spUnit );
     
-    public Object invokeProcedure( LdapContext rootCtx, String fullSPName, Object[] spArgs
) throws NamingException;
+    
+    /**
+     * Invokes the stored procedure handled by the engine.
+     * 
+     * @param rootDSE A handle on Root DSE to invoke the stored procedure over.
+     * @param fullSPName A fully qualified name of the stored procedure including its unit
name.
+     * @param spArgs A list or arguments to be passed to the stored procedure. It should
be an empty array if there aren't any parameters defined.
+     * @return The value obtained from invoked procedure. The client should know what will
return exactly so that it can downcast to the appropriate type.
+     * @throws NamingException If an error occurs during invocation.
+     */
+    public Object invokeProcedure( LdapContext rootDSE, String fullSPName, Object[] spArgs
) throws NamingException;
 
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngineConfig.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngineConfig.java?view=diff&rev=555892&r1=555891&r2=555892
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngineConfig.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcEngineConfig.java
Thu Jul 12 23:49:49 2007
@@ -21,10 +21,26 @@
 
 package org.apache.directory.server.core.sp;
 
+
+/**
+ * A configuration wrapper for {@link StoredProcEngine}s.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$ $Date$
+ */
 public interface StoredProcEngineConfig
 {
+    /**
+     * Returns the type of the associated {@link StoredProcEngine}.
+     * 
+     */
     public Class<? extends StoredProcEngine> getStoredProcEngineType();
     
+    
+    /**
+     * Returns the unique language identifier of the {@link StoredProcEngine}.
+     * 
+     */
     public String getStoredProcLangId();
 
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java?view=diff&rev=555892&r1=555891&r2=555892
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
Thu Jul 12 23:49:49 2007
@@ -32,40 +32,69 @@
 
 import javax.naming.ldap.LdapContext;
 
-
+/**
+ * A Factory type class which holds a registry of supported {@link StoredProcEngineConfig}s.
A container reference
+ * as the base for Stored Procedure storage on the DIT is also handled by this class.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$ $Date$
+ */
 public class StoredProcExecutionManager
 {
+    
+    private final String storedProcContainer;
 
-    private final String spContainer;
-
-    private final List<StoredProcEngineConfig> spEngineConfigs;
+    private final List<StoredProcEngineConfig> storedProcEngineConfigs;
 
 
-    public StoredProcExecutionManager( final String spContainer, final List<StoredProcEngineConfig>
spEngineConfigs )
+    /**
+     * Creates a {@link StoredProcExecutionManager} instance.
+     * 
+     * @param storedProcContainer The base of the DIT subtree used for storing stored procedure
units.
+     * @param storedProcEngineConfigs A list of {@link StoredProcEngineConfig}s to register
different {@link StoredProcEngine}s with this manager.
+     */
+    public StoredProcExecutionManager( final String storedProcContainer, final List<StoredProcEngineConfig>
storedProcEngineConfigs )
     {
-        this.spContainer = spContainer;
-        this.spEngineConfigs = spEngineConfigs;
+        this.storedProcContainer = storedProcContainer;
+        this.storedProcEngineConfigs = storedProcEngineConfigs;
     }
     
-    public Attributes findStoredProcUnit( LdapContext rootCtx, String fullSPName ) throws
NamingException
+    /**
+     * Finds and returns a stored procedure unit entry whose identifier name
+     * is extracted from fullSPName.
+     * 
+     * @param rootDSE A handle on the root DSE to be used for searching the SP Unit over.
+     * @param fullSPName Full name of the Stored Procedure including the unit name.
+     * @return The entry associated with the SP Unit.
+     * @throws NamingException If the unit cannot be located or any other error occurs.
+     */
+    public Attributes findStoredProcUnit( LdapContext rootDSE, String fullSPName ) throws
NamingException
     {
         SearchControls controls = new SearchControls();
         controls.setReturningAttributes( new String[] { "*" } );
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         String spUnitName = StoredProcUtils.extractStoredProcUnitName( fullSPName );
         String filter = "(storedProcUnitName=" + spUnitName + ")";
-        NamingEnumeration<SearchResult> results = rootCtx.search( spContainer, filter,
controls );
+        NamingEnumeration<SearchResult> results = rootDSE.search( storedProcContainer,
filter, controls );
         Attributes spUnitEntry = results.nextElement().getAttributes();
         return spUnitEntry;
     }
 
 
+    /**
+     * Initializes and returns a {@link StoredProcEngine} instance which can operate on spUnitEntry
+     * considering its specific stored procedure language.
+     * 
+     * @param spUnitEntry The entry which a {@link StoredProcEngine} type will be mathched
with respect to the language identifier.
+     * @return A {@link StoredProcEngine} associated with spUnitEntry.
+     * @throws NamingException If no {@link StoredProcEngine} that can be associated with
the language identifier in spUnitEntry can be found.
+     */
     public StoredProcEngine getStoredProcEngineInstance( Attributes spUnitEntry ) throws
NamingException
     {
 
         String spLangId = ( String ) spUnitEntry.get( "storedProcLangId" ).get();
 
-        for ( StoredProcEngineConfig engineConfig : spEngineConfigs )
+        for ( StoredProcEngineConfig engineConfig : storedProcEngineConfigs )
         {
             if ( engineConfig.getStoredProcLangId().equalsIgnoreCase( spLangId ) )
             {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcUtils.java?view=diff&rev=555892&r1=555891&r2=555892
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcUtils.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcUtils.java
Thu Jul 12 23:49:49 2007
@@ -21,9 +21,17 @@
 
 package org.apache.directory.server.core.sp;
 
+
+/**
+ * A utility class for working with Stored Procedures.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$ $Date$
+ */
 public class StoredProcUtils
 {
     
+    /** The delimiter used to tokenize a full SP name into the unit and SP name */
     public static final String SPUnitDelimiter = ":";
 
     public static String extractStoredProcName( String fullSPName )
@@ -39,4 +47,5 @@
         String className = fullSPName.substring( 0, delimiter );
         return className;
     }
+    
 }

Copied: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngine.java
(from r555600, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngine.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngine.java?view=diff&rev=555892&p1=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngine.java&r1=555600&p2=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngine.java&r2=555892
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngine.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngine.java
Thu Jul 12 23:49:49 2007
@@ -19,7 +19,7 @@
  */
 
 
-package org.apache.directory.server.core.sp;
+package org.apache.directory.server.core.sp.java;
 
 
 import java.lang.reflect.InvocationTargetException;
@@ -32,9 +32,17 @@
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.server.core.sp.StoredProcEngine;
+import org.apache.directory.server.core.sp.StoredProcUtils;
 import org.apache.directory.shared.ldap.util.DirectoryClassUtils;
 
 
+/**
+ * A {@link StoredProcEngine} implementation specific to Java stored procedures.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$ $Date$
+ */
 public class JavaStoredProcEngine implements StoredProcEngine
 {
 
@@ -43,6 +51,9 @@
     private Attributes spUnit;
 
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.sp.StoredProcEngine#invokeProcedure(javax.naming.ldap.LdapContext,
java.lang.String, java.lang.Object[])
+     */
     public Object invokeProcedure( LdapContext rootCtx, String fullSPName, Object[] spArgs
) throws NamingException
     {
         Attribute javaByteCode = spUnit.get( "javaByteCode" );
@@ -100,12 +111,18 @@
     }
 
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.sp.StoredProcEngine#getSPLangId()
+     */
     public String getSPLangId()
     {
         return storedProcLangId;
     }
 
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.sp.StoredProcEngine#setSPUnitEntry(javax.naming.directory.Attributes)
+     */
     public void setSPUnitEntry( Attributes spUnit )
     {
         this.spUnit = spUnit;

Copied: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngineConfig.java
(from r555600, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngineConfig.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngineConfig.java?view=diff&rev=555892&p1=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngineConfig.java&r1=555600&p2=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngineConfig.java&r2=555892
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/JavaStoredProcEngineConfig.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/JavaStoredProcEngineConfig.java
Thu Jul 12 23:49:49 2007
@@ -19,17 +19,33 @@
  */
 
 
-package org.apache.directory.server.core.sp;
+package org.apache.directory.server.core.sp.java;
 
+import org.apache.directory.server.core.sp.StoredProcEngine;
+import org.apache.directory.server.core.sp.StoredProcEngineConfig;
+
+
+/**
+ * A {@link StoredProcEngineConfig} implementation specific to Java stored procedures.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$ $Date$
+ */
 public class JavaStoredProcEngineConfig implements StoredProcEngineConfig
 {
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.sp.StoredProcEngineConfig#getStoredProcEngineType()
+     */
     public Class<? extends StoredProcEngine> getStoredProcEngineType()
     {
         return JavaStoredProcEngine.class;
     }
 
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.sp.StoredProcEngineConfig#getStoredProcLangId()
+     */
     public String getStoredProcLangId()
     {
         return JavaStoredProcEngine.storedProcLangId;

Copied: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/LdapJavaStoredProcClassLoader.java
(from r555600, directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapJavaStoredProcClassLoader.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/LdapJavaStoredProcClassLoader.java?view=diff&rev=555892&p1=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapJavaStoredProcClassLoader.java&r1=555600&p2=directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/LdapJavaStoredProcClassLoader.java&r2=555892
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapJavaStoredProcClassLoader.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/java/LdapJavaStoredProcClassLoader.java
Thu Jul 12 23:49:49 2007
@@ -18,7 +18,7 @@
  *  
  */
 
-package org.apache.directory.server.core.sp;
+package org.apache.directory.server.core.sp.java;
 
 
 import javax.naming.NamingException;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java?view=diff&rev=555892&r1=555891&r2=555892
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
Thu Jul 12 23:49:49 2007
@@ -49,10 +49,10 @@
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
-import org.apache.directory.server.core.sp.JavaStoredProcEngineConfig;
 import org.apache.directory.server.core.sp.StoredProcEngine;
 import org.apache.directory.server.core.sp.StoredProcEngineConfig;
 import org.apache.directory.server.core.sp.StoredProcExecutionManager;
+import org.apache.directory.server.core.sp.java.JavaStoredProcEngineConfig;
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;



Mime
View raw message