directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1064233 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/
Date Thu, 27 Jan 2011 17:55:04 GMT
Author: elecharny
Date: Thu Jan 27 17:55:03 2011
New Revision: 1064233

URL: http://svn.apache.org/viewvc?rev=1064233&view=rev
Log:
o Made the LdapResultDecorator an implementation of LdapResult
o Removed getLdapResult() from AddResponse, BindResponse, CompareResponse
o Made the CompareReq/Resp implements the interface

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindResponseDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareRequestDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareResponseDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java?rev=1064233&r1=1064232&r2=1064233&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java
Thu Jan 27 17:55:03 2011
@@ -21,7 +21,6 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.model.message.AddResponse;
-import org.apache.directory.shared.ldap.model.message.LdapResult;
 
 
 /**
@@ -80,15 +79,6 @@ public class AddResponseDecorator extend
     /**
      * {@inheritDoc}
      */
-    public LdapResult getLdapResult()
-    {
-        return getAddResponse().getLdapResult();
-    }
-    
-    
-    /**
-     * {@inheritDoc}
-     */
     public String toString()
     {
         return getAddResponse().toString();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindResponseDecorator.java?rev=1064233&r1=1064232&r2=1064233&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindResponseDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindResponseDecorator.java
Thu Jan 27 17:55:03 2011
@@ -21,7 +21,6 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.model.message.BindResponse;
-import org.apache.directory.shared.ldap.model.message.LdapResult;
 
 
 /**
@@ -80,15 +79,6 @@ public class BindResponseDecorator exten
     /**
      * {@inheritDoc}
      */
-    public LdapResult getLdapResult()
-    {
-        return getBindResponse().getLdapResult();
-    }
-    
-    
-    /**
-     * {@inheritDoc}
-     */
     public byte[] getServerSaslCreds()
     {
         return getBindResponse().getServerSaslCreds();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareRequestDecorator.java?rev=1064233&r1=1064232&r2=1064233&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareRequestDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareRequestDecorator.java
Thu Jan 27 17:55:03 2011
@@ -20,7 +20,12 @@
 package org.apache.directory.shared.ldap.codec.decorators;
 
 
+import org.apache.directory.shared.ldap.model.entry.Value;
+import org.apache.directory.shared.ldap.model.message.AbandonListener;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
+import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
+import org.apache.directory.shared.ldap.model.message.ResultResponse;
+import org.apache.directory.shared.ldap.model.name.Dn;
 
 
 /**
@@ -28,7 +33,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CompareRequestDecorator extends MessageDecorator
+public class CompareRequestDecorator extends MessageDecorator implements CompareRequest
 {
     /** The bytes of the attribute id used in the comparison */
     private byte[] attrIdBytes;
@@ -143,4 +148,133 @@ public class CompareRequestDecorator ext
     {
         this.attrValBytes = attrValBytes;
     }
+
+
+    //-------------------------------------------------------------------------
+    // The CompareRequest methods
+    //-------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
+    public MessageTypeEnum getResponseType()
+    {
+        return getCompareRequest().getResponseType();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ResultResponse getResultResponse()
+    {
+        return getCompareRequest().getResultResponse();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean hasResponse()
+    {
+        return getCompareRequest().hasResponse();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void abandon()
+    {
+        getCompareRequest().abandon();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isAbandoned()
+    {
+        return getCompareRequest().isAbandoned();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addAbandonListener( AbandonListener listener )
+    {
+        getCompareRequest().addAbandonListener( listener );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Dn getName()
+    {
+        return getCompareRequest().getName();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setName( Dn name )
+    {
+        getCompareRequest().setName( name );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Value<?> getAssertionValue()
+    {
+        return getCompareRequest().getAssertionValue();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setAssertionValue( String value )
+    {
+        getCompareRequest().setAssertionValue( value );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setAssertionValue( byte[] value )
+    {
+        getCompareRequest().setAssertionValue( value );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getAttributeId()
+    {
+        return getCompareRequest().getAttributeId();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setAttributeId( String attrId )
+    {
+        getCompareRequest().setAttributeId( attrId );
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        return getCompareRequest().toString();
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareResponseDecorator.java?rev=1064233&r1=1064232&r2=1064233&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareResponseDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/CompareResponseDecorator.java
Thu Jan 27 17:55:03 2011
@@ -28,7 +28,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CompareResponseDecorator extends ResponseDecorator
+public class CompareResponseDecorator extends ResponseDecorator implements CompareResponse
 {
     /** The encoded compareResponse length */
     private int compareResponseLength;
@@ -71,4 +71,25 @@ public class CompareResponseDecorator ex
     {
         return compareResponseLength;
     }
+
+
+    //-------------------------------------------------------------------------
+    // The CompareResponse methods
+    //-------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isTrue()
+    {
+        return getCompareResponse().isTrue();
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        return getCompareResponse().toString();
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java?rev=1064233&r1=1064232&r2=1064233&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java
Thu Jan 27 17:55:03 2011
@@ -21,6 +21,9 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.model.message.LdapResult;
+import org.apache.directory.shared.ldap.model.message.Referral;
+import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.model.name.Dn;
 
 
 /**
@@ -28,7 +31,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapResultDecorator
+public class LdapResultDecorator implements LdapResult
 {
     /** The decorated LdapResult */
     private final LdapResult decoratedLdapResult;
@@ -97,4 +100,97 @@ public class LdapResultDecorator
     {
         return matchedDnBytes;
     }
+
+
+    //-------------------------------------------------------------------------
+    // The LdapResult methods
+    //-------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
+    public ResultCodeEnum getResultCode()
+    {
+        return decoratedLdapResult.getResultCode();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setResultCode( ResultCodeEnum resultCode )
+    {
+        decoratedLdapResult.setResultCode( resultCode );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Dn getMatchedDn()
+    {
+        return decoratedLdapResult.getMatchedDn();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setMatchedDn( Dn dn )
+    {
+        decoratedLdapResult.setMatchedDn( dn );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getErrorMessage()
+    {
+        return decoratedLdapResult.getErrorMessage();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setErrorMessage( String errorMessage )
+    {
+        decoratedLdapResult.setErrorMessage( errorMessage );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isReferral()
+    {
+        return decoratedLdapResult.isReferral();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Referral getReferral()
+    {
+        return decoratedLdapResult.getReferral();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setReferral( Referral referral )
+    {
+        decoratedLdapResult.setReferral( referral );
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        return decoratedLdapResult.toString();
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java?rev=1064233&r1=1064232&r2=1064233&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java
Thu Jan 27 17:55:03 2011
@@ -20,7 +20,9 @@
 package org.apache.directory.shared.ldap.codec.decorators;
 
 
+import org.apache.directory.shared.ldap.model.message.LdapResult;
 import org.apache.directory.shared.ldap.model.message.Message;
+import org.apache.directory.shared.ldap.model.message.ResultResponse;
 
 
 /**
@@ -28,7 +30,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class ResponseDecorator extends MessageDecorator
+public abstract class ResponseDecorator extends MessageDecorator implements ResultResponse
 {
     /** The LdapResult decorator */
     private LdapResultDecorator ldapResultDecorator;
@@ -48,7 +50,7 @@ public abstract class ResponseDecorator 
     /**
      * @return the ldapResultDecorator
      */
-    public LdapResultDecorator getLdapResultDecorator()
+    public LdapResult getLdapResult()
     {
         return ldapResultDecorator;
     }



Mime
View raw message