directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1469413 - in /directory: apacheds/trunk/server-config/src/main/resources/ apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/ shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/ shared/...
Date Thu, 18 Apr 2013 16:28:40 GMT
Author: elecharny
Date: Thu Apr 18 16:28:39 2013
New Revision: 1469413

URL: http://svn.apache.org/r1469413
Log:
o Added the PwdModify extended operation in the base configuration
o Many fixes in the codec

Added:
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java
Modified:
    directory/apacheds/trunk/server-config/src/main/resources/config.ldif
    directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java
    directory/shared/trunk/ldap/codec/standalone/src/test/java/org/apache/directory/api/ldap/codec/standalone/AbstractCodecServiceTest.java
    directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestContainer.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestGrammar.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java
    directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java
    directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java

Modified: directory/apacheds/trunk/server-config/src/main/resources/config.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/resources/config.ldif?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/resources/config.ldif (original)
+++ directory/apacheds/trunk/server-config/src/main/resources/config.ldif Thu Apr 18 16:28:39
2013
@@ -725,6 +725,14 @@ objectclass: ads-extendedOpHandler
 objectclass: ads-base
 objectclass: top
 
+dn: ads-extendedOpId=pwdModifyHandler,ou=extendedOpHandlers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
+ads-extendedOpId: pwdModifyHandler
+ads-extendedOpHandlerclass: org.apache.directory.server.ldap.handlers.extended.PwdModifyHandler
+objectclass: ads-extendedOpHandler
+objectclass: ads-base
+objectclass: top
+ads-enabled: TRUE
+
 dn: ou=saslMechHandlers,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
 ou: saslMechHandlers
 objectclass: organizationalUnit

Modified: directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
(original)
+++ directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
Thu Apr 18 16:28:39 2013
@@ -101,7 +101,9 @@ public class FrameworkRunner extends Blo
             "org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,"
+
                 "org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,"
+
                 "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,"
+
-                "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory"
);
+                "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,"
+
+                "org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyFactory"
+            );
 
         System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_RESPONSES_LIST,
             "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory"
);

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/codec/api/StandaloneLdapCodecServiceTest.java
Thu Apr 18 16:28:39 2013
@@ -63,7 +63,9 @@ public class StandaloneLdapCodecServiceT
             "org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,"
+
                 "org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,"
+
                 "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,"
+
-                "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory"
);
+                "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,"
+
+                "org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyFactory"
+            );
 
         System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_RESPONSES_LIST,
             "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory"
);

Modified: directory/shared/trunk/ldap/codec/standalone/src/test/java/org/apache/directory/api/ldap/codec/standalone/AbstractCodecServiceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/standalone/src/test/java/org/apache/directory/api/ldap/codec/standalone/AbstractCodecServiceTest.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/standalone/src/test/java/org/apache/directory/api/ldap/codec/standalone/AbstractCodecServiceTest.java
(original)
+++ directory/shared/trunk/ldap/codec/standalone/src/test/java/org/apache/directory/api/ldap/codec/standalone/AbstractCodecServiceTest.java
Thu Apr 18 16:28:39 2013
@@ -67,7 +67,8 @@ public abstract class AbstractCodecServi
             "org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,"
+
                 "org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,"
+
                 "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,"
+
-                "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory"
);
+                "org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,"
+
+                "org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyFactory"
);
 
         System.setProperty( StandaloneLdapApiService.DEFAULT_EXTENDED_OPERATION_RESPONSES_LIST,
             "org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory"
);

Modified: directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java
(original)
+++ directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/api/ldap/extras/extended/PwdModifyRequestImpl.java
Thu Apr 18 16:28:39 2013
@@ -53,6 +53,7 @@ public class PwdModifyRequestImpl extend
      */
     public PwdModifyRequestImpl()
     {
+        setRequestName( EXTENSION_OID );
     }
 
 
@@ -63,6 +64,8 @@ public class PwdModifyRequestImpl extend
      */
     public PwdModifyRequestImpl( int messageId )
     {
+        super( messageId );
+        setRequestName( EXTENSION_OID );
     }
 
 

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/ExtrasBundleActivator.java
Thu Apr 18 16:28:39 2013
@@ -43,6 +43,7 @@ import org.apache.directory.api.ldap.ext
 import org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory;
 import org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory;
 import org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory;
+import org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify.PasswordModifyFactory;
 import org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
@@ -119,6 +120,9 @@ public class ExtrasBundleActivator imple
         extReqfactory = new StoredProcedureFactory( codec );
         codec.registerExtendedRequest( extReqfactory );
 
+        extReqfactory = new PasswordModifyFactory( codec );
+        codec.registerExtendedRequest( extReqfactory );
+
         // --------------------------------------------------------------------
         // Register Unsolicited Response Factories
         // --------------------------------------------------------------------

Added: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java?rev=1469413&view=auto
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java
(added)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java
Thu Apr 18 16:28:39 2013
@@ -0,0 +1,120 @@
+/*
+ *   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.api.ldap.extras.extended.ads_impl.pwdModify;
+
+
+import org.apache.directory.api.asn1.DecoderException;
+import org.apache.directory.api.ldap.codec.api.ExtendedRequestDecorator;
+import org.apache.directory.api.ldap.codec.api.ExtendedRequestFactory;
+import org.apache.directory.api.ldap.codec.api.ExtendedResponseDecorator;
+import org.apache.directory.api.ldap.codec.api.LdapApiService;
+import org.apache.directory.api.ldap.extras.extended.PwdModifyRequest;
+import org.apache.directory.api.ldap.extras.extended.PwdModifyRequestImpl;
+import org.apache.directory.api.ldap.extras.extended.PwdModifyResponse;
+import org.apache.directory.api.ldap.extras.extended.PwdModifyResponseImpl;
+import org.apache.directory.api.ldap.model.message.ExtendedRequest;
+import org.apache.directory.api.ldap.model.message.ExtendedResponse;
+
+
+/**
+ * An {@link ExtendedRequestFactory} for creating PwdModify extended request response 
+ * pairs.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class PasswordModifyFactory implements ExtendedRequestFactory<PwdModifyRequest,
PwdModifyResponse>
+{
+    private LdapApiService codec;
+
+
+    public PasswordModifyFactory( LdapApiService codec )
+    {
+        this.codec = codec;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getOid()
+    {
+        return PwdModifyRequest.EXTENSION_OID;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public PwdModifyRequest newRequest()
+    {
+        return new PasswordModifyRequestDecorator( codec, new PwdModifyRequestImpl() );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public PwdModifyResponse newResponse( byte[] encodedValue ) throws DecoderException
+    {
+        PasswordModifyResponseDecorator response = new PasswordModifyResponseDecorator( codec,
+            new PwdModifyResponseImpl() );
+        response.setResponseValue( encodedValue );
+        return response;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public PwdModifyRequest newRequest( byte[] value )
+    {
+        PasswordModifyRequestDecorator req = new PasswordModifyRequestDecorator( codec, new
PwdModifyRequestImpl() );
+        req.setRequestValue( value );
+        return req;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ExtendedRequestDecorator<PwdModifyRequest, PwdModifyResponse> decorate(
ExtendedRequest<?> modelRequest )
+    {
+        if ( modelRequest instanceof PasswordModifyRequestDecorator )
+        {
+            return ( PasswordModifyRequestDecorator ) modelRequest;
+        }
+
+        return new PasswordModifyRequestDecorator( codec, ( PwdModifyRequest ) modelRequest
);
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ExtendedResponseDecorator<PwdModifyResponse> decorate( ExtendedResponse
decoratedMessage )
+    {
+        if ( decoratedMessage instanceof PasswordModifyResponseDecorator )
+        {
+            return ( PasswordModifyResponseDecorator ) decoratedMessage;
+        }
+
+        return new PasswordModifyResponseDecorator( codec, ( PwdModifyResponse ) decoratedMessage
);
+    }
+}

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequest.java
Thu Apr 18 16:28:39 2013
@@ -130,7 +130,7 @@ public class PasswordModifyRequest exten
 
 
     /**
-     * @return The internal PwdModifyRequest object
+     * @return the pwdModifyRequest
      */
     public PwdModifyRequest getPwdModifyRequest()
     {

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestContainer.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestContainer.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestContainer.java
Thu Apr 18 16:28:39 2013
@@ -21,6 +21,7 @@ package org.apache.directory.api.ldap.ex
 
 
 import org.apache.directory.api.asn1.ber.AbstractContainer;
+import org.apache.directory.api.ldap.extras.extended.PwdModifyRequest;
 
 
 /**
@@ -31,7 +32,7 @@ import org.apache.directory.api.asn1.ber
 public class PasswordModifyRequestContainer extends AbstractContainer
 {
     /** PasswordModifyRequest decorator*/
-    private PasswordModifyRequestDecorator pwdModifyRequest;
+    private PasswordModifyRequestDecorator passwordModifyRequestDecorator;
 
 
     /**
@@ -50,9 +51,9 @@ public class PasswordModifyRequestContai
     /**
      * @return Returns the PwdModifyRequest instance.
      */
-    public PasswordModifyRequestDecorator getPasswordModifyRequest()
+    public PwdModifyRequest getPwdModifyRequest()
     {
-        return pwdModifyRequest;
+        return passwordModifyRequestDecorator;
     }
 
 
@@ -62,9 +63,9 @@ public class PasswordModifyRequestContai
      * 
      * @param pwdModifyRequest the PasswordModifyRequest to set.
      */
-    public void setPasswordModifyRequest( PasswordModifyRequestDecorator pwdModifyRequest
)
+    public void setPasswordModifyRequest( PasswordModifyRequestDecorator passwordModifyRequestDecorator
)
     {
-        this.pwdModifyRequest = pwdModifyRequest;
+        this.passwordModifyRequestDecorator = passwordModifyRequestDecorator;
     }
 
 
@@ -74,6 +75,6 @@ public class PasswordModifyRequestContai
     public void clean()
     {
         super.clean();
-        pwdModifyRequest = null;
+        passwordModifyRequestDecorator = null;
     }
 }

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecoder.java
Thu Apr 18 16:28:39 2013
@@ -25,6 +25,7 @@ import java.nio.ByteBuffer;
 import org.apache.directory.api.asn1.Asn1Object;
 import org.apache.directory.api.asn1.DecoderException;
 import org.apache.directory.api.asn1.ber.Asn1Decoder;
+import org.apache.directory.api.ldap.extras.extended.PwdModifyRequest;
 
 
 /**
@@ -52,11 +53,11 @@ public class PasswordModifyRequestDecode
         ByteBuffer bb = ByteBuffer.wrap( stream );
         PasswordModifyRequestContainer container = new PasswordModifyRequestContainer();
         decoder.decode( bb, container );
-        PasswordModifyRequestDecorator passwordModifyRequestDecorator = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
 
         // Clean the container for the next decoding
         container.clean();
 
-        return passwordModifyRequestDecorator.getPasswordModifyRequest();
+        return ( ( PasswordModifyRequestDecorator ) pwdModifyRequest ).getPasswordModifyRequest();
     }
 }

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecorator.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestDecorator.java
Thu Apr 18 16:28:39 2013
@@ -26,6 +26,7 @@ import org.apache.directory.api.i18n.I18
 import org.apache.directory.api.ldap.codec.api.ExtendedRequestDecorator;
 import org.apache.directory.api.ldap.codec.api.LdapApiService;
 import org.apache.directory.api.ldap.extras.extended.PwdModifyRequest;
+import org.apache.directory.api.ldap.extras.extended.PwdModifyRequestImpl;
 import org.apache.directory.api.ldap.extras.extended.PwdModifyResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -78,6 +79,12 @@ public class PasswordModifyRequestDecora
         try
         {
             passwordModifyRequest = ( PasswordModifyRequest ) decoder.decode( requestValue
);
+            ( ( PwdModifyRequestImpl ) getDecorated() ).setUserIdentity( passwordModifyRequest.getPwdModifyRequest()
+                .getUserIdentity() );
+            ( ( PwdModifyRequestImpl ) getDecorated() ).setOldPassword( passwordModifyRequest.getPwdModifyRequest()
+                .getOldPassword() );
+            ( ( PwdModifyRequestImpl ) getDecorated() ).setNewPassword( passwordModifyRequest.getPwdModifyRequest()
+                .getNewPassword() );
 
             if ( requestValue != null )
             {
@@ -142,7 +149,16 @@ public class PasswordModifyRequestDecora
      */
     public byte[] getUserIdentity()
     {
-        return getDecorated().getUserIdentity();
+        return ( ( PwdModifyRequestImpl ) getDecorated() ).getUserIdentity();
+    }
+
+
+    /**
+     * @param userIdentity the userIdentity to set
+     */
+    public void setUserIdentity( byte[] userIdentity )
+    {
+        ( ( PwdModifyRequestImpl ) getDecorated() ).setUserIdentity( userIdentity );
     }
 
 
@@ -151,7 +167,16 @@ public class PasswordModifyRequestDecora
      */
     public byte[] getOldPassword()
     {
-        return getDecorated().getOldPassword();
+        return ( ( PwdModifyRequestImpl ) getDecorated() ).getOldPassword();
+    }
+
+
+    /**
+     * @param oldPassword the oldPassword to set
+     */
+    public void setOldPassword( byte[] oldPassword )
+    {
+        ( ( PwdModifyRequestImpl ) getDecorated() ).setOldPassword( oldPassword );
     }
 
 
@@ -160,6 +185,15 @@ public class PasswordModifyRequestDecora
      */
     public byte[] getNewPassword()
     {
-        return getDecorated().getNewPassword();
+        return ( ( PwdModifyRequestImpl ) getDecorated() ).getNewPassword();
+    }
+
+
+    /**
+     * @param newPassword the newPassword to set
+     */
+    public void setNewPassword( byte[] newPassword )
+    {
+        ( ( PwdModifyRequestImpl ) getDecorated() ).setNewPassword( newPassword );
     }
 }

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestGrammar.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestGrammar.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyRequestGrammar.java
Thu Apr 18 16:28:39 2013
@@ -88,9 +88,9 @@ public class PasswordModifyRequestGramma
                 {
                     public void action( PasswordModifyRequestContainer container )
                     {
-                        PasswordModifyRequestDecorator passwordModifyRequest = new PasswordModifyRequestDecorator(
+                        PasswordModifyRequestDecorator passwordModifyRequestDecorator = new
PasswordModifyRequestDecorator(
                             LdapApiServiceFactory.getSingleton(), new PwdModifyRequestImpl()
);
-                        container.setPasswordModifyRequest( passwordModifyRequest );
+                        container.setPasswordModifyRequest( passwordModifyRequestDecorator
);
 
                         // We may have nothing left
                         container.setGrammarEndAllowed( true );
@@ -129,7 +129,7 @@ public class PasswordModifyRequestGramma
                             userIdentity = Strings.EMPTY_BYTES;
                         }
 
-                        ( ( PwdModifyRequestImpl ) container.getPasswordModifyRequest().getDecorated()
)
+                        ( ( PasswordModifyRequestDecorator ) container.getPwdModifyRequest()
)
                             .setUserIdentity( userIdentity );
 
                         // We may have nothing left
@@ -170,7 +170,7 @@ public class PasswordModifyRequestGramma
                             oldPassword = Strings.EMPTY_BYTES;
                         }
 
-                        ( ( PwdModifyRequestImpl ) container.getPasswordModifyRequest().getDecorated()
)
+                        ( ( PasswordModifyRequestDecorator ) container.getPwdModifyRequest()
)
                             .setOldPassword( oldPassword );
 
                         // We may have nothing left
@@ -212,7 +212,7 @@ public class PasswordModifyRequestGramma
                             newPassword = Strings.EMPTY_BYTES;
                         }
 
-                        ( ( PwdModifyRequestImpl ) container.getPasswordModifyRequest().getDecorated()
)
+                        ( ( PasswordModifyRequestDecorator ) container.getPwdModifyRequest()
)
                             .setNewPassword( newPassword );
 
                         // We may have nothing left
@@ -253,7 +253,7 @@ public class PasswordModifyRequestGramma
                             oldPassword = Strings.EMPTY_BYTES;
                         }
 
-                        ( ( PwdModifyRequestImpl ) container.getPasswordModifyRequest().getDecorated()
)
+                        ( ( PasswordModifyRequestDecorator ) container.getPwdModifyRequest()
)
                             .setOldPassword( oldPassword );
 
                         // We may have nothing left
@@ -294,7 +294,7 @@ public class PasswordModifyRequestGramma
                             newPassword = Strings.EMPTY_BYTES;
                         }
 
-                        ( ( PwdModifyRequestImpl ) container.getPasswordModifyRequest().getDecorated()
)
+                        ( ( PasswordModifyRequestDecorator ) container.getPwdModifyRequest()
)
                             .setNewPassword( newPassword );
 
                         // We may have nothing left
@@ -335,7 +335,7 @@ public class PasswordModifyRequestGramma
                             newPassword = Strings.EMPTY_BYTES;
                         }
 
-                        ( ( PwdModifyRequestImpl ) container.getPasswordModifyRequest().getDecorated()
)
+                        ( ( PasswordModifyRequestDecorator ) container.getPwdModifyRequest()
)
                             .setNewPassword( newPassword );
 
                         // We may have nothing left

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyResponseDecoder.java
Thu Apr 18 16:28:39 2013
@@ -52,11 +52,10 @@ public class PasswordModifyResponseDecod
         ByteBuffer bb = ByteBuffer.wrap( stream );
         PasswordModifyRequestContainer container = new PasswordModifyRequestContainer();
         decoder.decode( bb, container );
-        PasswordModifyRequestDecorator passwordModifyRequestDecorator = container.getPasswordModifyRequest();
 
         // Clean the container for the next decoding
         container.clean();
 
-        return passwordModifyRequestDecorator.getPasswordModifyRequest();
+        return ( ( PasswordModifyRequestDecorator ) container.getPwdModifyRequest() ).getPasswordModifyRequest();
     }
 }

Modified: directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/PasswordModifyRequestTest.java
Thu Apr 18 16:28:39 2013
@@ -77,7 +77,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNull( pwdModifyRequest.getUserIdentity() );
         assertNull( pwdModifyRequest.getOldPassword() );
         assertNull( pwdModifyRequest.getNewPassword() );
@@ -133,7 +133,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNotNull( pwdModifyRequest.getUserIdentity() );
         assertEquals( 0, pwdModifyRequest.getUserIdentity().length );
         assertNull( pwdModifyRequest.getOldPassword() );
@@ -194,7 +194,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNotNull( pwdModifyRequest.getUserIdentity() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
         assertNull( pwdModifyRequest.getOldPassword() );
@@ -258,7 +258,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNotNull( pwdModifyRequest.getUserIdentity() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
         assertNull( pwdModifyRequest.getOldPassword() );
@@ -327,7 +327,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNotNull( pwdModifyRequest.getUserIdentity() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
         assertNull( pwdModifyRequest.getOldPassword() );
@@ -391,7 +391,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNotNull( pwdModifyRequest.getUserIdentity() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
         assertNotNull( pwdModifyRequest.getOldPassword() );
@@ -459,7 +459,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNotNull( pwdModifyRequest.getUserIdentity() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
         assertNotNull( pwdModifyRequest.getOldPassword() );
@@ -530,7 +530,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNotNull( pwdModifyRequest.getUserIdentity() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
         assertNotNull( pwdModifyRequest.getOldPassword() );
@@ -606,7 +606,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNotNull( pwdModifyRequest.getUserIdentity() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getUserIdentity() )
);
         assertNotNull( pwdModifyRequest.getOldPassword() );
@@ -665,7 +665,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNull( pwdModifyRequest.getUserIdentity() );
         assertNotNull( pwdModifyRequest.getOldPassword() );
         assertEquals( 0, pwdModifyRequest.getOldPassword().length );
@@ -726,7 +726,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNull( pwdModifyRequest.getUserIdentity() );
         assertNotNull( pwdModifyRequest.getOldPassword() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getOldPassword() ) );
@@ -790,7 +790,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNull( pwdModifyRequest.getUserIdentity() );
         assertNotNull( pwdModifyRequest.getOldPassword() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getOldPassword() ) );
@@ -859,7 +859,7 @@ public class PasswordModifyRequestTest
             fail( de.getMessage() );
         }
 
-        PwdModifyRequest pwdModifyRequest = container.getPasswordModifyRequest();
+        PwdModifyRequest pwdModifyRequest = container.getPwdModifyRequest();
         assertNull( pwdModifyRequest.getUserIdentity() );
         assertNotNull( pwdModifyRequest.getOldPassword() );
         assertEquals( "abcd", Strings.utf8ToString( pwdModifyRequest.getOldPassword() ) );

Modified: directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java?rev=1469413&r1=1469412&r2=1469413&view=diff
==============================================================================
--- directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java
(original)
+++ directory/shared/trunk/ldap/net/mina/src/main/java/org/apache/directory/api/ldap/codec/protocol/mina/LdapProtocolDecoder.java
Thu Apr 18 16:28:39 2013
@@ -51,7 +51,7 @@ public class LdapProtocolDecoder impleme
 {
     /** The logger */
     private static Logger LOG = LoggerFactory.getLogger( LdapDecoder.class );
-    
+
     /** A speedup for logger */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
 



Mime
View raw message