You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/09/09 23:43:24 UTC
svn commit: r279887 [1/15] - in
/directory/shared/ldap/branches/elecharny-cleanup/apache2-provider: ./
conf/ perfs/ perfs/org/ perfs/org/apache/ perfs/org/apache/asn1new/
perfs/org/apache/asn1new/ber/ src/ src/java/ src/java/main/
src/java/main/org/ sr...
Author: elecharny
Date: Fri Sep 9 14:41:22 2005
New Revision: 279887
URL: http://svn.apache.org/viewcvs?rev=279887&view=rev
Log:
Added from new-codec-integration branch
Added:
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j-perf.conf (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j.conf (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/apache/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/apache/asn1new/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/apache/asn1new/ber/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/apache/asn1new/ber/LdapDecoderPerf.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/project.xml (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixDecoder.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixEncoder.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixProvider.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixTransformer.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/LdapConstants.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/LdapDecoder.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/LdapMessageContainer.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/AbandonRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/AddRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/AddResponseGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/BindRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/BindResponseGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/CompareRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/CompareResponseGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/DelRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/DelResponseGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/ExtendedRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/ExtendedResponseGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/FilterGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/LdapControlGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/LdapMessageGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/LdapResultGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/LdapStatesEnum.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/ModifyDNRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/ModifyDNResponseGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/ModifyRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/ModifyResponseGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/SearchRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/SearchResultDoneGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/SearchResultEntryGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/SearchResultReferenceGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/grammar/UnBindRequestGrammar.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/LdapDN.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/LdapString.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/LdapURL.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/primitives/RelativeLdapDN.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/utils/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/utils/DNUtils.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/codec/utils/LdapResultEnum.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AbandonRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AddRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AddResponse.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AttributeValueAssertion.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindResponse.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/CompareRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/CompareResponse.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/Control.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/DelRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/DelResponse.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedResponse.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapAuthentication.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapResponse.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapResult.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyDNResponse.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyResponse.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SaslCredentials.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultDone.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultReference.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SimpleAuthentication.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/UnBindRequest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/AndFilter.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/AttributeValueAssertionFilter.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ConnectorFilter.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ExtensibleMatchFilter.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/Filter.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/NotFilter.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/OrFilter.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/PresentFilter.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/SubstringFilter.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AbandonRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddResponseTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareResponseTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelResponseTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNResponseTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyResponseTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultDoneTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultEntryTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultReferenceTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/UnBindRequestTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/utils/
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/utils/DNUtilsTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/utils/LdapDNTest.java (with props)
directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/test/org/apache/asn1new/ldap/codec/utils/LdapUrlTest.java (with props)
Added: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j-perf.conf
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j-perf.conf?rev=279887&view=auto
==============================================================================
--- directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j-perf.conf (added)
+++ directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j-perf.conf Fri Sep 9 14:41:22 2005
@@ -0,0 +1,18 @@
+# Properties to initialise log4j
+
+####################################################
+# DEFAULT
+log4j.rootLogger=WARN, APACHE-DS
+
+####################################################
+
+log4j.appender.APACHE-DS=org.apache.log4j.ConsoleAppender
+log4j.appender.APACHE-DS.layout=org.apache.log4j.PatternLayout
+#log4j.appender.APACHE-DS.layout.ConversionPattern=%8r> [%-20.20C{1}] - %m%n
+log4j.appender.APACHE-DS.layout.ConversionPattern=%8r> --%-30.30C{1}-- [%5.5p] %m%n
+
+# specific loggers
+log4j.logger.org.apache.asn1new.ber.ldap.LdapDecoder=WARN
+
+log4j.logger.org.apache.asn1new.ber.grammar.LdapMessageGrammar=WARN
+
Propchange: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j-perf.conf
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j.conf
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j.conf?rev=279887&view=auto
==============================================================================
--- directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j.conf (added)
+++ directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j.conf Fri Sep 9 14:41:22 2005
@@ -0,0 +1,114 @@
+# Properties to initialise log4j
+
+####################################################
+# DEFAULT
+log4j.rootLogger=DEBUG, APACHE-DS
+
+####################################################
+
+log4j.appender.APACHE-DS=org.apache.log4j.ConsoleAppender
+log4j.appender.APACHE-DS.layout=org.apache.log4j.PatternLayout
+#log4j.appender.APACHE-DS.layout.ConversionPattern=%8r> [%-20.20C{1}] - %m%n
+log4j.appender.APACHE-DS.layout.ConversionPattern=%8r --%-30.30C{1}-- [%5.5p] %m%n
+
+log4j.logger.org.apache.asn1new.ber.Asn1Decoder=INFO
+log4j.logger.org.apache.asn1new.ber.grammar.AbstractGrammar=DEBUG
+
+# Ber grammar
+log4j.logger.org.apache.asn1new.ber.grammar.AbstractGrammar=DEBUG
+# The two followin classes does not have any logger
+#log4j.logger.org.apache.asn1new.ber.grammar.GrammarAction=DEBUG
+#log4j.logger.org.apache.asn1new.ber.grammar.GrammarTransition=DEBUG
+
+#Ber TLV: none of the following classes does have a logger.
+#log4j.logger.org.apache.asn1new.ber.tlv.Length=DEBUG
+#log4j.logger.org.apache.asn1new.ber.tlv.Tag=DEBUG
+#log4j.logger.org.apache.asn1new.ber.tlv.TLV=DEBUG
+#log4j.logger.org.apache.asn1new.ber.tlv.Value=DEBUG
+
+# Ldap Codec
+log4j.logger.org.apache.asn1new.LdapDecoder
+log4j.logger.org.apache.asn1new.LdapMessageContainer
+
+
+# Ldap grammars
+log4j.logger.org.apache.asn1new.codec.grammar.AbandonRequestGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.AddRequestGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.AddResponseGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.BindRequestGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.BindResponseGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.CompareRequestGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.CompareResponseGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.DelRequestGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.DelResponseGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.ExtendedRequestGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.ExtendedResponseGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.FilterGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.LdapControlGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.LdapMessageGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.LdapResultGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.ModifyDNRequestGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.ModifyDNResponseGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.ModifyRequestGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.ModifyResponseGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.SearchRequestGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.SearchResultDoneGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.SearchResultEntryGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.SearchResultReferenceGrammar=DEBUG
+log4j.logger.org.apache.asn1new.codec.grammar.UnBinRequestGrammar=DEBUG
+
+# Ldap codec Primitives
+log4j.logger.org.apache.asn1new.codec.primitives.LdapDN=DEBUG
+log4j.logger.org.apache.asn1new.codec.primitives.LdapString=DEBUG
+log4j.logger.org.apache.asn1new.codec.primitives.LdapURL=DEBUG
+log4j.logger.org.apache.asn1new.codec.primitives.RelativeLdapDN=DEBUG
+
+# Ldap codec utils
+log4j.logger.org.apache.asn1new.codec.utils.DNUtils=DEBUG
+
+
+# Beware ! Very verbose ...
+log4j.logger.org.apache.asn1new.ldap.TwixDecoder=DEBUG
+log4j.logger.org.apache.asn1new.ldap.TwixEncoder=DEBUG
+log4j.logger.org.apache.asn1new.ldap.TwixTransformer=DEBUG
+
+# Pojos
+log4j.logger.org.apache.asn1new.ldap.pojo.AbandonRequest=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.AddRequest=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.AddResponse=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.AttributeValueAssertion=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.BindRequest=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.BindResponse=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.CompareRequest=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.CompareResponse=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.Control=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.DelRequest=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.DelResponse=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.ExtendedRequest=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.ExtendedResponse=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.LdapAuthentication=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.LdapMessage=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.LdapResponse=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.LdapResult=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.ModifyDNRequest=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.ModifyDNResponse=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.ModifyRequest=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.ModifyResponse=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.SaslCredentials=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.SearchRequest=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.SearchResultDone=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.SearchResultEntry=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.SearchResultReference=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.SimpleAuthentication=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.UnBinRequest=DEBUG
+
+# Pojo filters
+log4j.logger.org.apache.asn1new.ldap.pojo.filters.AndFilter=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.filters.AttributeValueAssertionFilter=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.filters.ConnectorFilter=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.filters.ExtensibleMatchFilter=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.filters.Filter=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.filters.NotFilter=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.filters.OrFilter=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.filters.PresentFilter=DEBUG
+log4j.logger.org.apache.asn1new.ldap.pojo.filters.SubstringFilter=DEBUG
\ No newline at end of file
Propchange: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/conf/log4j.conf
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/apache/asn1new/ber/LdapDecoderPerf.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/apache/asn1new/ber/LdapDecoderPerf.java?rev=279887&view=auto
==============================================================================
--- directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/apache/asn1new/ber/LdapDecoderPerf.java (added)
+++ directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/apache/asn1new/ber/LdapDecoderPerf.java Fri Sep 9 14:41:22 2005
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2005 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.asn1new.ber;
+
+import org.apache.asn1.codec.DecoderException;
+import org.apache.asn1new.ber.Asn1Decoder;
+import org.apache.asn1new.ldap.codec.LdapDecoder;
+import org.apache.asn1new.ldap.codec.LdapMessageContainer;
+import org.apache.asn1new.ldap.pojo.BindRequest;
+import org.apache.asn1new.ldap.pojo.LdapMessage;
+import org.apache.asn1new.ldap.pojo.SearchResultEntry;
+import org.apache.log4j.BasicConfigurator;
+import org.apache.log4j.PropertyConfigurator;
+
+import java.nio.ByteBuffer;
+
+
+/**
+ * A performance test.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class LdapDecoderPerf extends Thread
+{
+ //~ Methods ------------------------------------------------------------------------------------
+
+ /**
+ * A performance test...
+ */
+ public void run()
+ {
+ PropertyConfigurator.configure( System.getProperty( "log4j.configuration" ) );
+
+ Asn1Decoder ldapDecoder = new LdapDecoder();
+
+ ByteBuffer stream = ByteBuffer.allocate( 0x7b );
+
+
+ stream.put(
+ new byte[]
+ {
+ 0x30, 0x79, // LDAPMessage ::=SEQUENCE {
+ 0x02, 0x01, 0x01, // messageID MessageID
+ 0x64, 0x74, // CHOICE { ..., searchResEntry SearchResultEntry, ...
+ // SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
+ // objectName LDAPDN,
+ 0x04, 0x1b, 'o', 'u', '=', 'c', 'o', 'n', 't', 'a', 'c', 't', 's', ',', 'd', 'c', '=', 'i', 'k', 't', 'e', 'k', ',', 'd', 'c', '=', 'c', 'o', 'm',
+ // attributes PartialAttributeList }
+ // PartialAttributeList ::= SEQUENCE OF SEQUENCE {
+ 0x30, 0x55,
+ 0x30, 0x28,
+ // type AttributeDescription,
+ 0x04, 0x0b, 'o', 'b', 'j', 'e', 'c', 't', 'c', 'l', 'a', 's', 's',
+ // vals SET OF AttributeValue }
+ 0x31, 0x19,
+ // AttributeValue ::= OCTET STRING
+ 0x04, 0x03, 't', 'o', 'p',
+ // AttributeValue ::= OCTET STRING
+ 0x04, 0x12, 'o', 'r', 'g', 'a', 'n', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'a', 'l', 'U', 'n', 'i', 't',
+ 0x30, 0x29,
+ // type AttributeDescription,
+ 0x04, 0x0c, 'o', 'b', 'j', 'e', 'c', 't', 'c', 'l', 'a', 's', 's', '2',
+ // vals SET OF AttributeValue }
+ 0x31, 0x19,
+ // AttributeValue ::= OCTET STRING
+ 0x04, 0x03, 't', 'o', 'p',
+ // AttributeValue ::= OCTET STRING
+ 0x04, 0x12, 'o', 'r', 'g', 'a', 'n', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'a', 'l', 'U', 'n', 'i', 't'
+ } );
+
+/*
+ stream.put(
+ new byte[]
+ {
+ 0x30, 0x33, // LDAPMessage ::=SEQUENCE {
+ 0x02, 0x01, 0x01, // messageID MessageID
+ 0x60, 0x2E, // CHOICE { ..., bindRequest BindRequest, ...
+ // BindRequest ::= APPLICATION[0] SEQUENCE {
+ 0x02, 0x01, 0x03, // version INTEGER (1..127),
+ 0x04, 0x1F, // name LDAPDN,
+ 'u', 'i', 'd', '=', 'a', 'k', 'a', 'r', 'a', 's', 'u', 'l', 'u', ',', 'd', 'c', '=',
+ 'e', 'x', 'a', 'm', 'p', 'l', 'e', ',', 'd', 'c', '=', 'c', 'o', 'm',
+ ( byte ) 0x80, 0x08, // authentication AuthenticationChoice
+ // AuthenticationChoice ::= CHOICE { simple [0] OCTET STRING, ...
+ 'p', 'a', 's', 's', 'w', 'o', 'r', 'd'
+ } );
+*/
+ stream.flip();
+
+ try
+ {
+
+ long t0 = System.currentTimeMillis();
+ LdapMessageContainer ldapMessageContainer = new LdapMessageContainer();
+
+ for ( int i = 0; i < 100000; i++ )
+ {
+ // Allocate a BindRequest Container
+
+ ldapDecoder.decode( stream, ldapMessageContainer );
+
+ // Restore the buffer, and reset the container
+ stream.flip();
+ ldapMessageContainer.clean();
+ }
+
+ long t1 = System.currentTimeMillis();
+
+ System.out.println( "Delta = " + ( t1 - t0 ) );
+ }
+ catch ( DecoderException de )
+ {
+ System.out.println( de.getMessage() );
+ de.printStackTrace();
+ }
+ }
+
+ /**
+ * Main
+ *
+ * @param args DOCUMENT ME!
+ */
+ public static void main( String[] args )
+ {
+
+ LdapDecoderPerf ldpt1 = new LdapDecoderPerf();
+ LdapDecoderPerf ldpt2 = new LdapDecoderPerf();
+ LdapDecoderPerf ldpt3 = new LdapDecoderPerf();
+ LdapDecoderPerf ldpt4 = new LdapDecoderPerf();
+
+ ldpt1.start();
+ ldpt2.start();
+ ldpt3.start();
+ ldpt4.start();
+ }
+}
Propchange: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/perfs/org/apache/asn1new/ber/LdapDecoderPerf.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/project.xml
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/project.xml?rev=279887&view=auto
==============================================================================
--- directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/project.xml (added)
+++ directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/project.xml Fri Sep 9 14:41:22 2005
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <extend>../project.xml</extend>
+ <pomVersion>3</pomVersion>
+ <artifactId>apache-new-ldapber-provider</artifactId>
+ <name>Apache's new ASN.1 based LDAP BER Message Provider</name>
+ <package>org.apache.asn1new.ldap</package>
+ <build />
+ <developers>
+ <developer>
+ <name>Emmanuel Lécharny</name>
+ <id>elecharny</id>
+ <email>elecharny at apache.org</email>
+ </developer>
+ </developers>
+ <inceptionYear>2005</inceptionYear>
+ <shortDescription>Apache's new LDAP BER Message Provider</shortDescription>
+ <description>A new provider for the LDAP message framework (in LDAP commons) based on the
+ Apache ASN.1 BER Runtime.</description>
+ <dependencies>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.0</version>
+ <type>jar</type>
+ <url>http://jakarta.apache.org/commons/lang/api</url>
+ </dependency>
+ <dependency>
+ <groupId>directory-asn1</groupId>
+ <artifactId>asn1-codec</artifactId>
+ <version>0.3.1</version>
+ <type>jar</type>
+ <url>http://directory.apache.org/subprojects/asn1/codec</url>
+ </dependency>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>ldap-common</artifactId>
+ <version>${pom.currentVersion}</version>
+ <type>jar</type>
+ <url>http://directory.apache.org/directory/ldap/common</url>
+ </dependency>
+ <dependency>
+ <groupId>directory-asn1</groupId>
+ <artifactId>asn1-new-ber</artifactId>
+ <version>0.3.2-SNAPSHOT</version>
+ <type>jar</type>
+ <url>http://directory.apache.org/subprojects/asn1/ber</url>
+ </dependency>
+ <dependency>
+ <groupId>regexp</groupId>
+ <artifactId>regexp</artifactId>
+ <version>1.2</version>
+ <type>jar</type>
+ <url>http://jakarta.apache.org/regexp/index.html</url>
+ <properties>
+ <gump.project>jakarta-regexp</gump.project>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>2.7.2</version>
+ <type>jar</type>
+ <url>http://antlr.org</url>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <type>jar</type>
+ <url>http://junit.org</url>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>2.0.2</version>
+ <type>jar</type>
+ <url>http://jakarta.apache.org/commons/httpclient/apidocs</url>
+ </dependency>
+ </dependencies>
+</project>
+
Propchange: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/project.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixDecoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixDecoder.java?rev=279887&view=auto
==============================================================================
--- directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixDecoder.java (added)
+++ directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixDecoder.java Fri Sep 9 14:41:22 2005
@@ -0,0 +1,248 @@
+package org.apache.asn1new.ldap;
+
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+
+import org.apache.asn1.codec.DecoderException;
+import org.apache.asn1.codec.stateful.DecoderCallback;
+import org.apache.asn1.codec.stateful.DecoderMonitor;
+import org.apache.asn1new.ber.Asn1Decoder;
+import org.apache.asn1new.ber.tlv.TLVStateEnum;
+import org.apache.asn1new.ldap.codec.LdapDecoder;
+import org.apache.asn1new.ldap.codec.LdapMessageContainer;
+import org.apache.asn1new.util.StringUtils;
+import org.apache.ldap.common.message.spi.Provider;
+import org.apache.ldap.common.message.spi.ProviderDecoder;
+import org.apache.ldap.common.message.spi.ProviderException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TwixDecoder implements ProviderDecoder {
+ /** The logger */
+ private static Logger log = LoggerFactory.getLogger( TwixDecoder.class );
+
+ /** The associated Provider */
+ private final Provider provider;
+
+ /** The message container for this instance */
+ private final LdapMessageContainer ldapMessageContainer;
+
+ /** The Ldap BDER decoder instance */
+ private final Asn1Decoder ldapDecoder;
+
+ /** The callback to call when the decoding is done */
+ private DecoderCallback decoderCallback;
+
+ /**
+ * Creates an instance of a Twix Decoder implementation.
+ *
+ * @param provider the owning provider.
+ */
+ public TwixDecoder( Provider provider )
+ {
+ this.provider = provider;
+ ldapMessageContainer = new LdapMessageContainer();
+ ldapDecoder = new LdapDecoder();
+ }
+
+ /**
+ * Decodes a PDU
+ *
+ * @param encoded The PDU containing the LdapMessage to decode
+ *
+ * @throws DecoderException If anything went wrong
+ */
+ public void decode( Object encoded ) throws DecoderException
+ {
+ ByteBuffer buf = null;
+
+ if ( encoded instanceof ByteBuffer )
+ {
+ buf = ( ByteBuffer ) encoded;
+ }
+ else if ( encoded instanceof byte[] )
+ {
+ buf = ByteBuffer.wrap( ( byte[] ) encoded );
+ }
+ else
+ {
+ throw new DecoderException( "Expected either a byte[] or " +
+ "ByteBuffer argument but got a " + encoded.getClass() );
+ }
+
+ if (log.isDebugEnabled())
+ {
+ log.debug( "Decoding the PDU : " );
+
+ if (buf.hasArray())
+ {
+ log.debug( StringUtils.dumpBytes( buf.array() ) );
+ }
+ else
+ {
+ byte[] array = new byte[buf.capacity()];
+ int i = 0;
+
+ while ( buf.hasRemaining() )
+ {
+ array[i++] = buf.get();
+ }
+
+ buf.flip();
+ log.debug( StringUtils.dumpBytes( array ) );
+ }
+ }
+
+ ldapDecoder.decode( buf, ldapMessageContainer );
+
+ if ( ldapMessageContainer.getState() == TLVStateEnum.PDU_DECODED )
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "Decoded LdapMessage : " + ldapMessageContainer.getLdapMessage() );
+ }
+
+ decoderCallback.decodeOccurred( null, ldapMessageContainer.getLdapMessage() );
+ ldapMessageContainer.clean();
+ }
+ }
+
+ /**
+ * Feeds the bytes within the input stream to the digester to generate the
+ * resultant decoded Message.
+ *
+ * @param in The InputStream containing the PDU to be decoded
+ * @throws ProviderException If the decoding went wrong
+ */
+ private void digest( InputStream in )
+ throws ProviderException
+ {
+ byte[] buf = null;
+
+ try
+ {
+ int amount = -1;
+
+ while( in.available() > 0 )
+ {
+ buf = new byte[in.available()];
+
+ if ( ( amount = in.read( buf ) ) == -1 )
+ {
+ break;
+ }
+
+ ldapDecoder.decode( ByteBuffer.wrap( buf, 0, amount ), ldapMessageContainer );
+ }
+ }
+ catch( Exception e )
+ {
+ log.error( "Twix decoder failure : " + e.getMessage() );
+ ProviderException pe = new ProviderException( provider,
+ "Twix decoder failure!" ) ;
+ pe.addThrowable( e ) ;
+ throw pe ;
+ }
+ }
+
+ /**
+ * Decodes a PDU from an input stream into a Snickers compiler generated
+ * stub envelope.
+ *
+ * @param lock Lock object used to exclusively read from the input stream
+ * @param in The input stream to read and decode PDU bytes from
+ * @return return decoded stub
+ */
+ public Object decode( Object lock, InputStream in ) throws ProviderException
+ {
+ if( lock == null )
+ {
+ digest( in );
+
+ if ( ldapMessageContainer.getState() == TLVStateEnum.PDU_DECODED )
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.debug("Decoded LdapMessage : " + ldapMessageContainer.getLdapMessage() );
+ }
+
+ return ldapMessageContainer.getLdapMessage();
+ }
+ else
+ {
+ log.error( "Twix decoder failure, PDU does not contain enough data");
+ ProviderException pe = new ProviderException( provider, "Twix decoder failure!" ) ;
+ pe.addThrowable( new DecoderException( "The input stream does not contain a full PDU" ) ) ;
+ throw pe ;
+ }
+ }
+ else
+ {
+ try
+ {
+ // Synchronize on the input lock object to prevent concurrent reads
+ synchronized ( lock )
+ {
+ digest( in );
+
+ // Notify/awaken threads waiting to read from input stream
+ lock.notifyAll() ;
+ }
+ }
+ catch( Exception e )
+ {
+ log.error( "Twix decoder failure : " + e.getMessage() );
+ ProviderException pe = new ProviderException( provider,
+ "Twix decoder failure!" ) ;
+ pe.addThrowable( e ) ;
+ throw pe ;
+ }
+
+ if ( ldapMessageContainer.getState() == TLVStateEnum.PDU_DECODED )
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "Decoded LdapMessage : " + ldapMessageContainer.getLdapMessage() );
+ }
+
+ return ldapMessageContainer.getLdapMessage();
+ }
+ else
+ {
+ log.error( "Twix decoder failure : The input stream does not contain a full PDU" );
+ ProviderException pe = new ProviderException( provider, "Twix decoder failure!" ) ;
+ pe.addThrowable( new DecoderException( "The input stream does not contain a full PDU" ) ) ;
+ throw pe ;
+ }
+ }
+ }
+
+ /**
+ * Gets the Provider that this Decoder implementation is part of.
+ *
+ * @return the owning provider.
+ */
+ public Provider getProvider()
+ {
+ return provider ;
+ }
+
+ /**
+ * Not used ...
+ *
+ * @deprecated
+ */
+ public void setDecoderMonitor( DecoderMonitor monitor )
+ {
+ }
+
+ /**
+ * Set the callback to call when the PDU has been decoded
+ *
+ * @param cb The callback
+ */
+ public void setCallback( DecoderCallback cb )
+ {
+ decoderCallback = cb;
+ }
+}
Propchange: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixDecoder.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixEncoder.java?rev=279887&view=auto
==============================================================================
--- directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixEncoder.java (added)
+++ directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixEncoder.java Fri Sep 9 14:41:22 2005
@@ -0,0 +1,256 @@
+/*
+ * 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.asn1new.ldap;
+
+import org.apache.asn1.codec.EncoderException;
+import org.apache.asn1.codec.stateful.EncoderCallback;
+import org.apache.asn1.codec.stateful.EncoderMonitor;
+import org.apache.asn1.codec.stateful.StatefulEncoder;
+import org.apache.asn1new.ldap.pojo.LdapMessage;
+import org.apache.asn1new.util.StringUtils;
+import org.apache.ldap.common.message.spi.Provider;
+import org.apache.ldap.common.message.spi.ProviderEncoder;
+import org.apache.ldap.common.message.spi.ProviderException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.Channels;
+import java.nio.channels.WritableByteChannel;
+
+
+/**
+ * Twix LDAP BER provider's encoder.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev: 158973 $
+ */
+public class TwixEncoder implements ProviderEncoder
+{
+ /** The logger */
+ private static Logger log = LoggerFactory.getLogger( TwixEncoder.class );
+
+ /** The associated Provider */
+ private final Provider provider;
+
+ /** The callback to call when the encoding is done */
+ private EncoderCallback encodeCallback;
+
+ /**
+ * Creates an instance of a Twix Encoder implementation.
+ *
+ * @param provider The associated Provider
+ */
+ public TwixEncoder( Provider provider )
+ {
+ this.provider = provider;
+ encodeCallback = new OutputCallback();
+ }
+
+ /**
+ * Encodes a LdapMessage, and calls the callback.
+ *
+ * @param lock Not used...
+ * @param out Not used ...
+ * @param obj The LdapMessage to encode
+ *
+ * @throws ProviderException If anything went wrong
+ */
+ public void encodeBlocking( Object lock, OutputStream out, Object obj )
+ throws ProviderException
+ {
+ try
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug( "Encoding this LdapMessage : " + obj );
+ }
+
+ encodeCallback.encodeOccurred( null, ( (LdapMessage)obj ).encode( null ) );
+ }
+ catch ( EncoderException e )
+ {
+ log.error( "Twix encoder failed to encode object: " + obj );
+ ProviderException pe = new ProviderException( provider,
+ "Twix encoder failed to encode object: " + obj );
+ throw pe;
+ }
+ }
+
+ /**
+ * Encodes a LdapMessage, and return a ByteBuffer containing the
+ * resulting PDU
+ *
+ * @param obj The LdapMessage to encode
+ * @return The ByteBuffer containing the PDU
+ * @throws ProviderException If anything went wrong
+ */
+ public ByteBuffer encodeBlocking( Object obj ) throws ProviderException
+ {
+ try
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug( "Encoding this LdapMessage : " + obj );
+ }
+
+ ByteBuffer pdu = ( (LdapMessage)obj ).encode( null );
+
+ if (log.isDebugEnabled())
+ {
+ log.debug( "Encoded PDU : " + StringUtils.dumpBytes( pdu.array() ) );
+ pdu.flip();
+ }
+
+ return pdu;
+ }
+ catch ( EncoderException e )
+ {
+ log.error( "Twix encoder failed to encode object: " + obj );
+ ProviderException pe = new ProviderException( provider,
+ "Twix encoder failed to encode object: " + obj );
+ throw pe;
+ }
+ }
+
+ /**
+ * Encodes a LdapMessage, and return a byte array containing the
+ * resulting PDU
+ *
+ * @param obj The LdapMessage to encode
+ * @return The byte[] containing the PDU
+ * @throws ProviderException If anything went wrong
+ */
+ public byte[] encodeToArray( Object obj ) throws ProviderException
+ {
+ try
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug( "Encoding this LdapMessage : " + obj );
+ }
+
+ byte[] pdu = ( (LdapMessage)obj ).encode( null ).array();
+
+ if (log.isDebugEnabled())
+ {
+ log.debug( "Encoded PDU : " + StringUtils.dumpBytes( pdu ) );
+ }
+
+ return pdu;
+ }
+ catch ( EncoderException e )
+ {
+ log.error( "Twix encoder failed to encode object: " + obj );
+ ProviderException pe = new ProviderException( provider,
+ "Twix encoder failed to encode object: " + obj );
+ throw pe;
+ }
+ }
+
+ /**
+ * Gets the Provider associated with this SPI implementation object.
+ *
+ * @return Provider The provider
+ */
+ public Provider getProvider()
+ {
+ return provider;
+ }
+
+ /**
+ * Encodes a LdapMessage, and calls the callback
+ *
+ * @param obj The LdapMessage to encode
+ * @throws EncoderException If anything went wrong
+ */
+ public void encode( Object obj ) throws EncoderException
+ {
+ ByteBuffer encoded = encodeBlocking( obj );
+ encodeCallback.encodeOccurred( null, encoded.flip() );
+ }
+
+ /**
+ * Set the callback called when the encoding is done.
+ *
+ * @param cb The callback.
+ */
+ public void setCallback( EncoderCallback cb )
+ {
+ encodeCallback = cb;
+ }
+
+ /**
+ * Not used ...
+ *
+ * @deprecated
+ */
+ public void setEncoderMonitor( EncoderMonitor monitor )
+ {
+ }
+
+ /**
+ * The inner class used to write the PDU to a channel.
+ */
+ class OutputCallback implements EncoderCallback
+ {
+ /** The channel in which the PDU will be written */
+ private WritableByteChannel channel = null;
+
+ /**
+ * Callback to deliver a fully encoded object.
+ *
+ * @param encoder the stateful encoder driving the callback
+ * @param encoded the object that was encoded
+ */
+ public void encodeOccurred( StatefulEncoder encoder, Object encoded )
+ {
+ try
+ {
+ channel.write( ( ByteBuffer ) encoded );
+ }
+ catch ( IOException e )
+ {
+ ProviderException pe = new ProviderException( provider,
+ "Twix encoder failed to write object ");
+ throw pe;
+ }
+ }
+
+ /**
+ * Associate a channel to the callback
+ * @param channel The channel to use to write a PDU
+ */
+ void attach( WritableByteChannel channel )
+ {
+ this.channel = channel;
+ }
+
+ /**
+ * Associate a OutputStream to the callback. A channel
+ * will be created.
+ *
+ * @param out The OutputStream to use
+ */
+ void attach( OutputStream out )
+ {
+ this.channel = Channels.newChannel( out ) ;
+ }
+ }
+}
Propchange: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixEncoder.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixProvider.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixProvider.java?rev=279887&view=auto
==============================================================================
--- directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixProvider.java (added)
+++ directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixProvider.java Fri Sep 9 14:41:22 2005
@@ -0,0 +1,102 @@
+/*
+ * 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.asn1new.ldap;
+
+
+import org.apache.asn1new.ldap.TwixDecoder;
+import org.apache.ldap.common.message.spi.Provider;
+import org.apache.ldap.common.message.spi.ProviderDecoder;
+import org.apache.ldap.common.message.spi.ProviderEncoder;
+import org.apache.ldap.common.message.spi.ProviderException;
+import org.apache.ldap.common.message.spi.TransformerSpi;
+
+
+/**
+ * The Twix specific BER provider for LDAP.
+ *
+ * @author <a href="mailto:dev@directory.apache.org"> Apache Directory
+ * Project</a> $Rev: 157671 $
+ */
+public class TwixProvider extends Provider
+{
+ /** The Transformer for this provider */
+ private final TwixTransformer transformer;
+
+ /**
+ * Creates an instance of a Twix based LDAP BER Provider.
+ */
+ private TwixProvider()
+ {
+ super( "Twix LDAP BER Provider", "Apache Directory Project" );
+ transformer = new TwixTransformer( this );
+ }
+
+ /** the singleton TwixProvider instance */
+ private static TwixProvider singleton ;
+
+ /**
+ * Gets a handle on the singleton TwixProvider. Only one instance should
+ * have to be instantiated for the entire jvm.
+ *
+ * @return the singleton SnaccProvider instance
+ */
+ public synchronized static Provider getProvider()
+ {
+ if ( singleton == null )
+ {
+ singleton = new TwixProvider() ;
+ }
+
+ return singleton ;
+ }
+
+ /**
+ * Gets the encoder associated with this provider.
+ *
+ * @return the provider's encoder.
+ * @throws org.apache.ldap.common.message.spi.ProviderException
+ * if the provider or its encoder cannot be found
+ */
+ public ProviderEncoder getEncoder() throws ProviderException
+ {
+ return new TwixEncoder( this );
+ }
+
+ /**
+ * Gets the decoder associated with this provider.
+ *
+ * @return the provider's decoder.
+ * @throws org.apache.ldap.common.message.spi.ProviderException
+ * if the provider or its decoder cannot be found
+ */
+ public ProviderDecoder getDecoder() throws ProviderException
+ {
+ return new TwixDecoder( this );
+ }
+
+ /**
+ * Gets the transformer associated with this provider.
+ *
+ * @return the provider's transformer.
+ * @throws org.apache.ldap.common.message.spi.ProviderException
+ * if the provider or its transformer cannot be found
+ */
+ public TransformerSpi getTransformer() throws ProviderException
+ {
+ return transformer;
+ }
+}
Propchange: directory/shared/ldap/branches/elecharny-cleanup/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixProvider.java
------------------------------------------------------------------------------
svn:eol-style = native