/*
 *  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.entry;



import org.apache.directory.shared.ldap.entry.Entry;
import org.apache.directory.shared.ldap.name.DN;

/**
 * Creates a wrapper around a SearchResult object so that we can use the DN
 * instead of parser it over and over
 *
 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
 */
public class ServerSearchResult
{
    /** Distinguished name for this result */
    private DN dn;
    
    /** The associated entry */
    private Entry serverEntry;
    
    /** Tells if the name is relative to the target context */
    private boolean isRelative;
    
    /** The bound object */
    private Object object;
    

    public ServerSearchResult( DN dn, Object obj, Entry serverEntry )
    {
        this.dn = dn;
        this.serverEntry = serverEntry;
        this.serverEntry.setDn( dn );
    }


    public ServerSearchResult( DN dn, Object obj, Entry serverEntry, boolean isRelative )
    {
        this.dn = dn;
        this.serverEntry = serverEntry;
        this.serverEntry.setDn( dn );
        this.isRelative = isRelative;
    }


    public ServerSearchResult( DN dn, String className, Object obj, Entry serverEntry )
    {
        this.dn = dn;
        this.serverEntry = serverEntry;
        this.serverEntry.setDn( dn );
    }


    public ServerSearchResult( DN dn, String className, Object obj, Entry serverEntry, boolean isRelative ) 
    {
        this.dn = dn;
        this.serverEntry = serverEntry;
        this.serverEntry.setDn( dn );
    }


    /**
     * @return The result DN
     */
    public DN getDn()
    {
        return dn;
    }
    
    
    /**
     * @return The entry
     */
    public Entry getServerEntry()
    {
        return serverEntry;
    }


    public boolean isRelative() 
    {
        return isRelative;
    }


    public void setRelative( boolean isRelative ) 
    {
        this.isRelative = isRelative;
    }


    public void setServerEntry( Entry serverEntry ) 
    {
        this.serverEntry = serverEntry;
    }


    public Object getObject() 
    {
        return object;
    }


    public void setObject( Object object ) 
    {
        this.object = object;
    }
    
    
    /**
     * @see Object#toString()
     */
    public String toString()
    {
        String name = (dn == null ? "null" : ( dn == DN.EMPTY_DN ? "\"\"" : dn.getName() ) );
        return "ServerSearchResult : " + name + "\n" + serverEntry;
    }
}

@@ -1527,187 +1527,264 @@
     
-public ServerSearchResult( DN dn, Object obj, Entry serverEntry )%0A    %7B%0A        this.dn = dn;%0A        this.serverEntry = serverE
+/**%0A     * %0A     * Creates a new instance of ServerSearchResult.%0A     *%0A     * @param dn Distinguished name for this result%0A     * @param serverEntry The associated e
 ntry
-;
+ 
 %0A     
-   this.serverEntry.setDn( dn );
+* @param isRelative Tells if the name is relative to the target context
 %0A    
-%7D%0A%0A
+ */
 %0A   
@@ -1817,28 +1817,16 @@
 ( DN dn,
- Object obj,
  Entry s
@@ -2018,205 +2018,186 @@
     
-public ServerSearchResult( DN dn, String className, Object obj, Entry serverEntry )
+/**%0A     * %0A     * Creates a new instance of ServerSearchResult.
 %0A    
-%7B
+ *
 %0A     
-   this.dn = dn;%0A        this.serverEntry = serverEntry;%0A        this.serverEntry.setDn( dn );
+* @param dn Distinguished name for this result%0A     * @param serverEntry The associated entry
 %0A    
-%7D%0A%0A
+ */
 %0A   
@@ -2235,75 +2235,25 @@
 dn, 
-String className, Object obj, Entry serverEntry, boolean isRelative
+Entry serverEntry
  ) %0A

Remove unused parameters from constructors