directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1064224 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators: BindRequestDecorator.java BindResponseDecorator.java
Date Thu, 27 Jan 2011 17:38:20 GMT
Author: elecharny
Date: Thu Jan 27 17:38:19 2011
New Revision: 1064224

URL: http://svn.apache.org/viewvc?rev=1064224&view=rev
Log:
Implementing the BindRequest interface

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindRequestDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindResponseDecorator.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindRequestDecorator.java?rev=1064224&r1=1064223&r2=1064224&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindRequestDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/BindRequestDecorator.java
Thu Jan 27 17:38:19 2011
@@ -20,7 +20,11 @@
 package org.apache.directory.shared.ldap.codec.decorators;
 
 
+import org.apache.directory.shared.ldap.model.message.AbandonListener;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
+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 +32,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BindRequestDecorator extends MessageDecorator
+public class BindRequestDecorator extends MessageDecorator implements BindRequest
 {
     /** The bind request length */
     private int bindRequestLength;
@@ -56,7 +60,7 @@ public class BindRequestDecorator extend
      */
     public BindRequest getBindRequest()
     {
-        return ( BindRequest ) getDecoratedMessage();
+        return getBindRequest();
     }
 
 
@@ -115,4 +119,187 @@ public class BindRequestDecorator extend
     {
         return saslMechanismLength;
     }
+    
+    
+    //-------------------------------------------------------------------------
+    // The BindRequest methods
+    //-------------------------------------------------------------------------
+    /**
+     * {@inheritDoc}
+     */
+    public MessageTypeEnum getResponseType()
+    {
+        return getBindRequest().getResponseType();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ResultResponse getResultResponse()
+    {
+        return getBindRequest().getResultResponse();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean hasResponse()
+    {
+        return getBindRequest().hasResponse();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void abandon()
+    {
+        getBindRequest().abandon();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isAbandoned()
+    {
+        return getBindRequest().isAbandoned();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addAbandonListener( AbandonListener listener )
+    {
+        getBindRequest().addAbandonListener( listener );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isSimple()
+    {
+        return getBindRequest().isSimple();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean getSimple()
+    {
+        return getBindRequest().getSimple();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setSimple( boolean isSimple )
+    {
+        getBindRequest().setSimple( isSimple );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public byte[] getCredentials()
+    {
+        return getBindRequest().getCredentials();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setCredentials( String credentials )
+    {
+        getBindRequest().setCredentials( credentials );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setCredentials( byte[] credentials )
+    {
+        getBindRequest().setCredentials( credentials );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Dn getName()
+    {
+        return getBindRequest().getName();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setName( Dn name )
+    {
+        getBindRequest().setName( name );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isVersion3()
+    {
+        return getBindRequest().isVersion3();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean getVersion3()
+    {
+        return getBindRequest().getVersion3();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setVersion3( boolean isVersion3 )
+    {
+        getBindRequest().setVersion3( isVersion3 );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getSaslMechanism()
+    {
+        return getBindRequest().getSaslMechanism();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setSaslMechanism( String saslMechanism )
+    {
+        getBindRequest().setSaslMechanism( saslMechanism );
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        return getBindRequest().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=1064224&r1=1064223&r2=1064224&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:38:19 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.BindResponseImpl;
 import org.apache.directory.shared.ldap.model.message.LdapResult;
 
 
@@ -83,7 +82,7 @@ public class BindResponseDecorator exten
      */
     public LdapResult getLdapResult()
     {
-        return ((BindResponseImpl)decoratedMessage).getLdapResult();
+        return getBindResponse().getLdapResult();
     }
     
     
@@ -92,7 +91,7 @@ public class BindResponseDecorator exten
      */
     public byte[] getServerSaslCreds()
     {
-        return ((BindResponseImpl)decoratedMessage).getServerSaslCreds();
+        return getBindResponse().getServerSaslCreds();
     }
 
 
@@ -101,7 +100,7 @@ public class BindResponseDecorator exten
      */
     public void setServerSaslCreds( byte[] serverSaslCreds )
     {
-        ((BindResponseImpl)decoratedMessage).setServerSaslCreds( serverSaslCreds );
+        getBindResponse().setServerSaslCreds( serverSaslCreds );
     }
 
     
@@ -110,6 +109,6 @@ public class BindResponseDecorator exten
      */
     public String toString()
     {
-        return ((BindResponseImpl)decoratedMessage).toString();
+        return getBindResponse().toString();
     }
 }



Mime
View raw message