directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r539725 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/
Date Sat, 19 May 2007 09:39:23 GMT
Author: ersiner
Date: Sat May 19 02:39:22 2007
New Revision: 539725

URL: http://svn.apache.org/viewvc?view=rev&rev=539725
Log:
Handled missing operation specific paramters for ModifyDN Request.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java?view=diff&rev=539725&r1=539724&r2=539725
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
Sat May 19 02:39:22 2007
@@ -34,14 +34,12 @@
     private LdapDN addedEntryName;
     private Attributes addedEntry;
     
-    private Map injectors;
-    
     public AddStoredProcedureParameterInjector( Invocation invocation, LdapDN addedEntryName,
Attributes addedEntry ) throws NamingException
     {
         super( invocation );
         this.addedEntryName = addedEntryName;
         this.addedEntry = addedEntry;
-        injectors = super.getInjectors();
+        Map injectors = super.getInjectors();
         injectors.put( StoredProcedureParameter.Add_ENTRY.class, $entryInjector );
         injectors.put( StoredProcedureParameter.Add_ATTRIBUTES.class, $attributesInjector
);
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java?view=diff&rev=539725&r1=539724&r2=539725
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
Sat May 19 02:39:22 2007
@@ -38,14 +38,12 @@
     private LdapDN deletedEntryName;
     private Attributes deletedEntry;
     
-    private Map injectors;
-    
     public DeleteStoredProcedureParameterInjector( Invocation invocation, LdapDN deletedEntryName
) throws NamingException
     {
         super( invocation );
         this.deletedEntryName = deletedEntryName;
         this.deletedEntry = getDeletedEntry();
-        injectors = super.getInjectors();
+        Map injectors = super.getInjectors();
         injectors.put( StoredProcedureParameter.Delete_NAME.class, $nameInjector );
         injectors.put( StoredProcedureParameter.Delete_DELETED_ENTRY.class, $deletedEntryInjector
);
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java?view=diff&rev=539725&r1=539724&r2=539725
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
Sat May 19 02:39:22 2007
@@ -26,35 +26,123 @@
 
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter;
 
 
 public class ModifyDNStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
-    private LdapDN oldName;
-    private String newRn;
     private boolean deleteOldRn;
-    
-    private Map injectors;
-    
-    public ModifyDNStoredProcedureParameterInjector( Invocation invocation, boolean deleteOldRn,
+    private LdapDN oldRDN;
+    private LdapDN newRDN;
+    private LdapDN oldSuperiorDN;
+    private LdapDN newSuperiorDN;
+    private LdapDN oldDN;
+    private LdapDN newDN;
+
+	public ModifyDNStoredProcedureParameterInjector( Invocation invocation, boolean deleteOldRn,
         LdapDN oldRDN, LdapDN newRDN, LdapDN oldSuperiorDN, LdapDN newSuperiorDN, LdapDN
oldDN, LdapDN newDN) throws NamingException
     {
         super( invocation );
-        init( oldName, newRn, deleteOldRn );
-    }
-    
-    private void init( LdapDN oldName, String newRn, boolean deleteOldRn ) throws NamingException
-    {
-        this.oldName = oldName;
-        this.newRn = newRn;
         this.deleteOldRn = deleteOldRn;
-        injectors = super.getInjectors();
-        /*
-        injectors.put( ModDNStoredProcedureParameter.ENTRY, $entryInjector.inject() );
-        injectors.put( ModDNStoredProcedureParameter.NEW_RDN, $newRdnInjector.inject() );
-        injectors.put( ModDNStoredProcedureParameter.NEW_SUPERIOR, $newSuperior.inject()
);
-        injectors.put( ModDNStoredProcedureParameter.DELETE_OLD_RDN, $deleteOldRdnInjector.inject()
);
-        */
+		this.oldRDN = oldRDN;
+		this.newRDN = newRDN;
+		this.oldSuperiorDN = oldSuperiorDN;
+		this.newSuperiorDN = newSuperiorDN;
+		this.oldDN = oldDN;
+		this.newDN = newDN;
+		
+		Map<Class, MicroInjector> injectors = super.getInjectors();
+		injectors.put( StoredProcedureParameter.ModifyDN_ENTRY.class, $entryInjector );
+		injectors.put( StoredProcedureParameter.ModifyDN_NEW_RDN.class, $newrdnInjector );
+		injectors.put( StoredProcedureParameter.ModifyDN_DELETE_OLD_RDN.class, $deleteoldrdnInjector
);
+		injectors.put( StoredProcedureParameter.ModifyDN_NEW_SUPERIOR.class, $newSuperiorInjector
);
+		injectors.put( StoredProcedureParameter.ModifyDN_OLD_RDN.class, $oldRDNInjector );
+		injectors.put( StoredProcedureParameter.ModifyDN_OLD_SUPERIOR_DN.class, $oldSuperiorDNInjector
);
+		injectors.put( StoredProcedureParameter.ModifyDN_NEW_DN.class, $newDNInjector );
+		
     }
+	/**
+	 * Injector for 'entry' parameter of ModifyDNRequest as in RFC4511.
+	 */
+	MicroInjector $entryInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( oldDN.getUpName() );
+        };
+    };
 
+    /**
+     * Injector for 'newrdn' parameter of ModifyDNRequest as in RFC4511.
+     */
+    MicroInjector $newrdnInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( newRDN.getUpName() );
+        };
+    };
+    
+    /**
+     * Injector for 'newrdn' parameter of ModifyDNRequest as in RFC4511.
+     */
+    MicroInjector $deleteoldrdnInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new Boolean( deleteOldRn );
+        };
+    };
+    
+    /**
+     * Injector for 'newSuperior' parameter of ModifyDNRequest as in RFC4511.
+     */
+    MicroInjector $newSuperiorInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( newSuperiorDN.getUpName() );
+        };
+    };
+    
+    /**
+     * Extra injector for 'oldRDN' which can be derived from parameters specified for ModifyDNRequest
as in RFC4511.
+     */
+    MicroInjector $oldRDNInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( oldRDN.getUpName() );
+        };
+    };
+    
+    /**
+     * Extra injector for 'oldRDN' which can be derived from parameters specified for ModifyDNRequest
as in RFC4511.
+     */
+    MicroInjector $oldSuperiorDNInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( oldSuperiorDN.getUpName() );
+        };
+    };
+    
+    /**
+     * Extra injector for 'newDN' which can be derived from parameters specified for ModifyDNRequest
as in RFC4511.
+     */
+    MicroInjector $newDNInjector = new MicroInjector()
+    {
+        public Object inject( StoredProcedureParameter param ) throws NamingException
+        {
+            // Return a safe copy constructed with user provided name.
+            return new LdapDN( newDN.getUpName() );
+        };
+    };
+    
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java?view=diff&rev=539725&r1=539724&r2=539725
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
Sat May 19 02:39:22 2007
@@ -37,12 +37,9 @@
 public class ModifyStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
 {
     private LdapDN modifiedEntryName;
-    
     private ModificationItemImpl[] modifications;
-    
     private Attributes oldEntry;
     
-    private Map<Class, MicroInjector> injectors;
     
     public ModifyStoredProcedureParameterInjector( Invocation invocation, OperationContext
opContext ) throws NamingException
     {
@@ -50,7 +47,7 @@
         modifiedEntryName = opContext.getDn();
         modifications = ((ModifyOperationContext)opContext).getModItems();
         this.oldEntry = getEntry();
-        injectors = super.getInjectors();
+        Map<Class, MicroInjector> injectors = super.getInjectors();
         injectors.put( StoredProcedureParameter.Modify_OBJECT.class, $objectInjector );
         injectors.put( StoredProcedureParameter.Modify_MODIFICATION.class, $modificationInjector
);
         injectors.put( StoredProcedureParameter.Modify_OLD_ENTRY.class, $oldEntryInjector
);



Mime
View raw message