directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r416998 - in /directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger: ModDNStoredProcedureParameterInjector.java TriggerService.java
Date Sun, 25 Jun 2006 09:09:04 GMT
Author: ersiner
Date: Sun Jun 25 02:09:03 2006
New Revision: 416998

URL: http://svn.apache.org/viewvc?rev=416998&view=rev
Log:
Commiting simple code temporarily. Will work on it very soon.

Added:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java
Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java

Added: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java?rev=416998&view=auto
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java
(added)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/ModDNStoredProcedureParameterInjector.java
Sun Jun 25 02:09:03 2006
@@ -0,0 +1,62 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+
+package org.apache.directory.server.core.trigger;
+
+import java.util.Map;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+
+import org.apache.directory.server.core.invocation.Invocation;
+import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.trigger.StoredProcedureParameter.ModDNStoredProcedureParameter;
+
+
+public class ModDNStoredProcedureParameterInjector extends AbstractStoredProcedureParameterInjector
+{
+    private LdapDN oldName;
+    private String newRn;
+    private boolean deleteOldRn;
+    
+    private Map injectors;
+    
+    public ModDNStoredProcedureParameterInjector( Invocation invocation, LdapDN oldName,
String newRn, boolean deleteOldRn ) 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()
);
+        */
+    }
+
+}

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java?rev=416998&r1=416997&r2=416998&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/trigger/TriggerService.java
Sun Jun 25 02:09:03 2006
@@ -416,6 +416,29 @@
         executeTriggers( afterTriggerSpecs, injector, callerRootCtx );
     }
     
+    /**
+     * TODO: Fill in this method!
+     */
+    /*
+    public void modifyRn( NextInterceptor next, LdapDN normName, String newRn, boolean deleteOldRn
) throws NamingException
+    {
+        // Bypass trigger handling if the service is disabled.
+        if ( !enabled )
+        {
+            next.modifyRn( normName, newRn, deleteOldRn );
+            return;
+        }
+        
+        // Gather supplementary data.
+        Invocation invocation = InvocationStack.getInstance().peek();
+        DirectoryPartitionNexusProxy proxy = invocation.getProxy();
+        Attributes entry = proxy.lookup( normName, DirectoryPartitionNexusProxy.LOOKUP_BYPASS
);
+        LdapDN newName = ( LdapDN ) normName.clone();
+        newName.remove( normName.size() - 1 );
+        newName.add( parseNormalized( newRn ).get( 0 ) );
+    }
+    */
+    
     ////////////////////////////////////////////////////////////////////////////
     // Utility Methods
     ////////////////////////////////////////////////////////////////////////////



Mime
View raw message