directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1032108 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber: AbstractContainer.java Asn1Container.java
Date Sat, 06 Nov 2010 16:25:01 GMT
Author: elecharny
Date: Sat Nov  6 16:25:01 2010
New Revision: 1032108

URL: http://svn.apache.org/viewvc?rev=1032108&view=rev
Log:
It's now possible to inject the stream into the container to handle grammar switch during
a decoding.

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java?rev=1032108&r1=1032107&r2=1032108&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
Sat Nov  6 16:25:01 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.shared.asn1.ber;
 
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.asn1.ber.grammar.Grammar;
 import org.apache.directory.shared.asn1.ber.grammar.States;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
@@ -65,6 +67,8 @@ public abstract class AbstractContainer 
     /** The incremental id used to tag TLVs */
     private int id = 0;
 
+    /** The Stream being decoded */
+    private ByteBuffer stream;
 
     /**
      * Creates a new instance of AbstractContainer with a starting state.
@@ -275,4 +279,23 @@ public abstract class AbstractContainer 
             this.maxPDUSize = Integer.MAX_VALUE;
         }
     }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public ByteBuffer getStream()
+    {
+        return stream;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public void setStream( ByteBuffer stream )
+    {
+        this.stream = stream;
+    }
+
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java?rev=1032108&r1=1032107&r2=1032108&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java
Sat Nov  6 16:25:01 2010
@@ -20,6 +20,8 @@
 package org.apache.directory.shared.asn1.ber;
 
 
+import java.nio.ByteBuffer;
+
 import org.apache.directory.shared.asn1.ber.grammar.Grammar;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
@@ -33,6 +35,22 @@ import org.apache.directory.shared.asn1.
 public interface Asn1Container
 {
     /**
+     * Gets the current stream containing the bytes to decode
+     * 
+     * @return The current stream
+     */
+    ByteBuffer getStream();
+    
+    
+    /**
+     * Stores the Stream being decoded
+     * 
+     * @param stream The stream being decoded
+     */
+    void setStream( ByteBuffer stream );
+    
+    
+    /**
      * Get the current grammar state
      * 
      * @return Returns the current grammar state



Mime
View raw message