directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1679577 - in /directory/shared/trunk: asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/ ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/
Date Fri, 15 May 2015 14:50:50 GMT
Author: elecharny
Date: Fri May 15 14:50:49 2015
New Revision: 1679577

URL: http://svn.apache.org/r1679577
Log:
o Renamed the decodeBytes field to decodedBytes
o Made this field private, added accessors

Modified:
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Container.java
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
    directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/LdapMessageContainer.java

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java?rev=1679577&r1=1679576&r2=1679577&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/AbstractContainer.java
Fri May 15 14:50:49 2015
@@ -56,7 +56,7 @@ public abstract class AbstractContainer
     private boolean grammarEndAllowed;
 
     /** A counter for the decoded bytes */
-    protected int decodeBytes;
+    private int decodedBytes;
 
     /** The maximum allowed size for a PDU. Default to MAX int value */
     private int maxPDUSize = Integer.MAX_VALUE;
@@ -235,18 +235,27 @@ public abstract class AbstractContainer
     /**
      * {@inheritDoc}
      */
-    public int getDecodeBytes()
+    public int getDecodedBytes()
     {
-        return decodeBytes;
+        return decodedBytes;
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public void incrementDecodeBytes( int nb )
+    public void setDecodedBytes( int decodedBytes )
     {
-        decodeBytes += nb;
+        this.decodedBytes = decodedBytes;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void incrementDecodedBytes( int nb )
+    {
+        decodedBytes += nb;
     }
 
 

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Container.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Container.java?rev=1679577&r1=1679576&r2=1679577&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Container.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Container.java
Fri May 15 14:50:49 2015
@@ -92,6 +92,14 @@ public interface Asn1Container
 
 
     /**
+     * Sets the grammar
+     *
+     * @param grammar The grammar to set
+     */
+    void setGrammar( Grammar<?> grammar );
+
+
+    /**
      * Gets the transition
      *
      * @return Returns the transition from the previous state to the new state
@@ -157,14 +165,20 @@ public interface Asn1Container
      * to control the PDU size and avoid PDU exceeding the maximum allowed
      * size to break the server.
      */
-    int getDecodeBytes();
+    int getDecodedBytes();
+
+
+    /**
+     * @param decodedBytes The number of decoded bytes for this message.
+     */
+    void setDecodedBytes( int decodeBytes );
 
 
     /**
      * Increment the decodedBytes by the latest received buffer's size.
      * @param nb The buffer size.
      */
-    void incrementDecodeBytes( int nb );
+    void incrementDecodedBytes( int nb );
 
 
     /**

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java?rev=1679577&r1=1679576&r2=1679577&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
Fri May 15 14:50:49 2015
@@ -657,11 +657,11 @@ public class Asn1Decoder implements TLVB
         boolean hasRemaining = stream.hasRemaining();
 
         // Increment the PDU size counter.
-        container.incrementDecodeBytes( stream.remaining() );
+        container.incrementDecodedBytes( stream.remaining() );
 
-        if ( container.getDecodeBytes() > container.getMaxPDUSize() )
+        if ( container.getDecodedBytes() > container.getMaxPDUSize() )
         {
-            String message = I18n.err( I18n.ERR_00042_PDU_SIZE_TOO_LONG, container.getDecodeBytes(),
container
+            String message = I18n.err( I18n.ERR_00042_PDU_SIZE_TOO_LONG, container.getDecodedBytes(),
container
                 .getMaxPDUSize() );
             LOG.error( message );
             throw new DecoderException( message );

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/LdapMessageContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/LdapMessageContainer.java?rev=1679577&r1=1679576&r2=1679577&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/LdapMessageContainer.java
(original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/LdapMessageContainer.java
Fri May 15 14:50:49 2015
@@ -121,7 +121,7 @@ public class LdapMessageContainer<E exte
         messageDecorator = null;
         messageId = 0;
         currentControl = null;
-        decodeBytes = 0;
+        setDecodedBytes( 0 );
     }
 
 



Mime
View raw message