directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r191177 - in /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server: exception/ invocation/ normalization/
Date Fri, 17 Jun 2005 17:11:47 GMT
Author: trustin
Date: Fri Jun 17 10:11:46 2005
New Revision: 191177

URL: http://svn.apache.org/viewcvs?rev=191177&view=rev
Log:
Added some hierarchy to invocation package:

* Invocation
  -> EntryInvocation
     -> Add, Delete, Modify, ...
  -> SubtreeInvocation
     -> Search, List, ...

and moved get/setName to EntryInvocation and get/setBaseName to SubtreeInvocation.

Add.normalizedName is renamed to just 'name'.


Added:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/EntryInvocation.java
  (with props)
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/SubtreeInvocation.java
  (with props)
Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/exception/ExceptionService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Add.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Delete.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetMatchedDN.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetSuffix.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/HasEntry.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/IsSuffix.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/List.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Lookup.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/LookupWithAttrIds.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Modify.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyMany.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyRN.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Move.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/MoveAndModifyRN.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Search.java
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/exception/ExceptionService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/exception/ExceptionService.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/exception/ExceptionService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/exception/ExceptionService.java
Fri Jun 17 10:11:46 2005
@@ -80,7 +80,7 @@
     protected void process( NextInterceptor nextInterceptor, Add call ) throws NamingException
     {
         // check if the entry already exists
-        Name normName = call.getNormalizedName();
+        Name normName = call.getName();
         String upName = call.getUserProvidedName();
         if ( nexus.hasEntry( normName ) )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Add.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Add.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Add.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Add.java
Fri Jun 17 10:11:46 2005
@@ -30,29 +30,24 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class Add extends Invocation
+public class Add extends EntryInvocation
 {
     private static final long serialVersionUID = 3258131362430333495L;
 
     private final String userProvidedName;
 
-    private Name normalizedName;
-
     private final Attributes attributes;
 
 
     public Add( String userProvidedName, Name normalizedName, Attributes attributes )
     {
+        super( normalizedName );
+        
         if ( userProvidedName == null )
         {
             throw new NullPointerException( "userProvidedName" );
         }
 
-        if ( normalizedName == null )
-        {
-            throw new NullPointerException( "normalizedName" );
-        }
-
         if ( attributes == null )
         {
             throw new NullPointerException( "attributes" );
@@ -60,8 +55,6 @@
 
         this.userProvidedName = userProvidedName;
 
-        this.normalizedName = normalizedName;
-
         this.attributes = attributes;
     }
 
@@ -72,18 +65,6 @@
     }
 
 
-    public Name getNormalizedName()
-    {
-        return normalizedName;
-    }
-
-
-    public void setNormalizedName( Name normalizedName )
-    {
-        this.normalizedName = normalizedName;
-    }
-
-
     public String getUserProvidedName()
     {
         return userProvidedName;
@@ -92,8 +73,7 @@
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        store.add( userProvidedName, normalizedName, attributes );
-
+        store.add( userProvidedName, getName(), attributes );
         return null;
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Delete.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Delete.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Delete.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Delete.java
Fri Jun 17 10:11:46 2005
@@ -29,40 +29,19 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class Delete extends Invocation
+public class Delete extends EntryInvocation
 {
     private static final long serialVersionUID = 3258134639372677425L;
 
-    private Name name;
-
-
     public Delete( Name name )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-
-        this.name = name;
-    }
-
-
-    public Name getName()
-    {
-        return name;
+        super( name );
     }
 
-
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        store.delete( name );
+        store.delete( getName() );
 
         return null;
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
     }
 }

Added: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/EntryInvocation.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/EntryInvocation.java?rev=191177&view=auto
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/EntryInvocation.java
(added)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/EntryInvocation.java
Fri Jun 17 10:11:46 2005
@@ -0,0 +1,57 @@
+/*
+ *   @(#) $Id$
+ * 
+ *   Copyright 2004 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.ldap.server.invocation;
+
+import javax.naming.Name;
+
+import org.apache.ldap.server.BackingStore;
+
+/**
+ * Represents a method invocation on a single entry in {@link BackingStore}s.
+ * <p/>
+ * This class is abstract, and developers should extend this class to
+ * represent the actual method invocations.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class EntryInvocation extends Invocation
+{
+    private Name name;
+
+    public EntryInvocation( Name name )
+    {
+        setName( name );
+    }
+    
+    public Name getName()
+    {
+        return name;
+    }
+    
+    public void setName( Name name )
+    {
+        if ( name == null )
+        {
+            throw new NullPointerException( "name" );
+        }
+
+        this.name = name;
+    }
+}

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/EntryInvocation.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetMatchedDN.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetMatchedDN.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetMatchedDN.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetMatchedDN.java
Fri Jun 17 10:11:46 2005
@@ -30,24 +30,16 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class GetMatchedDN extends Invocation
+public class GetMatchedDN extends EntryInvocation
 {
     private static final long serialVersionUID = 3834032467559723826L;
 
-    private Name name;
-
     private final boolean normalized;
 
 
     public GetMatchedDN( Name name, boolean normalized )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-
-        this.name = name;
-
+        super( name );
         this.normalized = normalized;
     }
 
@@ -58,20 +50,8 @@
     }
 
 
-    public Name getName()
-    {
-        return name;
-    }
-
-
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        return ( ( PartitionNexus ) store ).getMatchedDn( name, normalized );
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
+        return ( ( PartitionNexus ) store ).getMatchedDn( getName(), isNormalized() );
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetSuffix.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetSuffix.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetSuffix.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/GetSuffix.java
Fri Jun 17 10:11:46 2005
@@ -30,24 +30,16 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class GetSuffix extends Invocation
+public class GetSuffix extends EntryInvocation
 {
     private static final long serialVersionUID = 3256443599162980407L;
 
-    private Name name;
-
     private final boolean normalized;
 
 
     public GetSuffix( Name name, boolean normalized )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-
-        this.name = name;
-
+        super( name );
         this.normalized = normalized;
     }
 
@@ -58,20 +50,8 @@
     }
 
 
-    public Name getName()
-    {
-        return name;
-    }
-
-
     protected Object doExecute( BackingStore store ) throws NamingException
     {
         return ( ( ContextPartition ) store ).getSuffix( normalized );
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/HasEntry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/HasEntry.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/HasEntry.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/HasEntry.java
Fri Jun 17 10:11:46 2005
@@ -29,38 +29,18 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class HasEntry extends Invocation
+public class HasEntry extends EntryInvocation
 {
     private static final long serialVersionUID = 3257850974013240370L;
 
-    private Name name;
-
-
     public HasEntry( Name name )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-
-        this.name = name;
-    }
-
-
-    public Name getName()
-    {
-        return name;
+        super( name );
     }
 
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        return store.hasEntry( name ) ? Boolean.TRUE : Boolean.FALSE;
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
+        return store.hasEntry( getName() ) ? Boolean.TRUE : Boolean.FALSE;
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/IsSuffix.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/IsSuffix.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/IsSuffix.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/IsSuffix.java
Fri Jun 17 10:11:46 2005
@@ -29,38 +29,18 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class IsSuffix extends Invocation
+public class IsSuffix extends EntryInvocation
 {
     private static final long serialVersionUID = 3256723987429273908L;
 
-    private Name name;
-
-
     public IsSuffix( Name name )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-
-        this.name = name;
-    }
-
-
-    public Name getName()
-    {
-        return name;
+        super( name );
     }
 
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        return store.isSuffix( name ) ? Boolean.TRUE : Boolean.FALSE;
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
+        return store.isSuffix( getName() ) ? Boolean.TRUE : Boolean.FALSE;
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/List.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/List.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/List.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/List.java
Fri Jun 17 10:11:46 2005
@@ -29,38 +29,19 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class List extends Invocation
+public class List extends SubtreeInvocation
 {
     private static final long serialVersionUID = 3761971574936776755L;
 
-    private Name baseName;
-
 
     public List( Name baseName )
     {
-        if ( baseName == null )
-        {
-            throw new NullPointerException( "baseName" );
-        }
-
-        this.baseName = baseName;
-    }
-
-
-    public Name getBaseName()
-    {
-        return baseName;
+        super( baseName );
     }
 
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        return store.list( baseName );
-    }
-
-
-    public void setBaseName( Name baseName )
-    {
-        this.baseName = baseName;
+        return store.list( getBaseName() );
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Lookup.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Lookup.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Lookup.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Lookup.java
Fri Jun 17 10:11:46 2005
@@ -29,38 +29,18 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class Lookup extends Invocation
+public class Lookup extends EntryInvocation
 {
     private static final long serialVersionUID = 4049074934456005177L;
 
-    private Name name;
-
-
     public Lookup( Name name )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-
-        this.name = name;
-    }
-
-
-    public Name getName()
-    {
-        return name;
+        super( name );
     }
 
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        return store.lookup( name );
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
+        return store.lookup( getName() );
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/LookupWithAttrIds.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/LookupWithAttrIds.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/LookupWithAttrIds.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/LookupWithAttrIds.java
Fri Jun 17 10:11:46 2005
@@ -29,33 +29,20 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class LookupWithAttrIds extends Invocation
+public class LookupWithAttrIds extends EntryInvocation
 {
     private static final long serialVersionUID = 3257283613060970292L;
 
-    private Name name;
-
     private final String[] attributeIds;
 
 
     public LookupWithAttrIds( Name name, String[] attributeIds )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-        this.name = name;
-
+        super( name );
         this.attributeIds = attributeIds;
     }
 
 
-    public Name getName()
-    {
-        return name;
-    }
-
-
     public String[] getAttributeIds()
     {
         return attributeIds;
@@ -64,12 +51,6 @@
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        return store.lookup( name, attributeIds );
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
+        return store.lookup( getName(), attributeIds );
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Modify.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Modify.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Modify.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Modify.java
Fri Jun 17 10:11:46 2005
@@ -30,12 +30,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class Modify extends Invocation
+public class Modify extends EntryInvocation
 {
     private static final long serialVersionUID = 3258134673732416053L;
 
-    private Name name;
-
     private final int modOp;
 
     private final Attributes attributes;
@@ -43,25 +41,12 @@
 
     public Modify( Name name, int modOp, Attributes attributes )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-
-        this.name = name;
-
+        super( name );
         this.modOp = modOp;
-
         this.attributes = attributes;
     }
 
 
-    public Name getName()
-    {
-        return name;
-    }
-
-
     public int getModOp()
     {
         return modOp;
@@ -76,14 +61,7 @@
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        store.modify( name, modOp, attributes );
-
+        store.modify( getName(), modOp, attributes );
         return null;
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyMany.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyMany.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyMany.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyMany.java
Fri Jun 17 10:11:46 2005
@@ -30,38 +30,24 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ModifyMany extends Invocation
+public class ModifyMany extends EntryInvocation
 {
     private static final long serialVersionUID = 3258695386024915001L;
 
-    private Name name;
-
     private final ModificationItem[] modificationItems;
 
 
     public ModifyMany( Name name, ModificationItem[] modificationItems )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
+        super( name );
         if ( modificationItems == null )
         {
             throw new NullPointerException( "modificationItems" );
         }
-
-        this.name = name;
-
         this.modificationItems = modificationItems;
     }
 
 
-    public Name getName()
-    {
-        return name;
-    }
-
-
     public ModificationItem[] getModificationItems()
     {
         return modificationItems;
@@ -70,14 +56,7 @@
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        store.modify( name, modificationItems );
-
+        store.modify( getName(), modificationItems );
         return null;
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyRN.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyRN.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyRN.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ModifyRN.java
Fri Jun 17 10:11:46 2005
@@ -29,12 +29,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ModifyRN extends Invocation
+public class ModifyRN extends EntryInvocation
 {
     private static final long serialVersionUID = 3257849883007465528L;
 
-    private Name name;
-
     private final String newRelativeName;
 
     private final boolean deleteOldName;
@@ -43,30 +41,18 @@
     public ModifyRN( Name name, String newRelativeName,
                      boolean deleteOldName )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
+        super( name );
 
         if ( newRelativeName == null )
         {
             throw new NullPointerException( "newRelativeName" );
         }
 
-        this.name = name;
-
         this.newRelativeName = newRelativeName;
-
         this.deleteOldName = deleteOldName;
     }
 
 
-    public Name getName()
-    {
-        return name;
-    }
-
-
     public String getNewRelativeName()
     {
         return newRelativeName;
@@ -81,14 +67,7 @@
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        store.modifyRn( name, newRelativeName, deleteOldName );
-
+        store.modifyRn( getName(), newRelativeName, deleteOldName );
         return null;
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Move.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Move.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Move.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Move.java
Fri Jun 17 10:11:46 2005
@@ -29,36 +29,17 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class Move extends Invocation
+public class Move extends EntryInvocation
 {
     private static final long serialVersionUID = 3258132440382978098L;
 
-    private Name name;
-
     private Name newParentName;
 
 
     public Move( Name name, Name newParentName )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-
-        if ( newParentName == null )
-        {
-            throw new NullPointerException( "newParentName" );
-        }
-
-        this.name = name;
-
-        this.newParentName = newParentName;
-    }
-
-
-    public Name getName()
-    {
-        return name;
+        super( name );
+        setNewParentName( newParentName );
     }
 
 
@@ -68,22 +49,20 @@
     }
 
 
-    protected Object doExecute( BackingStore store ) throws NamingException
+    public void setNewParentName( Name newParentName )
     {
-        store.move( name, newParentName );
-
-        return null;
-    }
-
+        if ( newParentName == null )
+        {
+            throw new NullPointerException( "newParentName" );
+        }
 
-    public void setName( Name name )
-    {
-        this.name = name;
+        this.newParentName = newParentName;
     }
 
 
-    public void setNewParentName( Name newParentName )
+    protected Object doExecute( BackingStore store ) throws NamingException
     {
-        this.newParentName = newParentName;
+        store.move( getName(), newParentName );
+        return null;
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/MoveAndModifyRN.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/MoveAndModifyRN.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/MoveAndModifyRN.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/MoveAndModifyRN.java
Fri Jun 17 10:11:46 2005
@@ -29,12 +29,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class MoveAndModifyRN extends Invocation
+public class MoveAndModifyRN extends EntryInvocation
 {
     private static final long serialVersionUID = 3258135751786248245L;
 
-    private Name name;
-
     private Name newParentName;
 
     private final String newRelativeName;
@@ -45,38 +43,32 @@
     public MoveAndModifyRN( Name name, Name newParentName, String newRelativeName,
                             boolean deleteOldName )
     {
-        if ( name == null )
-        {
-            throw new NullPointerException( "name" );
-        }
-        if ( newParentName == null )
-        {
-            throw new NullPointerException( "newParentName" );
-        }
+        super( name );
+        setNewParentName( newParentName );
+
         if ( newRelativeName == null )
         {
             throw new NullPointerException( "newRelativeName" );
         }
 
-        this.name = name;
-
-        this.newParentName = newParentName;
-
         this.newRelativeName = newRelativeName;
-
         this.deleteOldName = deleteOldName;
     }
 
 
-    public Name getName()
+    public Name getNewParentName()
     {
-        return name;
+        return newParentName;
     }
 
 
-    public Name getNewParentName()
+    public void setNewParentName( Name newParentName )
     {
-        return newParentName;
+        if ( newParentName == null )
+        {
+            throw new NullPointerException( "newParentName" );
+        }
+        this.newParentName = newParentName;
     }
 
 
@@ -94,20 +86,7 @@
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        store.move( name, newParentName, newRelativeName, deleteOldName );
-
+        store.move( getName(), newParentName, newRelativeName, deleteOldName );
         return null;
-    }
-
-
-    public void setName( Name name )
-    {
-        this.name = name;
-    }
-
-
-    public void setNewParentName( Name newParentName )
-    {
-        this.newParentName = newParentName;
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Search.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Search.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Search.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/Search.java
Fri Jun 17 10:11:46 2005
@@ -32,12 +32,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class Search extends Invocation
+public class Search extends SubtreeInvocation
 {
     private static final long serialVersionUID = 3258410651234678579L;
 
-    private Name baseName;
-
     private final Map environment;
 
     private final ExprNode filter;
@@ -48,10 +46,7 @@
     public Search( Name baseName, Map environment, ExprNode filters,
                    SearchControls controls )
     {
-        if ( baseName == null )
-        {
-            throw new NullPointerException( "baseName" );
-        }
+        super( baseName );
         if ( environment == null )
         {
             throw new NullPointerException( "environment" );
@@ -65,8 +60,6 @@
             throw new NullPointerException( "controls" );
         }
 
-        this.baseName = baseName;
-
         this.environment = environment;
 
         this.filter = filters;
@@ -75,12 +68,6 @@
     }
 
 
-    public Name getBaseName()
-    {
-        return baseName;
-    }
-
-
     public Map getEnvironment()
     {
         return environment;
@@ -101,12 +88,6 @@
 
     protected Object doExecute( BackingStore store ) throws NamingException
     {
-        return store.search( baseName, environment, filter, controls );
-    }
-
-
-    public void setBaseName( Name baseName )
-    {
-        this.baseName = baseName;
+        return store.search( getBaseName(), environment, filter, controls );
     }
 }

Added: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/SubtreeInvocation.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/SubtreeInvocation.java?rev=191177&view=auto
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/SubtreeInvocation.java
(added)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/SubtreeInvocation.java
Fri Jun 17 10:11:46 2005
@@ -0,0 +1,56 @@
+/*
+ *   @(#) $Id$
+ * 
+ *   Copyright 2004 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.ldap.server.invocation;
+
+import javax.naming.Name;
+
+import org.apache.ldap.server.BackingStore;
+
+/**
+ * Represents a method invocation on a DIT in {@link BackingStore}s.
+ * <p/>
+ * This class is abstract, and developers should extend this class to
+ * represent the actual method invocations.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class SubtreeInvocation extends Invocation
+{
+    private Name baseName;
+
+    public SubtreeInvocation( Name baseName )
+    {
+        setBaseName( baseName );
+    }
+
+    public Name getBaseName()
+    {
+        return baseName;
+    }
+
+    public void setBaseName( Name baseName )
+    {
+        if ( baseName == null )
+        {
+            throw new NullPointerException( "baseName" );
+        }
+        this.baseName = baseName;
+    }
+}

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/SubtreeInvocation.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java?rev=191177&r1=191176&r2=191177&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/normalization/NormalizationService.java
Fri Jun 17 10:11:46 2005
@@ -64,7 +64,7 @@
     {
         synchronized( parser )
         {
-            call.setNormalizedName( parser.parse( call.getNormalizedName().toString() ) );
+            call.setName( parser.parse( call.getName().toString() ) );
         }
 
         super.process( nextInterceptor, call );



Mime
View raw message