directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r557127 - in /directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw: io/ messages/ service/
Date Wed, 18 Jul 2007 03:02:54 GMT
Author: erodriguez
Date: Tue Jul 17 20:02:51 2007
New Revision: 557127

URL: http://svn.apache.org/viewvc?view=rev&rev=557127
Log:
Removed unnecessary encoding lengths from Change Password message objects.  These lengths
are implementation details of the codecs and have no place in the message objects.  Also,
they weren't being used during message processing and were cluttering the API.

Modified:
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordReplyDecoder.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordRequestDecoder.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessage.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessageModifier.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordError.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordErrorModifier.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReply.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReplyModifier.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequest.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequestModifier.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorRequest.java

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.java
Tue Jul 17 20:02:51 2007
@@ -50,12 +50,11 @@
         ChangePasswordErrorModifier modifier = new ChangePasswordErrorModifier();
 
         short messageLength = buf.getShort();
-        modifier.setMessageLength( messageLength );
 
         modifier.setProtocolVersionNumber( buf.getShort() );
 
         // AP_REQ length will be 0 for error messages
-        modifier.setAuthHeaderLength( buf.getShort() );
+        buf.getShort(); // authHeader length
 
         int errorLength = messageLength - HEADER_LENGTH;
 

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordReplyDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordReplyDecoder.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordReplyDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordReplyDecoder.java
Tue Jul 17 20:02:51 2007
@@ -55,9 +55,7 @@
         short protocolVersion = buf.getShort();
         short encodedAppReplyLength = buf.getShort();
 
-        modifier.setMessageLength( messageLength );
         modifier.setProtocolVersionNumber( protocolVersion );
-        modifier.setAuthHeaderLength( encodedAppReplyLength );
 
         byte[] encodedAppReply = new byte[encodedAppReplyLength];
         buf.get( encodedAppReply );

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordRequestDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordRequestDecoder.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordRequestDecoder.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordRequestDecoder.java
Tue Jul 17 20:02:51 2007
@@ -48,11 +48,11 @@
     {
         ChangePasswordRequestModifier modifier = new ChangePasswordRequestModifier();
 
-        modifier.setMessageLength( buf.getShort() );
+        buf.getShort(); // message length
+
         modifier.setProtocolVersionNumber( buf.getShort() );
 
         short authHeaderLength = buf.getShort();
-        modifier.setAuthHeaderLength( authHeaderLength );
 
         byte[] undecodedAuthHeader = new byte[authHeaderLength];
         buf.get( undecodedAuthHeader, 0, authHeaderLength );

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessage.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessage.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessage.java
Tue Jul 17 20:02:51 2007
@@ -31,27 +31,12 @@
      */
     public static final int PVNO = 1;
 
-    private short messageLength;
     private short versionNumber;
-    private short authHeaderLength;
 
 
-    protected AbstractPasswordMessage( short messageLength, short versionNumber, short authHeaderLength
)
+    protected AbstractPasswordMessage( short versionNumber )
     {
-        this.messageLength = messageLength;
         this.versionNumber = versionNumber;
-        this.authHeaderLength = authHeaderLength;
-    }
-
-
-    /**
-     * Returns the message length.
-     *
-     * @return The message length.
-     */
-    public short getMessageLength()
-    {
-        return messageLength;
     }
 
 
@@ -63,16 +48,5 @@
     public short getVersionNumber()
     {
         return versionNumber;
-    }
-
-
-    /**
-     * Returns the length of the AuthHeader.
-     *
-     * @return The length of the AuthHeader.
-     */
-    public short getAuthHeaderLength()
-    {
-        return authHeaderLength;
     }
 }

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessageModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessageModifier.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessageModifier.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/AbstractPasswordMessageModifier.java
Tue Jul 17 20:02:51 2007
@@ -26,20 +26,7 @@
  */
 abstract public class AbstractPasswordMessageModifier
 {
-    protected short messageLength;
     protected short versionNumber;
-    protected short authHeaderLength;
-
-
-    /**
-     * Sets the message length.
-     *
-     * @param messageLength
-     */
-    public void setMessageLength( short messageLength )
-    {
-        this.messageLength = messageLength;
-    }
 
 
     /**
@@ -50,16 +37,5 @@
     public void setProtocolVersionNumber( short versionNumber )
     {
         this.versionNumber = versionNumber;
-    }
-
-
-    /**
-     * Sets the AuthHeader length.
-     *
-     * @param authHeaderLength
-     */
-    public void setAuthHeaderLength( short authHeaderLength )
-    {
-        this.authHeaderLength = authHeaderLength;
     }
 }

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordError.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordError.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordError.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordError.java
Tue Jul 17 20:02:51 2007
@@ -40,10 +40,9 @@
      * @param authHeaderLength
      * @param errorMessage
      */
-    public ChangePasswordError( short messageLength, short versionNumber, short authHeaderLength,
-        ErrorMessage errorMessage )
+    public ChangePasswordError( short versionNumber, ErrorMessage errorMessage )
     {
-        super( messageLength, versionNumber, authHeaderLength );
+        super( versionNumber );
 
         this.errorMessage = errorMessage;
     }

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordErrorModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordErrorModifier.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordErrorModifier.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordErrorModifier.java
Tue Jul 17 20:02:51 2007
@@ -39,7 +39,7 @@
      */
     public ChangePasswordError getChangePasswordError()
     {
-        return new ChangePasswordError( messageLength, versionNumber, authHeaderLength, errorMessage
);
+        return new ChangePasswordError( versionNumber, errorMessage );
     }
 
 

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReply.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReply.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReply.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReply.java
Tue Jul 17 20:02:51 2007
@@ -43,10 +43,9 @@
      * @param applicationReply
      * @param privateMessage
      */
-    public ChangePasswordReply( short messageLength, short versionNumber, short authHeaderLength,
-        ApplicationReply applicationReply, PrivateMessage privateMessage )
+    public ChangePasswordReply( short versionNumber, ApplicationReply applicationReply, PrivateMessage
privateMessage )
     {
-        super( messageLength, versionNumber, authHeaderLength );
+        super( versionNumber );
 
         this.applicationReply = applicationReply;
         this.privateMessage = privateMessage;

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReplyModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReplyModifier.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReplyModifier.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordReplyModifier.java
Tue Jul 17 20:02:51 2007
@@ -41,8 +41,7 @@
      */
     public ChangePasswordReply getChangePasswordReply()
     {
-        return new ChangePasswordReply( messageLength, versionNumber, authHeaderLength, applicationReply,
-            privateMessage );
+        return new ChangePasswordReply( versionNumber, applicationReply, privateMessage );
     }
 
 

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequest.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequest.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequest.java
Tue Jul 17 20:02:51 2007
@@ -37,16 +37,13 @@
     /**
      * Creates a new instance of ChangePasswordRequest.
      *
-     * @param messageLength
      * @param versionNumber
-     * @param authHeaderLength
      * @param authHeader
      * @param privateMessage
      */
-    public ChangePasswordRequest( short messageLength, short versionNumber, short authHeaderLength,
-        ApplicationRequest authHeader, PrivateMessage privateMessage )
+    public ChangePasswordRequest( short versionNumber, ApplicationRequest authHeader, PrivateMessage
privateMessage )
     {
-        super( messageLength, versionNumber, authHeaderLength );
+        super( versionNumber );
 
         this.authHeader = authHeader;
         this.privateMessage = privateMessage;

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequestModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequestModifier.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequestModifier.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/messages/ChangePasswordRequestModifier.java
Tue Jul 17 20:02:51 2007
@@ -41,7 +41,7 @@
      */
     public ChangePasswordRequest getChangePasswordMessage()
     {
-        return new ChangePasswordRequest( messageLength, versionNumber, authHeaderLength,
authHeader, privateMessage );
+        return new ChangePasswordRequest( versionNumber, authHeader, privateMessage );
     }
 
 

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorRequest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorRequest.java?view=diff&rev=557127&r1=557126&r2=557127
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorRequest.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorRequest.java
Tue Jul 17 20:02:51 2007
@@ -49,14 +49,10 @@
                     .getAttribute( getContextKey() );
 
                 ChangePasswordRequest request = ( ChangePasswordRequest ) changepwContext.getRequest();
-                short authHeaderLength = request.getAuthHeaderLength();
-                short messageLength = request.getMessageLength();
                 short versionNumber = request.getVersionNumber();
 
                 StringBuffer sb = new StringBuffer();
                 sb.append( "Responding to change password request:" );
-                sb.append( "\n\t" + "authHeaderLength " + authHeaderLength );
-                sb.append( "\n\t" + "messageLength    " + messageLength );
                 sb.append( "\n\t" + "versionNumber    " + versionNumber );
 
                 log.debug( sb.toString() );



Mime
View raw message