directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1067560 - in /directory: shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/ shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ studio/branches/m1/plugins/ldapbrowse...
Date Sun, 06 Feb 2011 01:02:25 GMT
Author: akarasulu
Date: Sun Feb  6 01:02:24 2011
New Revision: 1067560

URL: http://svn.apache.org/viewvc?rev=1067560&view=rev
Log:
DIRSHARED-80:

  o preparing all these dsml response classes to soon be the decorator
  o eventually we will remove all dependencies on the codec by not reusing
    it's decorators

Added:
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BindResponseDsml.java
      - copied, changed from r1067553, directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java
Removed:
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java
Modified:
    directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResultDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
    directory/studio/branches/m1/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java

Modified: directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
(original)
+++ directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
Sun Feb  6 01:02:24 2011
@@ -31,7 +31,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
 import org.apache.directory.shared.dsmlv2.reponse.AddResponseDsml;
-import org.apache.directory.shared.dsmlv2.reponse.AuthResponseDsml;
+import org.apache.directory.shared.dsmlv2.reponse.BindResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.BatchResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.CompareResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.DelResponseDsml;
@@ -330,7 +330,7 @@ public class Dsmlv2Engine
 
             case BIND_REQUEST:
                 BindResponse bindResponse = connection.bind( ( BindRequest ) request );
-                AuthResponseDsml authResponseDsml = new AuthResponseDsml( connection.getCodecService(),
bindResponse );
+                BindResponseDsml authResponseDsml = new BindResponseDsml( connection.getCodecService(),
bindResponse );
                 batchResponse.addResponse( authResponseDsml );
 
                 break;

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java
Sun Feb  6 01:02:24 2011
@@ -29,7 +29,8 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractResponseDsml<E extends Response> extends AbstractDsmlMessageDecorator<E>
implements Response
+public abstract class AbstractResponseDsml<E extends Response> 
+    extends AbstractDsmlMessageDecorator<E> implements Response
 {
     /**
      * Instantiates a new abstract DSML response.

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java
Sun Feb  6 01:02:24 2011
@@ -32,7 +32,7 @@ import org.dom4j.Element;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public abstract class AbstractResultResponseDsml<E extends ResultResponse> 
-    extends AbstractResponseDsml<ResultResponse> implements ResultResponse
+    extends AbstractResponseDsml<E> implements ResultResponse
 {
     /**
      * Instantiates a new abstract DSML response.

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java
Sun Feb  6 01:02:24 2011
@@ -33,7 +33,8 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddResponseDsml extends AbstractResultResponseDsml<AddResponse>
+public class AddResponseDsml extends AbstractResultResponseDsml<AddResponse> 
+    implements AddResponse
 {
     /**
      * Creates a new getDecoratedMessage() of AddResponseDsml.

Copied: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BindResponseDsml.java
(from r1067553, directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BindResponseDsml.java?p2=directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BindResponseDsml.java&p1=directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java&r1=1067553&r2=1067560&rev=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BindResponseDsml.java
Sun Feb  6 01:02:24 2011
@@ -17,14 +17,12 @@
  *  under the License. 
  *  
  */
-
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
 import org.apache.directory.shared.ldap.model.message.BindResponseImpl;
-import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.dom4j.Element;
 
 
@@ -33,12 +31,12 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AuthResponseDsml extends AbstractResultResponseDsml<BindResponse>
+public class BindResponseDsml extends AbstractResultResponseDsml<BindResponse> implements
BindResponse
 {
     /**
      * Creates a new getDecoratedMessage() of AuthResponseDsml.
      */
-    public AuthResponseDsml( LdapCodecService codec )
+    public BindResponseDsml( LdapCodecService codec )
     {
         super( codec, new BindResponseImpl() );
     }
@@ -50,7 +48,7 @@ public class AuthResponseDsml extends Ab
      * @param ldapMessage
      *      the message to decorate
      */
-    public AuthResponseDsml( LdapCodecService codec, BindResponse ldapMessage )
+    public BindResponseDsml( LdapCodecService codec, BindResponse ldapMessage )
     {
         super( codec, ldapMessage );
     }
@@ -59,22 +57,31 @@ public class AuthResponseDsml extends Ab
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getType()
+    public Element toDsml( Element root )
     {
-        return getDecorated().getType();
+        Element element = root.addElement( "authResponse" );
+
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), 
+            getDecorated().getLdapResult(), getDecorated() );
+        ldapResultDsml.toDsml( element );
+        return element;
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public Element toDsml( Element root )
+    public byte[] getServerSaslCreds()
     {
-        Element element = root.addElement( "authResponse" );
+        return getDecorated().getServerSaslCreds();
+    }
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( getCodecService(), 
-            getDecorated().getLdapResult(), getDecorated() );
-        ldapResultDsml.toDsml( element );
-        return element;
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setServerSaslCreds( byte[] serverSaslCreds )
+    {
+        getDecorated().setServerSaslCreds( serverSaslCreds );
     }
 }

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.java
Sun Feb  6 01:02:24 2011
@@ -33,7 +33,7 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CompareResponseDsml extends AbstractResultResponseDsml<CompareResponse>
+public class CompareResponseDsml extends AbstractResultResponseDsml<CompareResponse>
implements CompareResponse
 {
     /**
      * Creates a new getDecoratedMessage() of CompareResponseDsml.
@@ -77,4 +77,13 @@ public class CompareResponseDsml extends
         ldapResultDsml.toDsml( element );
         return element;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isTrue()
+    {
+        return getDecorated().isTrue();
+    }
 }

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java
Sun Feb  6 01:02:24 2011
@@ -34,6 +34,7 @@ import org.dom4j.Element;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class DelResponseDsml extends AbstractResultResponseDsml<DeleteResponse>
+    implements DeleteResponse
 {
     /**
      * Creates a new getDecoratedMessage() of DelResponseDsml.

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
Sun Feb  6 01:02:24 2011
@@ -17,7 +17,6 @@
  *  under the License. 
  *  
  */
-
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
@@ -39,7 +38,11 @@ import org.dom4j.QName;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ExtendedResponseDsml extends AbstractResultResponseDsml<ExtendedResponse>
+    implements ExtendedResponse
 {
+    private static final long serialVersionUID = -3989420095112650346L;
+
+
     /**
      * Creates a new getDecoratedMessage() of ExtendedResponseDsml.
      */
@@ -124,7 +127,7 @@ public class ExtendedResponseDsml extend
      */
     public String getResponseName()
     {
-        return ( ( ExtendedResponse ) getDecorated() ).getResponseName();
+        return getDecorated().getResponseName();
     }
 
 
@@ -135,7 +138,7 @@ public class ExtendedResponseDsml extend
      */
     public void setResponseName( OID responseName )
     {
-        ( ( ExtendedResponse ) getDecorated() ).setResponseName( responseName.toString()
);
+        getDecorated().setResponseName( responseName.toString() );
     }
 
 
@@ -144,9 +147,9 @@ public class ExtendedResponseDsml extend
      * 
      * @return Returns the response.
      */
-    public Object getResponseValue()
+    public byte[] getResponseValue()
     {
-        return ( ( ExtendedResponse ) getDecorated() ).getResponseValue();
+        return getDecorated().getResponseValue();
     }
 
 
@@ -157,6 +160,33 @@ public class ExtendedResponseDsml extend
      */
     public void setResponseValue( byte[] response )
     {
-        ( ( ExtendedResponse ) getDecorated() ).setResponseValue( response );
+        getDecorated().setResponseValue( response );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getID()
+    {
+        return getDecorated().getID();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public byte[] getEncodedValue()
+    {
+        return getDecorated().getEncodedValue();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setResponseName( String oid )
+    {
+        getDecorated().setResponseName( oid );
     }
-}
+}
\ No newline at end of file

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResultDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResultDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResultDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResultDsml.java
Sun Feb  6 01:02:24 2011
@@ -41,7 +41,7 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapResultDsml implements DsmlDecorator<LdapResult>
+public class LdapResultDsml implements DsmlDecorator<LdapResult>, LdapResult
 {
     /** The LDAP Result to decorate */
     private LdapResult result;
@@ -153,9 +153,9 @@ public class LdapResultDsml implements D
      * 
      * @return Returns the matchedDN.
      */
-    public String getMatchedDn()
+    public Dn getMatchedDn()
     {
-        return result.getMatchedDn().getName();
+        return result.getMatchedDn();
     }
 
 
@@ -221,4 +221,31 @@ public class LdapResultDsml implements D
     {
         return result;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isReferral()
+    {
+        return getDecorated().isReferral();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Referral getReferral()
+    {
+        return getDecorated().getReferral();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setReferral( Referral referral )
+    {
+        getDecorated().setReferral( referral );
+    }
 }

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java
Sun Feb  6 01:02:24 2011
@@ -17,7 +17,6 @@
  *  under the License. 
  *  
  */
-
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
@@ -34,6 +33,7 @@ import org.dom4j.Element;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ModDNResponseDsml extends AbstractResultResponseDsml<ModifyDnResponse>
+    implements ModifyDnResponse
 {
     /**
      * Creates a new getDecoratedMessage() of ModDNResponseDsml.

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java
Sun Feb  6 01:02:24 2011
@@ -17,7 +17,6 @@
  *  under the License. 
  *  
  */
-
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
@@ -34,6 +33,7 @@ import org.dom4j.Element;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class ModifyResponseDsml extends AbstractResultResponseDsml<ModifyResponse>
+    implements ModifyResponse
 {
     /**
      * Creates a new getDecoratedMessage() of ModifyResponseDsml.
@@ -77,5 +77,4 @@ public class ModifyResponseDsml extends 
         ldapResultDsml.toDsml( element );
         return element;
     }
-
 }

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java
Sun Feb  6 01:02:24 2011
@@ -33,6 +33,7 @@ import org.dom4j.Element;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class SearchResultDoneDsml extends AbstractResultResponseDsml<SearchResultDone>
+    implements SearchResultDone
 {
     /**
      * Creates a new getDecoratedMessage() of SearchResultDoneDsml.

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
Sun Feb  6 01:02:24 2011
@@ -43,6 +43,7 @@ import org.dom4j.QName;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class SearchResultEntryDsml extends AbstractResponseDsml<SearchResultEntry>
+    implements SearchResultEntry
 {
     /**
      * Creates a new getDecoratedMessage() of SearchResultEntryDsml.
@@ -122,7 +123,7 @@ public class SearchResultEntryDsml exten
      */
     public Dn getObjectName()
     {
-        return ( ( SearchResultEntry ) getDecorated() ).getObjectName();
+        return getDecorated().getObjectName();
     }
 
 
@@ -133,7 +134,7 @@ public class SearchResultEntryDsml exten
      */
     public void setObjectName( Dn objectName )
     {
-        ( ( SearchResultEntry ) getDecorated() ).setObjectName( objectName );
+        getDecorated().setObjectName( objectName );
     }
 
 
@@ -144,7 +145,7 @@ public class SearchResultEntryDsml exten
      */
     public Entry getEntry()
     {
-        return ( ( SearchResultEntry ) getDecorated() ).getEntry();
+        return getDecorated().getEntry();
     }
 
 
@@ -155,7 +156,7 @@ public class SearchResultEntryDsml exten
      */
     public void setEntry( Entry entry )
     {
-        ( ( SearchResultEntry ) getDecorated() ).setEntry( entry );
+        getDecorated().setEntry( entry );
     }
 
 

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
Sun Feb  6 01:02:24 2011
@@ -17,15 +17,15 @@
  *  under the License. 
  *  
  */
-
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
-import java.util.List;
+import java.util.Collection;
 
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
+import org.apache.directory.shared.ldap.model.message.Referral;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
 import org.apache.directory.shared.ldap.model.message.SearchResultReferenceImpl;
 import org.dom4j.Element;
@@ -37,6 +37,7 @@ import org.dom4j.Element;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class SearchResultReferenceDsml extends AbstractResponseDsml<SearchResultReference>
+    implements SearchResultReference
 {
     /**
      * Creates a new getDecoratedMessage() of SearchResultReferenceDsml.
@@ -74,14 +75,11 @@ public class SearchResultReferenceDsml e
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "searchResultReference" );
-        SearchResultReference searchResultReference = ( SearchResultReference ) getDecorated();
 
         // Adding References
-        List<String> refsList = ( List<String> ) searchResultReference.getReferral().getLdapUrls();
-
-        for ( int i = 0; i < refsList.size(); i++ )
+        for ( String url : getDecorated().getReferral().getLdapUrls() )
         {
-            element.addElement( "ref" ).addText( refsList.get( i ).toString() );
+            element.addElement( "ref" ).addText( url );
         }
 
         return element;
@@ -95,7 +93,7 @@ public class SearchResultReferenceDsml e
      */
     public void addSearchResultReference( LdapURL searchResultReference )
     {
-        ( ( SearchResultReference ) getDecorated() ).getReferral().addLdapUrl( searchResultReference.toString()
);
+        getDecorated().getReferral().addLdapUrl( searchResultReference.toString() );
     }
 
 
@@ -104,8 +102,26 @@ public class SearchResultReferenceDsml e
      * 
      * @return An ArrayList of SearchResultReferences
      */
-    public List<String> getSearchResultReferences()
+    public Collection<String> getSearchResultReferences()
+    {
+        return getDecorated().getReferral().getLdapUrls();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Referral getReferral()
+    {
+        return getDecorated().getReferral();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setReferral( Referral referral )
     {
-        return ( List<String> ) ( ( SearchResultReference ) getDecorated() ).getReferral().getLdapUrls();
+        getDecorated().setReferral( referral );
     }
 }

Modified: directory/studio/branches/m1/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/m1/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java?rev=1067560&r1=1067559&r2=1067560&view=diff
==============================================================================
--- directory/studio/branches/m1/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java
(original)
+++ directory/studio/branches/m1/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java
Sun Feb  6 01:02:24 2011
@@ -41,8 +41,8 @@ import org.apache.commons.codec.digest.D
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
 import org.apache.directory.shared.dsmlv2.reponse.AddResponseDsml;
-import org.apache.directory.shared.dsmlv2.reponse.AuthResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.BatchResponseDsml;
+import org.apache.directory.shared.dsmlv2.reponse.BindResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.CompareResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.DelResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.ExtendedResponseDsml;
@@ -331,7 +331,7 @@ public class ImportDsmlRunnable implemen
         // Creating the response
         if ( batchResponseDsml != null )
         {
-            AuthResponseDsml authResponseDsml = new AuthResponseDsml( codec );
+            BindResponseDsml authResponseDsml = new BindResponseDsml( codec );
             LdapResult ldapResult = authResponseDsml.getLdapResult();
             ldapResult.setResultCode( ResultCodeEnum.UNWILLING_TO_PERFORM );
             ldapResult.setErrorMessage( "This kind of request is not yet supported." );



Mime
View raw message