You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/04/11 15:19:36 UTC

svn commit: r527483 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyDNServiceContext.java

Author: elecharny
Date: Wed Apr 11 06:19:34 2007
New Revision: 527483

URL: http://svn.apache.org/viewvc?view=rev&rev=527483
Log:
Add a serviceContext for the modifyDn operation

Added:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyDNServiceContext.java

Added: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyDNServiceContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyDNServiceContext.java?view=auto&rev=527483
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyDNServiceContext.java (added)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyDNServiceContext.java Wed Apr 11 06:19:34 2007
@@ -0,0 +1,104 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.interceptor.context;
+
+import org.apache.directory.shared.ldap.name.LdapDN;
+
+/**
+ * A ModifyDN context used for Interceptors. It contains all the informations
+ * needed for the modify DN operation, and used by all the interceptors
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ModifyDNServiceContext extends AbstractServiceContext
+{
+    /** The new DN */
+    private String newDn;
+
+    /** The flag to remove the old DN Attribute  */
+    private boolean delOldDn;
+    
+    /**
+     * 
+     * Creates a new instance of ModifyDNServiceContext.
+     *
+     */
+    public ModifyDNServiceContext()
+    {
+    	super();
+    }
+
+    /**
+     * 
+     * Creates a new instance of ModifyDNServiceContext.
+     *
+     */
+    public ModifyDNServiceContext( LdapDN oldDn, String newDn, boolean delOldDn )
+    {
+        super( oldDn );
+        this.newDn = newDn;
+        this.delOldDn = delOldDn;
+    }
+
+    /**
+     * @return The delete old DN flag
+     */
+	public boolean getDelOldDn() 
+	{
+		return delOldDn;
+	}
+
+	/**
+	 * Set the flag to delete the old DN
+	 * @param delOldDn the flag to set
+	 */
+	public void setDelOldDn( boolean delOldDn ) 
+	{
+		this.delOldDn = delOldDn;
+	}
+
+	/**
+	 * @return The new DN
+	 */
+	public String getNewDn() 
+	{
+		return newDn;
+	}
+
+	/**
+	 * Set the new DN
+	 * @param newDn The new Dn
+	 */
+	public void setNewDn( String newDn ) 
+	{
+		this.newDn = newDn;
+	}
+
+	/**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return "ModifyDNContext for old DN '" + getDn().getUpName() + "'" +
+        ", newDn '" + newDn + "'" +
+        ( delOldDn ? ", delete old Dn" : "" ) ; 
+    }
+}