directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r155387 - incubator/directory/asn1/branches/rewrite/ber/src/java/org/apache/asn1/TupleEventConsumer.java
Date Sat, 26 Feb 2005 07:12:52 GMT
Author: akarasulu
Date: Fri Feb 25 23:12:50 2005
New Revision: 155387

URL: http://svn.apache.org/viewcvs?view=rev&rev=155387
Log:
just toying with the idea of tuple-less decoding

Added:
    incubator/directory/asn1/branches/rewrite/ber/src/java/org/apache/asn1/TupleEventConsumer.java

Added: incubator/directory/asn1/branches/rewrite/ber/src/java/org/apache/asn1/TupleEventConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/directory/asn1/branches/rewrite/ber/src/java/org/apache/asn1/TupleEventConsumer.java?view=auto&rev=155387
==============================================================================
--- incubator/directory/asn1/branches/rewrite/ber/src/java/org/apache/asn1/TupleEventConsumer.java
(added)
+++ incubator/directory/asn1/branches/rewrite/ber/src/java/org/apache/asn1/TupleEventConsumer.java
Fri Feb 25 23:12:50 2005
@@ -0,0 +1,62 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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.asn1;
+
+
+import org.apache.asn1.ber.TagEnum;
+
+import java.nio.ByteBuffer;
+import java.net.URL;
+
+
+/**
+ * A Tuple consumer.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface TupleEventConsumer
+{
+    /**
+     * Consumer callback invoked by the production of a primitive tuple
+     * whose value is kept in memory.
+     *
+     * @param tag the tag enum type of the TLV tuple
+     * @param value the buffered value of the TLV tuple
+     */
+    void consume( TagEnum tag, ByteBuffer value );
+
+    /**
+     * Consumer callback invoked by the production of a primitive tuple
+     * whose value is kept on disk to be accessed later.
+     *
+     * The length in bytes of the data is encoded into a header in the
+     * stream - this helps because we can build and stream out determinate
+     * length tuples when encoding and chunking value out the door
+     *
+     * @param tag the tag enum type of the TLV tuple
+     * @param url the url to use for streamed access to this large tuple value
+     */
+    void consume( TagEnum tag, int length, URL url );
+
+    /**
+     * Consumer callback invoked by the production of a constructed tuple.
+     *
+     * @param tag the tag enum type of the TLV tuple
+     */
+    void consume( TagEnum tag );
+}



Mime
View raw message