Return-Path: Delivered-To: apmail-incubator-directory-cvs-archive@www.apache.org Received: (qmail 57050 invoked from network); 13 Mar 2004 18:25:00 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 13 Mar 2004 18:25:00 -0000 Received: (qmail 36403 invoked by uid 500); 13 Mar 2004 18:24:51 -0000 Delivered-To: apmail-incubator-directory-cvs-archive@incubator.apache.org Received: (qmail 36361 invoked by uid 500); 13 Mar 2004 18:24:51 -0000 Mailing-List: contact directory-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk Reply-To: directory-dev@incubator.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list directory-cvs@incubator.apache.org Received: (qmail 36343 invoked from network); 13 Mar 2004 18:24:50 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 13 Mar 2004 18:24:50 -0000 Received: (qmail 56992 invoked by uid 1343); 13 Mar 2004 18:24:57 -0000 Date: 13 Mar 2004 18:24:57 -0000 Message-ID: <20040313182457.56989.qmail@minotaur.apache.org> From: akarasulu@apache.org To: directory-cvs@incubator.apache.org Subject: svn commit: rev 9431 - in incubator/directory/ldap/trunk/common: . src/antlr src/java/org/apache/ldap/common/filter src/java/org/apache/ldap/common/ldif src/java/org/apache/ldap/common/message src/java/org/apache/ldap/common/name X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Sat Mar 13 07:45:13 2004 New Revision: 9431 Modified: incubator/directory/ldap/trunk/common/project.xml incubator/directory/ldap/trunk/common/src/antlr/filter.g incubator/directory/ldap/trunk/common/src/antlr/valueparser.g incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/filter/FilterParser.java incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/filter/FilterParserImpl.java incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/ldif/LdifIterator.java incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/DerefAliasesEnum.java incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/LockableAttributesImpl.java incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/MessageTypeEnum.java incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ResultCodeEnum.java incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ScopeEnum.java incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/name/DnParser.java Log: started using commons classes as opposed equivalent framework ones Modified: incubator/directory/ldap/trunk/common/project.xml ============================================================================== --- incubator/directory/ldap/trunk/common/project.xml (original) +++ incubator/directory/ldap/trunk/common/project.xml Sat Mar 13 07:45:13 2004 @@ -9,127 +9,40 @@ SNAPSHOT - Apache Software Foundation - http://directory.apache.org - http://sourceforge.net/sflogo.php?group_id=64972&type=2 + The Apache Incubator + http://incubator.apache.org + /images/apache-incubator-logo.png - - 2002 + + 2003 org.apache.ldap.common - /../../images/ldapd-logo.gif + /images/apache-directory-logo.png + http://incubator.apache.org/directory - Common LDAP packages used for protocol compliant parsing of - distinguished names, LDIFs, filters, and urls. Also contains - the Common Message API which enables a plugable interface for - ASN.1 BER Message providers. + Common LDAP packages used for protocol compliant parsing of distinguished + names, LDIFs, filters, and urls. Also contains the Common Message API + which enables a plugable interface for ASN.1 BER Message codec providers. Common LDAP packages used by clients and servers. - http://ldapd.sourceforge.net/${module.path}modules/${module.name} - http://sourceforge.net/tracker?group_id=64792 - shell.sourceforge.net - - /home/groups/l/ld/ldapd/htdocs/${module.path}modules/${module.name} - - /home/groups/l/ld/ldapd/htdocs/dist - - - - scm:cvs:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ldapd:${module.name} - - - scm:cvs:ext:${maven.username}@cvs.sourceforge.net:/cvsroot/ldapd:${module.name} - - http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ldapd/${module.name}/ - - - - - ldapd-devel - http://lists.sourceforge.net/lists/listinfo/ldapd-devel - http://lists.sourceforge.net/lists/listinfo/ldapd-devel - http://sourceforge.net/mailarchive/forum.php?forum=ldapd-devel - - - - - - Alex Karasulu - akarasulu - akarasulu at users.sourceforge.net - - Founder - Developer - Architect - Lead Developer - - - - Robb Penoyer - rpenoyer - rpenoyer at users.sourceforge.net - - Developer - - - - Jim Bearce - bearcej - bearcej at users.sourceforge.net - - Project Manager - Developer - - - - Jeff Machols - jmachols - jmachols at users.sourceforget.net - - Developer - - - - Wes McKean - wesmckean - wesmckean at users.sourceforget.net - - Developer - - - - Peter Donald - donaldp - donaldp at users.sourceforge.net - - Advisor - Mentor - Consultant - - - - Noel Bergman - noeljb - noeljb at users.sourceforge.net - - Advisor - Mentor - Consultant - - - - commons-collections commons-collections 2.1 - http://jakarta.apache.org/commons/collections.html + http://jakarta.apache.org/commons/collections + + + + commons-lang + commons-lang + 2.0 + http://jakarta.apache.org/commons/lang @@ -144,20 +57,6 @@ antlr 2.7.2 http://antlr.org/ - - - - avalon-framework - avalon-framework-api - 4.1.5 - http://avalon.apache.org/framework/ - - - - avalon-framework - avalon-framework-impl - 4.1.5 - http://avalon.apache.org/framework/ Modified: incubator/directory/ldap/trunk/common/src/antlr/filter.g ============================================================================== --- incubator/directory/ldap/trunk/common/src/antlr/filter.g (original) +++ incubator/directory/ldap/trunk/common/src/antlr/filter.g Sat Mar 13 07:45:13 2004 @@ -1,106 +1,56 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. - */ - -// =================================================== -// -// -// +// ============================================================================ // -// LDAP FILTER PARSER // +// LDAP FILTER PARSER // // -// -// =================================================== -// $Id: filter.g,v 1.8 2003/10/13 18:08:08 akarasulu Exp $ -// $Author: akarasulu $ -// $Revision: 1.8 $ -// =================================================== - - +// ============================================================================ +// $Rev$ +// ============================================================================ header { - /* - * Keep the semicolon right next to org.apache.ldap.common.name or else there - * will be a bug that comes into the foreground in the new antlr release. - */ - package org.apache.ldap.common.filter; +/* + * 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. + * + */ +/* + * Keep the semicolon right next to org.apache.ldap.common.name.filter or + * else there will be a bug that comes into the foreground in the new antlr + * release. + */ +package org.apache.ldap.common.filter; - import java.util.* ; - import org.apache.avalon.framework.logger.* ; +import java.util.* ; } class antlrFilterLexer extends Lexer ; -options { - k = 4 ; - exportVocab=antlrFilter ; - charVocabulary = '\3'..'\377' ; - caseSensitive = false ; - //testLiterals = true ; - defaultErrorHandler = false ; +options { + k = 4 ; + exportVocab=antlrFilter ; + charVocabulary = '\3'..'\377' ; + caseSensitive = false ; + //testLiterals = true ; + defaultErrorHandler = false ; } WS : ( '#' (~'\n')* '\n' { newline(); } - | ' ' + | ' ' | '\t' | '\r' '\n' { newline(); } | '\n' { newline(); } @@ -109,46 +59,46 @@ {$setType(Token.SKIP);} //ignore this token ; -OPEN_PAREN : '(' - ; +OPEN_PAREN : '(' + ; -CLOSE_PAREN : ')' - ; +CLOSE_PAREN : ')' + ; -OPEN_BRACKET : '{' - ; +OPEN_BRACKET : '{' + ; -CLOSE_BRACKET : '}' - ; +CLOSE_BRACKET : '}' + ; -OR_OP : '|' - ; +OR_OP : '|' + ; -NOT_OP : '!' - ; +NOT_OP : '!' + ; -AND_OP : '&' - ; +AND_OP : '&' + ; -EQUAL_OP : '=' - ; +EQUAL_OP : '=' + ; -APPROX_OP : '~' '=' - ; +APPROX_OP : '~' '=' + ; -GREATER_OP : '>' '=' - ; +GREATER_OP : '>' '=' + ; -LESS_OP : '<' '=' - ; +LESS_OP : '<' '=' + ; -STAR_OP : '*' - ; +STAR_OP : '*' + ; -OID : - ( '0'..'9' )+ ( '.' ( '0'..'9' )+ )* - ( OPEN_BRACKET ('0' .. '9')+ CLOSE_BRACKET )? - ; +OID : + ( '0'..'9' )+ ( '.' ( '0'..'9' )+ )* + ( OPEN_BRACKET ('0' .. '9')+ CLOSE_BRACKET )? + ; IDENTIFIER options { testLiterals=true; } : @@ -158,305 +108,305 @@ class antlrFilterParser extends Parser ; -options { - k = 5 ; - defaultErrorHandler = false ; +options { + k = 5 ; + defaultErrorHandler = false ; } { - Logger log = null ; - - - public void debug( String a_msg ) - { - if ( null == log ) - { - //System.out.println( a_msg ) ; - } - else - { - log.debug( a_msg ) ; - } - } - - - public void enableLogging(Logger a_logger) - { - log = a_logger ; - } - + FilterParserMonitor monitor = null ; + + + public void matchedProduction( String a_msg ) + { + if ( null == monitor ) + { + //System.out.println( a_msg ) ; + } + else + { + monitor.matchedProduction( a_msg ) ; + } + } + + + public void setFilterParserMonitor( FilterParserMonitor monitor ) + { + this.monitor = monitor ; + } + } filter returns [ExprNode l_root] { - debug("filter()") ; - l_root = null ; + matchedProduction( "filter()" ) ; + l_root = null ; } - : - OPEN_PAREN l_root=filtercomp CLOSE_PAREN ; + : + OPEN_PAREN l_root=filtercomp CLOSE_PAREN ; filtercomp returns [ExprNode l_node] { - debug("filtercomp()") ; - l_node = null ; + matchedProduction("filtercomp()") ; + l_node = null ; } - : - l_node=and | l_node=or | l_node=not | l_node=item ; + : + l_node=and | l_node=or | l_node=not | l_node=item ; and returns [BranchNode l_node] { - debug( "and()" ) ; - l_node = null ; - ArrayList l_children = null ; -} - : - AND_OP l_children=filterlist - { - l_node = new BranchNode( BranchNode.AND ) ; - l_node.setChildren( l_children ) ; - } ; + matchedProduction( "and()" ) ; + l_node = null ; + ArrayList l_children = null ; +} + : + AND_OP l_children=filterlist + { + l_node = new BranchNode( BranchNode.AND ) ; + l_node.setChildren( l_children ) ; + } ; or returns [BranchNode l_node] { - debug( "or()" ) ; - l_node = null ; - ArrayList l_children = null ; -} - : - OR_OP l_children=filterlist - { - l_node = new BranchNode( BranchNode.OR ) ; - l_node.setChildren( l_children ) ; - } ; + matchedProduction( "or()" ) ; + l_node = null ; + ArrayList l_children = null ; +} + : + OR_OP l_children=filterlist + { + l_node = new BranchNode( BranchNode.OR ) ; + l_node.setChildren( l_children ) ; + } ; not returns [BranchNode l_node] { - debug( "not()" ) ; - l_node = null ; - ExprNode l_child = null ; -} - : - NOT_OP l_child=filter - { - l_node = new BranchNode( BranchNode.NOT ) ; - l_node.getChildren().add( l_child ) ; - } ; + matchedProduction( "not()" ) ; + l_node = null ; + ExprNode l_child = null ; +} + : + NOT_OP l_child=filter + { + l_node = new BranchNode( BranchNode.NOT ) ; + l_node.getChildren().add( l_child ) ; + } ; filterlist returns [ArrayList l_list] { - debug("filterlist()") ; - l_list = new ArrayList(2) ; - ExprNode l_node = null ; -} - : - l_node=filter - { - l_list.add(l_node) ; - } - ( l_node=filter - { - l_list.add(l_node) ; - } - )* ; + matchedProduction("filterlist()") ; + l_list = new ArrayList(2) ; + ExprNode l_node = null ; +} + : + l_node=filter + { + l_list.add(l_node) ; + } + ( l_node=filter + { + l_list.add(l_node) ; + } + )* ; item returns [ExprNode l_node] { - debug("item()") ; - l_node = null ; + matchedProduction("item()") ; + l_node = null ; } - : - l_node=simple | l_node=extensible | l_node=equalPresSubstr ; + : + l_node=simple | l_node=extensible | l_node=equalPresSubstr ; simple returns [SimpleNode l_node] { - debug("simple()") ; - l_node = null ; - int l_type = -1 ; -} - : - attr:IDENTIFIER l_type=simpletype ( val:IDENTIFIER )+ - { - l_node = new SimpleNode(attr.getText(), val.getText(), l_type) ; - } ; + matchedProduction("simple()") ; + l_node = null ; + int l_type = -1 ; +} + : + attr:IDENTIFIER l_type=simpletype ( val:IDENTIFIER )+ + { + l_node = new SimpleNode(attr.getText(), val.getText(), l_type) ; + } ; simpletype returns [int l_type] { - debug("simpletype()") ; - l_type = -1 ; + matchedProduction("simpletype()") ; + l_type = -1 ; } - : - //EQUAL_OP { l_type=LeafNode.EQUALITY ; } | - APPROX_OP { l_type=LeafNode.APPROXIMATE ; } | - GREATER_OP { l_type=LeafNode.GREATEREQ ; } | - LESS_OP { l_type=LeafNode.LESSEQ ; } ; + : + //EQUAL_OP { l_type=LeafNode.EQUALITY ; } | + APPROX_OP { l_type=LeafNode.APPROXIMATE ; } | + GREATER_OP { l_type=LeafNode.GREATEREQ ; } | + LESS_OP { l_type=LeafNode.LESSEQ ; } ; presence returns [PresenceNode l_node] { - debug("presence()") ; - l_node = null ; + matchedProduction("presence()") ; + l_node = null ; } - : - attr:IDENTIFIER EQUAL_OP STAR_OP - { - l_node = new PresenceNode(attr.getText()) ; - } ; + : + attr:IDENTIFIER EQUAL_OP STAR_OP + { + l_node = new PresenceNode(attr.getText()) ; + } ; substring returns [SubstringNode l_node] { - debug("substring()") ; - l_node = null ; - ArrayList l_anylist = new ArrayList() ; - String l_final = null ; -} - : - - // Choice #0 // - - attr0:IDENTIFIER EQUAL_OP ini0:IDENTIFIER STAR_OP - { - l_node = new + matchedProduction("substring()") ; + l_node = null ; + ArrayList l_anylist = new ArrayList() ; + String l_final = null ; +} + : + + // Choice #0 // + + attr0:IDENTIFIER EQUAL_OP ini0:IDENTIFIER STAR_OP + { + l_node = new SubstringNode(l_anylist, attr0.getText(), ini0.getText(), null) ; - } + } - | // Choice #1 // + | // Choice #1 // - attr1:IDENTIFIER EQUAL_OP - ( STAR_OP any1:IDENTIFIER - { - l_anylist.add(any1.getText()) ; - } - )+ - { - if(l_anylist.size() > 0) { - l_final = (String) l_anylist.get(l_anylist.size() - 1) ; - } - - l_node = new SubstringNode(l_anylist, attr1.getText(), null, l_final) ; - } - - | // Choice #2 // - - attr2:IDENTIFIER EQUAL_OP ini2:IDENTIFIER - ( STAR_OP any2:IDENTIFIER - { - l_anylist.add(any2.getText()) ; - } - )+ - { - if(l_anylist.size() > 0) { - l_final = (String) l_anylist.get(l_anylist.size() - 1) ; - } + attr1:IDENTIFIER EQUAL_OP + ( STAR_OP any1:IDENTIFIER + { + l_anylist.add(any1.getText()) ; + } + )+ + { + if(l_anylist.size() > 0) { + l_final = (String) l_anylist.get(l_anylist.size() - 1) ; + } + + l_node = new SubstringNode(l_anylist, attr1.getText(), null, l_final) ; + } + + | // Choice #2 // + + attr2:IDENTIFIER EQUAL_OP ini2:IDENTIFIER + ( STAR_OP any2:IDENTIFIER + { + l_anylist.add(any2.getText()) ; + } + )+ + { + if(l_anylist.size() > 0) { + l_final = (String) l_anylist.get(l_anylist.size() - 1) ; + } - l_node = new SubstringNode(l_anylist, attr2.getText(), + l_node = new SubstringNode(l_anylist, attr2.getText(), ini2.getText(), l_final) ; - } + } - ; + ; equalPresSubstr returns [LeafNode l_node] { - debug("equalPresSubstr()") ; - l_node = null ; - ArrayList l_anylist = new ArrayList() ; - String l_final = null ; - StringBuffer l_buf = new StringBuffer() ; -} - : - - // Choice #0 // - - attr0:IDENTIFIER EQUAL_OP ini0:IDENTIFIER STAR_OP - { - debug("equalPresSubstr(Choice #0)") ; - l_node = new SubstringNode(l_anylist, attr0.getText(), + matchedProduction("equalPresSubstr()") ; + l_node = null ; + ArrayList l_anylist = new ArrayList() ; + String l_final = null ; + StringBuffer l_buf = new StringBuffer() ; +} + : + + // Choice #0 // + + attr0:IDENTIFIER EQUAL_OP ini0:IDENTIFIER STAR_OP + { + matchedProduction("equalPresSubstr(Choice #0)") ; + l_node = new SubstringNode(l_anylist, attr0.getText(), ini0.getText(), null) ; - } + } - | // Choice #1 // + | // Choice #1 // - attr1:IDENTIFIER EQUAL_OP - ( STAR_OP any1:IDENTIFIER - { - l_anylist.add(any1.getText()) ; - } - )+ - { - debug("equalPresSubstr(Choice #1)") ; - if(l_anylist.size() > 0) { - l_final = (String) l_anylist.get(l_anylist.size() - 1) ; - } - - l_node = new SubstringNode(l_anylist, attr1.getText(), null, l_final) ; - } - - | // Choice #2 // - - attr2:IDENTIFIER EQUAL_OP ini2:IDENTIFIER - ( STAR_OP any2:IDENTIFIER - { - l_anylist.add(any2.getText()) ; - } - )+ - { - debug("equalPresSubstr(Choice #2)") ; - if(l_anylist.size() > 0) { - l_final = (String) l_anylist.get(l_anylist.size() - 1) ; - } + attr1:IDENTIFIER EQUAL_OP + ( STAR_OP any1:IDENTIFIER + { + l_anylist.add(any1.getText()) ; + } + )+ + { + matchedProduction("equalPresSubstr(Choice #1)") ; + if(l_anylist.size() > 0) { + l_final = (String) l_anylist.get(l_anylist.size() - 1) ; + } + + l_node = new SubstringNode(l_anylist, attr1.getText(), null, l_final) ; + } + + | // Choice #2 // + + attr2:IDENTIFIER EQUAL_OP ini2:IDENTIFIER + ( STAR_OP any2:IDENTIFIER + { + l_anylist.add(any2.getText()) ; + } + )+ + { + matchedProduction("equalPresSubstr(Choice #2)") ; + if(l_anylist.size() > 0) { + l_final = (String) l_anylist.get(l_anylist.size() - 1) ; + } - l_node = new SubstringNode(l_anylist, attr2.getText(), + l_node = new SubstringNode(l_anylist, attr2.getText(), ini2.getText(), l_final) ; - } + } - | // Choice #3 // + | // Choice #3 // - attr3:IDENTIFIER EQUAL_OP val3:IDENTIFIER - { - l_buf.append(val3.getText()) ; - } - ( more3:IDENTIFIER - { - l_buf.append(' ') ; - l_buf.append(more3.getText()) ; - } - )* - { - debug("equalPresSubstr(Choice #3)") ; - l_node = new SimpleNode(attr3.getText(), l_buf.toString(), + attr3:IDENTIFIER EQUAL_OP val3:IDENTIFIER + { + l_buf.append(val3.getText()) ; + } + ( more3:IDENTIFIER + { + l_buf.append(' ') ; + l_buf.append(more3.getText()) ; + } + )* + { + matchedProduction("equalPresSubstr(Choice #3)") ; + l_node = new SimpleNode(attr3.getText(), l_buf.toString(), LeafNode.EQUALITY) ; - } + } - | // Choice #4 // + | // Choice #4 // - attr4:IDENTIFIER EQUAL_OP STAR_OP - { - debug("equalPresSubstr(Choice #4)") ; - l_node = new PresenceNode(attr4.getText()) ; - } + attr4:IDENTIFIER EQUAL_OP STAR_OP + { + matchedProduction("equalPresSubstr(Choice #4)") ; + l_node = new PresenceNode(attr4.getText()) ; + } - ; + ; @@ -472,15 +422,15 @@ extensible returns [ExtensibleNode l_node] { - debug("extensible()") ; - l_node = null ; - boolean dnAttributes = false ; -} - : - attr:IDENTIFIER ( ":dn" - { dnAttributes = true ; } - ) ":" oid:OID ":=" val:IDENTIFIER - { - l_node = new ExtensibleNode(attr.getText(), val.getText(), + matchedProduction("extensible()") ; + l_node = null ; + boolean dnAttributes = false ; +} + : + attr:IDENTIFIER ( ":dn" + { dnAttributes = true ; } + ) ":" oid:OID ":=" val:IDENTIFIER + { + l_node = new ExtensibleNode(attr.getText(), val.getText(), oid.getText(), dnAttributes) ; - } ; + } ; Modified: incubator/directory/ldap/trunk/common/src/antlr/valueparser.g ============================================================================== --- incubator/directory/ldap/trunk/common/src/antlr/valueparser.g (original) +++ incubator/directory/ldap/trunk/common/src/antlr/valueparser.g Sat Mar 13 07:45:13 2004 @@ -1,70 +1,28 @@ -/* ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2000 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Apache" and "Apache Software Foundation" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache", - * nor may "Apache" appear in their name, without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== +header { +/* + * Copyright 2004 The Apache Software Foundation * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . + * 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. * - * Portions of this software are based upon public domain software - * originally written at the National Center for Supercomputing Applications, - * University of Illinois, Urbana-Champaign. */ +/* + * Keep the semicolon right next to org.apache.ldap.common.name or else there + * will be a bug that comes into the foreground in the new antlr release. + */ +package org.apache.ldap.common.name; -header { - /* - * Keep the semicolon right next to org.apache.ldap.common.name or else there - * will be a bug that comes into the foreground in the new antlr release. - */ - package org.apache.ldap.common.name; - - import javax.naming.NamingException ; - import org.apache.avalon.framework.CascadingRuntimeException ; +import javax.naming.NamingException ; +import org.apache.commons.lang.exception.NestableRuntimeException ; } class antlrValueParser extends Parser ; @@ -168,5 +126,5 @@ catch [ NamingException ne ] { // Wrap exception in a CascadingRuntimeException to bubble it up. - throw new CascadingRuntimeException( "Failed normalization!", ne ) ; + throw new NestableRuntimeException( "Failed normalization!", ne ) ; } Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/filter/FilterParser.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/filter/FilterParser.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/filter/FilterParser.java Sat Mar 13 07:45:13 2004 @@ -1,235 +1,35 @@ -/* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, - * and distribution as defined by Sections 1 through 9 of this document. - * - * "Licensor" shall mean the copyright owner or entity authorized by - * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all - * other entities that control, are controlled by, or are under common - * control with that entity. For the purposes of this definition, - * "control" means (i) the power, direct or indirect, to cause the - * direction or management of such entity, whether by contract or - * otherwise, or (ii) ownership of fifty percent (50%) or more of the - * outstanding shares, or (iii) beneficial ownership of such entity. - * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, - * including but not limited to software source code, documentation - * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or - * Object form, made available under the License, as indicated by a - * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object - * form, that is based on (or derived from) the Work and for which the - * editorial revisions, annotations, elaborations, or other modifications - * represent, as a whole, an original work of authorship. For the purposes - * of this License, Derivative Works shall not include works that remain - * separable from, or merely link (or bind by name) to the interfaces of, - * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions - * to that Work or Derivative Works thereof, that is intentionally - * submitted to Licensor for inclusion in the Work by the copyright owner - * or by an individual or Legal Entity authorized to submit on behalf of - * the copyright owner. For the purposes of this definition, "submitted" - * means any form of electronic, verbal, or written communication sent - * to the Licensor or its representatives, including but not limited to - * communication on electronic mailing lists, source code control systems, - * and issue tracking systems that are managed by, or on behalf of, the - * Licensor for the purpose of discussing and improving the Work, but - * excluding communication that is conspicuously marked or otherwise - * designated in writing by the copyright owner as "Not a Contribution." - * - * "Contributor" shall mean Licensor and any individual or Legal Entity - * on behalf of whom a Contribution has been received by Licensor and - * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the - * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * (except as stated in this section) patent license to make, have made, - * use, offer to sell, sell, import, and otherwise transfer the Work, - * where such license applies only to those patent claims licensable - * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) - * with the Work to which such Contribution(s) was submitted. If You - * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work - * or a Contribution incorporated within the Work constitutes direct - * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate - * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the - * Work or Derivative Works thereof in any medium, with or without - * modifications, and in Source or Object form, provided that You - * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices - * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works - * that You distribute, all copyright, patent, trademark, and - * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of - * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must - * include a readable copy of the attribution notices contained - * within such NOTICE file, excluding those notices that do not - * pertain to any part of the Derivative Works, in at least one - * of the following places: within a NOTICE text file distributed - * as part of the Derivative Works; within the Source form or - * documentation, if provided along with the Derivative Works; or, - * within a display generated by the Derivative Works, if and - * wherever such third-party notices normally appear. The contents - * of the NOTICE file are for informational purposes only and - * do not modify the License. You may add Your own attribution - * notices within Derivative Works that You distribute, alongside - * or as an addendum to the NOTICE text from the Work, provided - * that such additional attribution notices cannot be construed - * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and - * may provide additional or different license terms and conditions - * for use, reproduction, or distribution of Your modifications, or - * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with - * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, - * any Contribution intentionally submitted for inclusion in the Work - * by You to the Licensor shall be under the terms and conditions of - * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify - * the terms of any separate license agreement you may have executed - * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade - * names, trademarks, service marks, or product names of the Licensor, - * except as required for reasonable and customary use in describing the - * origin of the Work and reproducing the content of the NOTICE file. - * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied, including, without limitation, any warranties or conditions - * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the - * appropriateness of using or redistributing the Work and assume any - * risks associated with Your exercise of permissions under this License. - * - * 8. Limitation of Liability. In no event and under no legal theory, - * whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law (such as deliberate and grossly - * negligent acts) or agreed to in writing, shall any Contributor be - * liable to You for damages, including any direct, indirect, special, - * incidental, or consequential damages of any character arising as a - * result of this License or out of the use or inability to use the - * Work (including but not limited to damages for loss of goodwill, - * work stoppage, computer failure or malfunction, or any and all - * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing - * the Work or Derivative Works thereof, You may choose to offer, - * and charge a fee for, acceptance of support, warranty, indemnity, - * or other liability obligations and/or rights consistent with this - * License. However, in accepting such obligations, You may act only - * on Your own behalf and on Your sole responsibility, not on behalf - * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason - * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following - * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include - * the brackets!) The text should be enclosed in the appropriate - * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the - * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] [name of copyright owner] - * - * 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. - * - */ - /* - * $Id: FilterParser.java,v 1.5 2003/07/31 19:27:18 akarasulu Exp $ + * 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 * - * -- (c) LDAPd Group -- - * -- Please refer to the LICENSE.txt file in the root directory of -- - * -- any LDAPd project for copyright and distribution information. -- + * 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.ldap.common.filter ; import java.io.IOException ; import java.text.ParseException ; -import org.apache.avalon.framework.logger.LogEnabled ; /** * Parses an LDAP Filter expression as specified by RFC 2255 into a filter * expression tree. * - * @author Alex Karasulu - * @author $Author: akarasulu $ - * @version $Revision: 1.5 $ + * @author + * Apache Directory Project + * @version $Rev$ */ public interface FilterParser - extends LogEnabled { /** * Parses a search filter string into a filter expression tree. @@ -241,4 +41,11 @@ */ ExprNode parse( String a_filter ) throws IOException, ParseException ; + + /** + * Sets the monitor for this filter parser. + * + * @param monitor monitor that recieves parser events + */ + void setFilterParserMonitor( FilterParserMonitor monitor ) ; } Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/filter/FilterParserImpl.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/filter/FilterParserImpl.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/filter/FilterParserImpl.java Sat Mar 13 07:45:13 2004 @@ -1,217 +1,19 @@ -/* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, - * and distribution as defined by Sections 1 through 9 of this document. - * - * "Licensor" shall mean the copyright owner or entity authorized by - * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all - * other entities that control, are controlled by, or are under common - * control with that entity. For the purposes of this definition, - * "control" means (i) the power, direct or indirect, to cause the - * direction or management of such entity, whether by contract or - * otherwise, or (ii) ownership of fifty percent (50%) or more of the - * outstanding shares, or (iii) beneficial ownership of such entity. - * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, - * including but not limited to software source code, documentation - * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or - * Object form, made available under the License, as indicated by a - * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object - * form, that is based on (or derived from) the Work and for which the - * editorial revisions, annotations, elaborations, or other modifications - * represent, as a whole, an original work of authorship. For the purposes - * of this License, Derivative Works shall not include works that remain - * separable from, or merely link (or bind by name) to the interfaces of, - * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions - * to that Work or Derivative Works thereof, that is intentionally - * submitted to Licensor for inclusion in the Work by the copyright owner - * or by an individual or Legal Entity authorized to submit on behalf of - * the copyright owner. For the purposes of this definition, "submitted" - * means any form of electronic, verbal, or written communication sent - * to the Licensor or its representatives, including but not limited to - * communication on electronic mailing lists, source code control systems, - * and issue tracking systems that are managed by, or on behalf of, the - * Licensor for the purpose of discussing and improving the Work, but - * excluding communication that is conspicuously marked or otherwise - * designated in writing by the copyright owner as "Not a Contribution." - * - * "Contributor" shall mean Licensor and any individual or Legal Entity - * on behalf of whom a Contribution has been received by Licensor and - * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the - * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * (except as stated in this section) patent license to make, have made, - * use, offer to sell, sell, import, and otherwise transfer the Work, - * where such license applies only to those patent claims licensable - * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) - * with the Work to which such Contribution(s) was submitted. If You - * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work - * or a Contribution incorporated within the Work constitutes direct - * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate - * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the - * Work or Derivative Works thereof in any medium, with or without - * modifications, and in Source or Object form, provided that You - * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices - * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works - * that You distribute, all copyright, patent, trademark, and - * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of - * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must - * include a readable copy of the attribution notices contained - * within such NOTICE file, excluding those notices that do not - * pertain to any part of the Derivative Works, in at least one - * of the following places: within a NOTICE text file distributed - * as part of the Derivative Works; within the Source form or - * documentation, if provided along with the Derivative Works; or, - * within a display generated by the Derivative Works, if and - * wherever such third-party notices normally appear. The contents - * of the NOTICE file are for informational purposes only and - * do not modify the License. You may add Your own attribution - * notices within Derivative Works that You distribute, alongside - * or as an addendum to the NOTICE text from the Work, provided - * that such additional attribution notices cannot be construed - * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and - * may provide additional or different license terms and conditions - * for use, reproduction, or distribution of Your modifications, or - * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with - * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, - * any Contribution intentionally submitted for inclusion in the Work - * by You to the Licensor shall be under the terms and conditions of - * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify - * the terms of any separate license agreement you may have executed - * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade - * names, trademarks, service marks, or product names of the Licensor, - * except as required for reasonable and customary use in describing the - * origin of the Work and reproducing the content of the NOTICE file. - * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied, including, without limitation, any warranties or conditions - * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the - * appropriateness of using or redistributing the Work and assume any - * risks associated with Your exercise of permissions under this License. - * - * 8. Limitation of Liability. In no event and under no legal theory, - * whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law (such as deliberate and grossly - * negligent acts) or agreed to in writing, shall any Contributor be - * liable to You for damages, including any direct, indirect, special, - * incidental, or consequential damages of any character arising as a - * result of this License or out of the use or inability to use the - * Work (including but not limited to damages for loss of goodwill, - * work stoppage, computer failure or malfunction, or any and all - * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing - * the Work or Derivative Works thereof, You may choose to offer, - * and charge a fee for, acceptance of support, warranty, indemnity, - * or other liability obligations and/or rights consistent with this - * License. However, in accepting such obligations, You may act only - * on Your own behalf and on Your sole responsibility, not on behalf - * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason - * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following - * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include - * the brackets!) The text should be enclosed in the appropriate - * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the - * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] [name of copyright owner] - * - * 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. - * - */ - /* - * $Id: FilterParserImpl.java,v 1.7 2003/08/22 02:32:19 akarasulu Exp $ + * 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 * - * -- (c) LDAPd Group -- - * -- Please refer to the LICENSE.txt file in the root directory of -- - * -- any LDAPd project for copyright and distribution information. -- + * 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.ldap.common.filter ; @@ -219,14 +21,11 @@ import java.text.ParseException ; import java.io.PipedInputStream ; import java.io.PipedOutputStream ; + +import org.apache.commons.lang.exception.ExceptionUtils ; import antlr.RecognitionException ; -import antlr.TokenStreamException ; - -import org.apache.avalon.framework.ExceptionUtil ; -import org.apache.avalon.framework.logger.Logger ; -import org.apache.avalon.framework.logger.ConsoleLogger ; -import org.apache.avalon.framework.logger.AbstractLogEnabled ; +import antlr.TokenStreamException ; /** @@ -237,14 +36,14 @@ * @version $Revision: 1.7 $ */ public class FilterParserImpl - extends AbstractLogEnabled implements FilterParser -{ +{ + private FilterParserMonitor monitor = new FilterParserMonitorAdapter() ; /** The antlr generated parser */ private antlrFilterParser m_parser = null ; /** A pipe into the parser */ private PipedOutputStream m_parserIn = null ; - + /** * Creates an instance of FilterParserImpl. @@ -276,19 +75,6 @@ /** - * Enables logging for this filter parser implementation. - * - * @see org.apache.avalon.framework.logger.LogEnabled#enableLogging( - * org.apache.avalon.framework.logger.Logger) - */ - public void enableLogging( Logger a_logger ) - { - super.enableLogging( a_logger ) ; - m_parser.enableLogging( a_logger ) ; - } - - - /** * Thread safe method parses a_filter. * * @see org.apache.ldap.common.filter.FilterParser#parse(java.lang.String) @@ -304,15 +90,9 @@ + "the empty String!", 0 ) ; } - /* - * If this class is not used within an Avalon container but standalone - * w/i clients we want to make sure we have a valid logger to console - */ - if ( null == getLogger() ) - { - Logger l_logger = new ConsoleLogger() ; - enableLogging( l_logger ) ; - m_parser.enableLogging( l_logger ) ; + if ( null == monitor ) + { + monitor = new FilterParserMonitorAdapter() ; } m_parserIn.write( a_filter.getBytes() ) ; @@ -327,7 +107,7 @@ { String l_msg = "Parser failure on filter:\n\t" + a_filter ; l_msg += "\nAntlr exception trace:\n" - + ExceptionUtil.printStackTrace( e ) ; + + ExceptionUtils.getFullStackTrace( e ) ; init() ; throw new ParseException( l_msg, e.getColumn() ) ; } @@ -335,11 +115,21 @@ { String l_msg = "Parser failure on filter:\n\t" + a_filter ; l_msg += "\nAntlr exception trace:\n" - + ExceptionUtil.printStackTrace( e2 ) ; + + ExceptionUtils.getFullStackTrace( e2 ) ; init() ; throw new ParseException( l_msg, 0 ) ; } return l_root ; + } + + + /* (non-Javadoc) + * @see org.apache.ldap.common.filter.FilterParser#setFilterParserMonitor( + * org.apache.ldap.common.filter.FilterParserMonitor) + */ + public void setFilterParserMonitor( FilterParserMonitor monitor ) + { + this.monitor = monitor ; } } Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/ldif/LdifIterator.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/ldif/LdifIterator.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/ldif/LdifIterator.java Sat Mar 13 07:45:13 2004 @@ -1,193 +1,5 @@ /* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, - * and distribution as defined by Sections 1 through 9 of this document. - * - * "Licensor" shall mean the copyright owner or entity authorized by - * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all - * other entities that control, are controlled by, or are under common - * control with that entity. For the purposes of this definition, - * "control" means (i) the power, direct or indirect, to cause the - * direction or management of such entity, whether by contract or - * otherwise, or (ii) ownership of fifty percent (50%) or more of the - * outstanding shares, or (iii) beneficial ownership of such entity. - * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, - * including but not limited to software source code, documentation - * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or - * Object form, made available under the License, as indicated by a - * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object - * form, that is based on (or derived from) the Work and for which the - * editorial revisions, annotations, elaborations, or other modifications - * represent, as a whole, an original work of authorship. For the purposes - * of this License, Derivative Works shall not include works that remain - * separable from, or merely link (or bind by name) to the interfaces of, - * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions - * to that Work or Derivative Works thereof, that is intentionally - * submitted to Licensor for inclusion in the Work by the copyright owner - * or by an individual or Legal Entity authorized to submit on behalf of - * the copyright owner. For the purposes of this definition, "submitted" - * means any form of electronic, verbal, or written communication sent - * to the Licensor or its representatives, including but not limited to - * communication on electronic mailing lists, source code control systems, - * and issue tracking systems that are managed by, or on behalf of, the - * Licensor for the purpose of discussing and improving the Work, but - * excluding communication that is conspicuously marked or otherwise - * designated in writing by the copyright owner as "Not a Contribution." - * - * "Contributor" shall mean Licensor and any individual or Legal Entity - * on behalf of whom a Contribution has been received by Licensor and - * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the - * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * (except as stated in this section) patent license to make, have made, - * use, offer to sell, sell, import, and otherwise transfer the Work, - * where such license applies only to those patent claims licensable - * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) - * with the Work to which such Contribution(s) was submitted. If You - * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work - * or a Contribution incorporated within the Work constitutes direct - * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate - * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the - * Work or Derivative Works thereof in any medium, with or without - * modifications, and in Source or Object form, provided that You - * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices - * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works - * that You distribute, all copyright, patent, trademark, and - * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of - * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must - * include a readable copy of the attribution notices contained - * within such NOTICE file, excluding those notices that do not - * pertain to any part of the Derivative Works, in at least one - * of the following places: within a NOTICE text file distributed - * as part of the Derivative Works; within the Source form or - * documentation, if provided along with the Derivative Works; or, - * within a display generated by the Derivative Works, if and - * wherever such third-party notices normally appear. The contents - * of the NOTICE file are for informational purposes only and - * do not modify the License. You may add Your own attribution - * notices within Derivative Works that You distribute, alongside - * or as an addendum to the NOTICE text from the Work, provided - * that such additional attribution notices cannot be construed - * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and - * may provide additional or different license terms and conditions - * for use, reproduction, or distribution of Your modifications, or - * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with - * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, - * any Contribution intentionally submitted for inclusion in the Work - * by You to the Licensor shall be under the terms and conditions of - * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify - * the terms of any separate license agreement you may have executed - * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade - * names, trademarks, service marks, or product names of the Licensor, - * except as required for reasonable and customary use in describing the - * origin of the Work and reproducing the content of the NOTICE file. - * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied, including, without limitation, any warranties or conditions - * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the - * appropriateness of using or redistributing the Work and assume any - * risks associated with Your exercise of permissions under this License. - * - * 8. Limitation of Liability. In no event and under no legal theory, - * whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law (such as deliberate and grossly - * negligent acts) or agreed to in writing, shall any Contributor be - * liable to You for damages, including any direct, indirect, special, - * incidental, or consequential damages of any character arising as a - * result of this License or out of the use or inability to use the - * Work (including but not limited to damages for loss of goodwill, - * work stoppage, computer failure or malfunction, or any and all - * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing - * the Work or Derivative Works thereof, You may choose to offer, - * and charge a fee for, acceptance of support, warranty, indemnity, - * or other liability obligations and/or rights consistent with this - * License. However, in accepting such obligations, You may act only - * on Your own behalf and on Your sole responsibility, not on behalf - * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason - * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following - * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include - * the brackets!) The text should be enclosed in the appropriate - * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the - * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] [name of copyright owner] + * 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. @@ -202,36 +14,25 @@ * limitations under the License. * */ - -/* - * $Id: LdifIterator.java,v 1.5 2003/07/31 21:44:49 akarasulu Exp $ - * - * -- (c) LDAPd Group -- - * -- Please refer to the LICENSE.txt file in the root directory of -- - * -- any LDAPd project for copyright and distribution information. -- - * - */ package org.apache.ldap.common.ldif ; - -import java.io.BufferedReader ; + +import java.io.Reader ; import java.io.IOException ; -import java.io.InputStream ; +import java.io.InputStream ; +import java.io.BufferedReader ; import java.io.InputStreamReader ; -import java.io.Reader ; import java.util.Iterator ; -import org.apache.avalon.framework.logger.Logger ; - /** * Iterates through a set of LDIF's on a input channel. * - * @author Alex Karasulu - * @author $Author: akarasulu $ - * @version $Revision: 1.5 $ - */ + * @author + * Apache Directory Project + * @version $Rev$ + */ public class LdifIterator implements Iterator { /** whether or not debugging is enabled */ @@ -240,8 +41,8 @@ /** the prefetched LDIF record off of the stream */ private String m_prefetched = null ; - /** the logger used */ - private Logger m_logger = null ; + /** the monitor used */ + private LdifIteratorMonitor monitor = new LdifIteratorMonitorAdapter() ; /** input reader to read from */ private BufferedReader m_in = null ; @@ -253,28 +54,28 @@ /** * Creates a new LdifIterator object on a stream. * - * @param a_in the input stream to read from + * @param in the input stream to read from * * @throws IOException if we cannot wrap the stream with a reader */ - public LdifIterator( InputStream a_in ) + public LdifIterator( InputStream in ) throws IOException { - this( new InputStreamReader( a_in ) ) ; + this( new InputStreamReader( in ) ) ; } /** * Creates a new LdifIterator object on a reader. * - * @param a_in the reader to read from + * @param in the reader to read from * * @throws IOException if we cannot wrap the reader with a bufferd reader */ - public LdifIterator( Reader a_in ) + public LdifIterator( Reader in ) throws IOException { - m_in = new BufferedReader( a_in ) ; + m_in = new BufferedReader( in ) ; debug( ": -- opended file" ) ; prefetch() ; debug( ": -- prefetch complete" ) ; @@ -282,33 +83,33 @@ /** - * Creates a new LdifIterator object with a logger on a stream. + * Creates a new LdifIterator object with a monitor on a stream. * - * @param a_in the input stream to read from - * @param a_logger logger to log to + * @param in the input stream to read from + * @param monitor monitor to log to * * @throws IOException if we cannot wrap the stream with a reader */ - public LdifIterator( InputStream a_in, Logger a_logger ) + public LdifIterator( InputStream in, LdifIteratorMonitor monitor ) throws IOException { - this( new InputStreamReader( a_in ), a_logger ) ; + this( new InputStreamReader( in ), monitor ) ; } /** - * Creates a new LdifIterator object with a logger on a reader. + * Creates a new LdifIterator object with a monitor on a reader. * - * @param a_logger logger to log to - * @param a_in the reader to read from + * @param monitor monitor to log to + * @param in the reader to read from * * @throws IOException if we cannot wrap the reader with a bufferd reader */ - public LdifIterator( Reader a_in, Logger a_logger ) + public LdifIterator( Reader in, LdifIteratorMonitor monitor ) throws IOException { - this( a_in ) ; - m_logger = a_logger ; + this( in ) ; + this.monitor = monitor ; } @@ -370,33 +171,33 @@ /** - * Handles an error/exception by logging it with a valid logger or sending - * it to the console if a logger is not available. + * Handles an error/exception by logging it with a valid monitor or sending + * it to the console if a monitor is not available. * - * @param a_msg Message to log - * @param a_throwable the offending throwable + * @param msg Message to log + * @param throwable the offending throwable */ - private void error( String a_msg, Throwable a_throwable ) + private void error( String msg, Throwable throwable ) { - if ( null == m_logger ) + if ( null == monitor ) { - System.err.println( a_msg ) ; - a_throwable.printStackTrace( System.err ) ; + System.err.println( msg ) ; + throwable.printStackTrace( System.err ) ; } else { - m_logger.error( a_msg, a_throwable ) ; + monitor.fatalFailure( msg, throwable ) ; } } /** * If debugging is enabled these log messages are sent to either the - * console or to the logger if one is available. + * console or to the monitor if one is available. * - * @param a_msg the debug message to log + * @param msg the debug message to log */ - private void debug( String a_msg ) + private void debug( String msg ) { if ( !DEBUG ) { @@ -404,25 +205,25 @@ } - if ( null == m_logger ) + if ( null == monitor ) { - System.out.println( a_msg ) ; + System.out.println( msg ) ; } else { - m_logger.debug( a_msg ) ; + monitor.infoAvailable( msg ) ; } } /** * If debugging is enabled these log messages are sent to either the - * console or to the logger if one is available. + * console or to the monitor if one is available. * - * @param a_msg the debug message to log - * @param a_throwable the throwable to log + * @param msg the debug message to log + * @param throwable the throwable to log */ - private void debug( String a_msg, Throwable a_throwable ) + private void debug( String msg, Throwable throwable ) { if ( !DEBUG ) { @@ -430,14 +231,14 @@ } - if ( null == m_logger ) + if ( null == monitor ) { - System.out.println( a_msg ) ; - a_throwable.printStackTrace( System.out ) ; + System.out.println( msg ) ; + throwable.printStackTrace( System.out ) ; } else { - m_logger.debug( a_msg, a_throwable ) ; + monitor.failure( msg, throwable ) ; } } @@ -510,17 +311,17 @@ /** * Removes comments from a line as a filter before processing the lines. * - * @param a_line the line to filter comments out of + * @param line the line to filter comments out of * * @return the comment free line */ - public static String filterComment( String a_line ) + public static String filterComment( String line ) { - int l_index = a_line.indexOf( '#' ) ; + int l_index = line.indexOf( '#' ) ; if ( -1 == l_index ) { - return a_line ; + return line ; } else if ( l_index == 0 ) { @@ -532,26 +333,26 @@ // If this is an escaped '#' then take new index from current // index + 1 and continue from start of loop. if ( ( ( l_index - 1 ) > 0 ) - && ( '\\' == a_line.charAt( l_index - 1 ) ) ) + && ( '\\' == line.charAt( l_index - 1 ) ) ) { - if ( ( l_index + 1 ) < a_line.length() ) + if ( ( l_index + 1 ) < line.length() ) { - l_index = a_line.indexOf( '#', l_index + 1 ) ; + l_index = line.indexOf( '#', l_index + 1 ) ; continue ; } else { // This line has escaped '#' and no comment after it - return a_line ; + return line ; } } - return a_line.substring( 0, l_index ) ; + return line.substring( 0, l_index ) ; } - return a_line ; + return line ; } } Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/DerefAliasesEnum.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/DerefAliasesEnum.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/DerefAliasesEnum.java Sat Mar 13 07:45:13 2004 @@ -1,193 +1,5 @@ /* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, - * and distribution as defined by Sections 1 through 9 of this document. - * - * "Licensor" shall mean the copyright owner or entity authorized by - * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all - * other entities that control, are controlled by, or are under common - * control with that entity. For the purposes of this definition, - * "control" means (i) the power, direct or indirect, to cause the - * direction or management of such entity, whether by contract or - * otherwise, or (ii) ownership of fifty percent (50%) or more of the - * outstanding shares, or (iii) beneficial ownership of such entity. - * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, - * including but not limited to software source code, documentation - * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or - * Object form, made available under the License, as indicated by a - * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object - * form, that is based on (or derived from) the Work and for which the - * editorial revisions, annotations, elaborations, or other modifications - * represent, as a whole, an original work of authorship. For the purposes - * of this License, Derivative Works shall not include works that remain - * separable from, or merely link (or bind by name) to the interfaces of, - * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions - * to that Work or Derivative Works thereof, that is intentionally - * submitted to Licensor for inclusion in the Work by the copyright owner - * or by an individual or Legal Entity authorized to submit on behalf of - * the copyright owner. For the purposes of this definition, "submitted" - * means any form of electronic, verbal, or written communication sent - * to the Licensor or its representatives, including but not limited to - * communication on electronic mailing lists, source code control systems, - * and issue tracking systems that are managed by, or on behalf of, the - * Licensor for the purpose of discussing and improving the Work, but - * excluding communication that is conspicuously marked or otherwise - * designated in writing by the copyright owner as "Not a Contribution." - * - * "Contributor" shall mean Licensor and any individual or Legal Entity - * on behalf of whom a Contribution has been received by Licensor and - * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the - * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * (except as stated in this section) patent license to make, have made, - * use, offer to sell, sell, import, and otherwise transfer the Work, - * where such license applies only to those patent claims licensable - * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) - * with the Work to which such Contribution(s) was submitted. If You - * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work - * or a Contribution incorporated within the Work constitutes direct - * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate - * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the - * Work or Derivative Works thereof in any medium, with or without - * modifications, and in Source or Object form, provided that You - * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices - * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works - * that You distribute, all copyright, patent, trademark, and - * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of - * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must - * include a readable copy of the attribution notices contained - * within such NOTICE file, excluding those notices that do not - * pertain to any part of the Derivative Works, in at least one - * of the following places: within a NOTICE text file distributed - * as part of the Derivative Works; within the Source form or - * documentation, if provided along with the Derivative Works; or, - * within a display generated by the Derivative Works, if and - * wherever such third-party notices normally appear. The contents - * of the NOTICE file are for informational purposes only and - * do not modify the License. You may add Your own attribution - * notices within Derivative Works that You distribute, alongside - * or as an addendum to the NOTICE text from the Work, provided - * that such additional attribution notices cannot be construed - * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and - * may provide additional or different license terms and conditions - * for use, reproduction, or distribution of Your modifications, or - * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with - * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, - * any Contribution intentionally submitted for inclusion in the Work - * by You to the Licensor shall be under the terms and conditions of - * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify - * the terms of any separate license agreement you may have executed - * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade - * names, trademarks, service marks, or product names of the Licensor, - * except as required for reasonable and customary use in describing the - * origin of the Work and reproducing the content of the NOTICE file. - * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied, including, without limitation, any warranties or conditions - * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the - * appropriateness of using or redistributing the Work and assume any - * risks associated with Your exercise of permissions under this License. - * - * 8. Limitation of Liability. In no event and under no legal theory, - * whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law (such as deliberate and grossly - * negligent acts) or agreed to in writing, shall any Contributor be - * liable to You for damages, including any direct, indirect, special, - * incidental, or consequential damages of any character arising as a - * result of this License or out of the use or inability to use the - * Work (including but not limited to damages for loss of goodwill, - * work stoppage, computer failure or malfunction, or any and all - * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing - * the Work or Derivative Works thereof, You may choose to offer, - * and charge a fee for, acceptance of support, warranty, indemnity, - * or other liability obligations and/or rights consistent with this - * License. However, in accepting such obligations, You may act only - * on Your own behalf and on Your sole responsibility, not on behalf - * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason - * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following - * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include - * the brackets!) The text should be enclosed in the appropriate - * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the - * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] [name of copyright owner] + * 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. @@ -202,24 +14,14 @@ * limitations under the License. * */ - -/* - * $Id: DerefAliasesEnum.java,v 1.6 2003/09/24 04:19:40 akarasulu Exp $ - * - * -- (c) LDAPd Group -- - * -- Please refer to the LICENSE.txt file in the root directory of -- - * -- any LDAPd project for copyright and distribution information. -- - * - */ - package org.apache.ldap.common.message ; -import java.util.Hashtable ; - -import org.apache.avalon.framework.ValuedEnum ; - +import java.util.Hashtable ; + +import org.apache.commons.lang.enum.ValuedEnum ; + /** * Type-safe derefAliases search parameter enumeration which determines the mode * of alias handling. Note that the names of these ValuedEnums correspond to Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/LockableAttributesImpl.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/LockableAttributesImpl.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/LockableAttributesImpl.java Sat Mar 13 07:45:13 2004 @@ -1,193 +1,5 @@ /* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, - * and distribution as defined by Sections 1 through 9 of this document. - * - * "Licensor" shall mean the copyright owner or entity authorized by - * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all - * other entities that control, are controlled by, or are under common - * control with that entity. For the purposes of this definition, - * "control" means (i) the power, direct or indirect, to cause the - * direction or management of such entity, whether by contract or - * otherwise, or (ii) ownership of fifty percent (50%) or more of the - * outstanding shares, or (iii) beneficial ownership of such entity. - * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, - * including but not limited to software source code, documentation - * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or - * Object form, made available under the License, as indicated by a - * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object - * form, that is based on (or derived from) the Work and for which the - * editorial revisions, annotations, elaborations, or other modifications - * represent, as a whole, an original work of authorship. For the purposes - * of this License, Derivative Works shall not include works that remain - * separable from, or merely link (or bind by name) to the interfaces of, - * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions - * to that Work or Derivative Works thereof, that is intentionally - * submitted to Licensor for inclusion in the Work by the copyright owner - * or by an individual or Legal Entity authorized to submit on behalf of - * the copyright owner. For the purposes of this definition, "submitted" - * means any form of electronic, verbal, or written communication sent - * to the Licensor or its representatives, including but not limited to - * communication on electronic mailing lists, source code control systems, - * and issue tracking systems that are managed by, or on behalf of, the - * Licensor for the purpose of discussing and improving the Work, but - * excluding communication that is conspicuously marked or otherwise - * designated in writing by the copyright owner as "Not a Contribution." - * - * "Contributor" shall mean Licensor and any individual or Legal Entity - * on behalf of whom a Contribution has been received by Licensor and - * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the - * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * (except as stated in this section) patent license to make, have made, - * use, offer to sell, sell, import, and otherwise transfer the Work, - * where such license applies only to those patent claims licensable - * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) - * with the Work to which such Contribution(s) was submitted. If You - * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work - * or a Contribution incorporated within the Work constitutes direct - * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate - * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the - * Work or Derivative Works thereof in any medium, with or without - * modifications, and in Source or Object form, provided that You - * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices - * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works - * that You distribute, all copyright, patent, trademark, and - * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of - * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must - * include a readable copy of the attribution notices contained - * within such NOTICE file, excluding those notices that do not - * pertain to any part of the Derivative Works, in at least one - * of the following places: within a NOTICE text file distributed - * as part of the Derivative Works; within the Source form or - * documentation, if provided along with the Derivative Works; or, - * within a display generated by the Derivative Works, if and - * wherever such third-party notices normally appear. The contents - * of the NOTICE file are for informational purposes only and - * do not modify the License. You may add Your own attribution - * notices within Derivative Works that You distribute, alongside - * or as an addendum to the NOTICE text from the Work, provided - * that such additional attribution notices cannot be construed - * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and - * may provide additional or different license terms and conditions - * for use, reproduction, or distribution of Your modifications, or - * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with - * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, - * any Contribution intentionally submitted for inclusion in the Work - * by You to the Licensor shall be under the terms and conditions of - * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify - * the terms of any separate license agreement you may have executed - * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade - * names, trademarks, service marks, or product names of the Licensor, - * except as required for reasonable and customary use in describing the - * origin of the Work and reproducing the content of the NOTICE file. - * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied, including, without limitation, any warranties or conditions - * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the - * appropriateness of using or redistributing the Work and assume any - * risks associated with Your exercise of permissions under this License. - * - * 8. Limitation of Liability. In no event and under no legal theory, - * whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law (such as deliberate and grossly - * negligent acts) or agreed to in writing, shall any Contributor be - * liable to You for damages, including any direct, indirect, special, - * incidental, or consequential damages of any character arising as a - * result of this License or out of the use or inability to use the - * Work (including but not limited to damages for loss of goodwill, - * work stoppage, computer failure or malfunction, or any and all - * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing - * the Work or Derivative Works thereof, You may choose to offer, - * and charge a fee for, acceptance of support, warranty, indemnity, - * or other liability obligations and/or rights consistent with this - * License. However, in accepting such obligations, You may act only - * on Your own behalf and on Your sole responsibility, not on behalf - * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason - * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following - * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include - * the brackets!) The text should be enclosed in the appropriate - * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the - * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] [name of copyright owner] + * 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. @@ -202,31 +14,21 @@ * limitations under the License. * */ - -/* - * $Id: LockableAttributesImpl.java,v 1.9 2003/11/26 20:55:56 akarasulu Exp $ - * - * -- (c) LDAPd Group -- - * -- Please refer to the LICENSE.txt file in the root directory of -- - * -- any LDAPd project for copyright and distribution information. -- - * - */ - package org.apache.ldap.common.message ; -import java.util.Iterator; import java.util.Map ; import java.util.HashMap ; +import java.util.Iterator ; +import javax.naming.NamingException ; import javax.naming.NamingEnumeration ; -import javax.naming.NamingException; import javax.naming.directory.Attribute ; -import org.apache.avalon.framework.ExceptionUtil; - +import org.apache.commons.lang.exception.ExceptionUtils ; + import org.apache.ldap.common.Lockable ; -import org.apache.ldap.common.AbstractLockable ; +import org.apache.ldap.common.AbstractLockable ; /** @@ -500,7 +302,7 @@ } catch ( NamingException e ) { - l_buf.append( ExceptionUtil.printStackTrace( e ) ) ; + l_buf.append( ExceptionUtils.getFullStackTrace( e ) ) ; } } Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/MessageTypeEnum.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/MessageTypeEnum.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/MessageTypeEnum.java Sat Mar 13 07:45:13 2004 @@ -1,193 +1,5 @@ /* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, - * and distribution as defined by Sections 1 through 9 of this document. - * - * "Licensor" shall mean the copyright owner or entity authorized by - * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all - * other entities that control, are controlled by, or are under common - * control with that entity. For the purposes of this definition, - * "control" means (i) the power, direct or indirect, to cause the - * direction or management of such entity, whether by contract or - * otherwise, or (ii) ownership of fifty percent (50%) or more of the - * outstanding shares, or (iii) beneficial ownership of such entity. - * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, - * including but not limited to software source code, documentation - * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or - * Object form, made available under the License, as indicated by a - * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object - * form, that is based on (or derived from) the Work and for which the - * editorial revisions, annotations, elaborations, or other modifications - * represent, as a whole, an original work of authorship. For the purposes - * of this License, Derivative Works shall not include works that remain - * separable from, or merely link (or bind by name) to the interfaces of, - * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions - * to that Work or Derivative Works thereof, that is intentionally - * submitted to Licensor for inclusion in the Work by the copyright owner - * or by an individual or Legal Entity authorized to submit on behalf of - * the copyright owner. For the purposes of this definition, "submitted" - * means any form of electronic, verbal, or written communication sent - * to the Licensor or its representatives, including but not limited to - * communication on electronic mailing lists, source code control systems, - * and issue tracking systems that are managed by, or on behalf of, the - * Licensor for the purpose of discussing and improving the Work, but - * excluding communication that is conspicuously marked or otherwise - * designated in writing by the copyright owner as "Not a Contribution." - * - * "Contributor" shall mean Licensor and any individual or Legal Entity - * on behalf of whom a Contribution has been received by Licensor and - * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the - * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * (except as stated in this section) patent license to make, have made, - * use, offer to sell, sell, import, and otherwise transfer the Work, - * where such license applies only to those patent claims licensable - * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) - * with the Work to which such Contribution(s) was submitted. If You - * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work - * or a Contribution incorporated within the Work constitutes direct - * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate - * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the - * Work or Derivative Works thereof in any medium, with or without - * modifications, and in Source or Object form, provided that You - * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices - * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works - * that You distribute, all copyright, patent, trademark, and - * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of - * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must - * include a readable copy of the attribution notices contained - * within such NOTICE file, excluding those notices that do not - * pertain to any part of the Derivative Works, in at least one - * of the following places: within a NOTICE text file distributed - * as part of the Derivative Works; within the Source form or - * documentation, if provided along with the Derivative Works; or, - * within a display generated by the Derivative Works, if and - * wherever such third-party notices normally appear. The contents - * of the NOTICE file are for informational purposes only and - * do not modify the License. You may add Your own attribution - * notices within Derivative Works that You distribute, alongside - * or as an addendum to the NOTICE text from the Work, provided - * that such additional attribution notices cannot be construed - * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and - * may provide additional or different license terms and conditions - * for use, reproduction, or distribution of Your modifications, or - * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with - * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, - * any Contribution intentionally submitted for inclusion in the Work - * by You to the Licensor shall be under the terms and conditions of - * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify - * the terms of any separate license agreement you may have executed - * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade - * names, trademarks, service marks, or product names of the Licensor, - * except as required for reasonable and customary use in describing the - * origin of the Work and reproducing the content of the NOTICE file. - * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied, including, without limitation, any warranties or conditions - * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the - * appropriateness of using or redistributing the Work and assume any - * risks associated with Your exercise of permissions under this License. - * - * 8. Limitation of Liability. In no event and under no legal theory, - * whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law (such as deliberate and grossly - * negligent acts) or agreed to in writing, shall any Contributor be - * liable to You for damages, including any direct, indirect, special, - * incidental, or consequential damages of any character arising as a - * result of this License or out of the use or inability to use the - * Work (including but not limited to damages for loss of goodwill, - * work stoppage, computer failure or malfunction, or any and all - * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing - * the Work or Derivative Works thereof, You may choose to offer, - * and charge a fee for, acceptance of support, warranty, indemnity, - * or other liability obligations and/or rights consistent with this - * License. However, in accepting such obligations, You may act only - * on Your own behalf and on Your sole responsibility, not on behalf - * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason - * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following - * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include - * the brackets!) The text should be enclosed in the appropriate - * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the - * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] [name of copyright owner] + * 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. @@ -202,20 +14,10 @@ * limitations under the License. * */ - -/* - * $Id: MessageTypeEnum.java,v 1.3 2003/07/31 21:44:49 akarasulu Exp $ - * - * -- (c) LDAPd Group -- - * -- Please refer to the LICENSE.txt file in the root directory of -- - * -- any LDAPd project for copyright and distribution information. -- - * - */ - package org.apache.ldap.common.message ; - - -import org.apache.avalon.framework.ValuedEnum ; + + +import org.apache.commons.lang.enum.ValuedEnum ; /** Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ResultCodeEnum.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ResultCodeEnum.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ResultCodeEnum.java Sat Mar 13 07:45:13 2004 @@ -1,193 +1,5 @@ /* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, - * and distribution as defined by Sections 1 through 9 of this document. - * - * "Licensor" shall mean the copyright owner or entity authorized by - * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all - * other entities that control, are controlled by, or are under common - * control with that entity. For the purposes of this definition, - * "control" means (i) the power, direct or indirect, to cause the - * direction or management of such entity, whether by contract or - * otherwise, or (ii) ownership of fifty percent (50%) or more of the - * outstanding shares, or (iii) beneficial ownership of such entity. - * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, - * including but not limited to software source code, documentation - * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or - * Object form, made available under the License, as indicated by a - * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object - * form, that is based on (or derived from) the Work and for which the - * editorial revisions, annotations, elaborations, or other modifications - * represent, as a whole, an original work of authorship. For the purposes - * of this License, Derivative Works shall not include works that remain - * separable from, or merely link (or bind by name) to the interfaces of, - * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions - * to that Work or Derivative Works thereof, that is intentionally - * submitted to Licensor for inclusion in the Work by the copyright owner - * or by an individual or Legal Entity authorized to submit on behalf of - * the copyright owner. For the purposes of this definition, "submitted" - * means any form of electronic, verbal, or written communication sent - * to the Licensor or its representatives, including but not limited to - * communication on electronic mailing lists, source code control systems, - * and issue tracking systems that are managed by, or on behalf of, the - * Licensor for the purpose of discussing and improving the Work, but - * excluding communication that is conspicuously marked or otherwise - * designated in writing by the copyright owner as "Not a Contribution." - * - * "Contributor" shall mean Licensor and any individual or Legal Entity - * on behalf of whom a Contribution has been received by Licensor and - * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the - * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * (except as stated in this section) patent license to make, have made, - * use, offer to sell, sell, import, and otherwise transfer the Work, - * where such license applies only to those patent claims licensable - * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) - * with the Work to which such Contribution(s) was submitted. If You - * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work - * or a Contribution incorporated within the Work constitutes direct - * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate - * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the - * Work or Derivative Works thereof in any medium, with or without - * modifications, and in Source or Object form, provided that You - * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices - * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works - * that You distribute, all copyright, patent, trademark, and - * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of - * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must - * include a readable copy of the attribution notices contained - * within such NOTICE file, excluding those notices that do not - * pertain to any part of the Derivative Works, in at least one - * of the following places: within a NOTICE text file distributed - * as part of the Derivative Works; within the Source form or - * documentation, if provided along with the Derivative Works; or, - * within a display generated by the Derivative Works, if and - * wherever such third-party notices normally appear. The contents - * of the NOTICE file are for informational purposes only and - * do not modify the License. You may add Your own attribution - * notices within Derivative Works that You distribute, alongside - * or as an addendum to the NOTICE text from the Work, provided - * that such additional attribution notices cannot be construed - * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and - * may provide additional or different license terms and conditions - * for use, reproduction, or distribution of Your modifications, or - * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with - * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, - * any Contribution intentionally submitted for inclusion in the Work - * by You to the Licensor shall be under the terms and conditions of - * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify - * the terms of any separate license agreement you may have executed - * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade - * names, trademarks, service marks, or product names of the Licensor, - * except as required for reasonable and customary use in describing the - * origin of the Work and reproducing the content of the NOTICE file. - * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied, including, without limitation, any warranties or conditions - * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the - * appropriateness of using or redistributing the Work and assume any - * risks associated with Your exercise of permissions under this License. - * - * 8. Limitation of Liability. In no event and under no legal theory, - * whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law (such as deliberate and grossly - * negligent acts) or agreed to in writing, shall any Contributor be - * liable to You for damages, including any direct, indirect, special, - * incidental, or consequential damages of any character arising as a - * result of this License or out of the use or inability to use the - * Work (including but not limited to damages for loss of goodwill, - * work stoppage, computer failure or malfunction, or any and all - * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing - * the Work or Derivative Works thereof, You may choose to offer, - * and charge a fee for, acceptance of support, warranty, indemnity, - * or other liability obligations and/or rights consistent with this - * License. However, in accepting such obligations, You may act only - * on Your own behalf and on Your sole responsibility, not on behalf - * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason - * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following - * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include - * the brackets!) The text should be enclosed in the appropriate - * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the - * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] [name of copyright owner] + * 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. @@ -202,19 +14,10 @@ * limitations under the License. * */ - -/* - * $Id: ResultCodeEnum.java,v 1.4 2003/07/31 21:44:48 akarasulu Exp $ - * - * -- (c) LDAPd Group -- - * -- Please refer to the LICENSE.txt file in the root directory of -- - * -- any LDAPd project for copyright and distribution information. -- - * - */ package org.apache.ldap.common.message ; -import org.apache.avalon.framework.ValuedEnum ; +import org.apache.commons.lang.enum.ValuedEnum ; /** Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ScopeEnum.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ScopeEnum.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ScopeEnum.java Sat Mar 13 07:45:13 2004 @@ -1,193 +1,5 @@ /* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, - * and distribution as defined by Sections 1 through 9 of this document. - * - * "Licensor" shall mean the copyright owner or entity authorized by - * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all - * other entities that control, are controlled by, or are under common - * control with that entity. For the purposes of this definition, - * "control" means (i) the power, direct or indirect, to cause the - * direction or management of such entity, whether by contract or - * otherwise, or (ii) ownership of fifty percent (50%) or more of the - * outstanding shares, or (iii) beneficial ownership of such entity. - * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, - * including but not limited to software source code, documentation - * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or - * Object form, made available under the License, as indicated by a - * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object - * form, that is based on (or derived from) the Work and for which the - * editorial revisions, annotations, elaborations, or other modifications - * represent, as a whole, an original work of authorship. For the purposes - * of this License, Derivative Works shall not include works that remain - * separable from, or merely link (or bind by name) to the interfaces of, - * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions - * to that Work or Derivative Works thereof, that is intentionally - * submitted to Licensor for inclusion in the Work by the copyright owner - * or by an individual or Legal Entity authorized to submit on behalf of - * the copyright owner. For the purposes of this definition, "submitted" - * means any form of electronic, verbal, or written communication sent - * to the Licensor or its representatives, including but not limited to - * communication on electronic mailing lists, source code control systems, - * and issue tracking systems that are managed by, or on behalf of, the - * Licensor for the purpose of discussing and improving the Work, but - * excluding communication that is conspicuously marked or otherwise - * designated in writing by the copyright owner as "Not a Contribution." - * - * "Contributor" shall mean Licensor and any individual or Legal Entity - * on behalf of whom a Contribution has been received by Licensor and - * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the - * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * (except as stated in this section) patent license to make, have made, - * use, offer to sell, sell, import, and otherwise transfer the Work, - * where such license applies only to those patent claims licensable - * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) - * with the Work to which such Contribution(s) was submitted. If You - * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work - * or a Contribution incorporated within the Work constitutes direct - * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate - * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the - * Work or Derivative Works thereof in any medium, with or without - * modifications, and in Source or Object form, provided that You - * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices - * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works - * that You distribute, all copyright, patent, trademark, and - * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of - * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must - * include a readable copy of the attribution notices contained - * within such NOTICE file, excluding those notices that do not - * pertain to any part of the Derivative Works, in at least one - * of the following places: within a NOTICE text file distributed - * as part of the Derivative Works; within the Source form or - * documentation, if provided along with the Derivative Works; or, - * within a display generated by the Derivative Works, if and - * wherever such third-party notices normally appear. The contents - * of the NOTICE file are for informational purposes only and - * do not modify the License. You may add Your own attribution - * notices within Derivative Works that You distribute, alongside - * or as an addendum to the NOTICE text from the Work, provided - * that such additional attribution notices cannot be construed - * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and - * may provide additional or different license terms and conditions - * for use, reproduction, or distribution of Your modifications, or - * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with - * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, - * any Contribution intentionally submitted for inclusion in the Work - * by You to the Licensor shall be under the terms and conditions of - * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify - * the terms of any separate license agreement you may have executed - * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade - * names, trademarks, service marks, or product names of the Licensor, - * except as required for reasonable and customary use in describing the - * origin of the Work and reproducing the content of the NOTICE file. - * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied, including, without limitation, any warranties or conditions - * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the - * appropriateness of using or redistributing the Work and assume any - * risks associated with Your exercise of permissions under this License. - * - * 8. Limitation of Liability. In no event and under no legal theory, - * whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law (such as deliberate and grossly - * negligent acts) or agreed to in writing, shall any Contributor be - * liable to You for damages, including any direct, indirect, special, - * incidental, or consequential damages of any character arising as a - * result of this License or out of the use or inability to use the - * Work (including but not limited to damages for loss of goodwill, - * work stoppage, computer failure or malfunction, or any and all - * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing - * the Work or Derivative Works thereof, You may choose to offer, - * and charge a fee for, acceptance of support, warranty, indemnity, - * or other liability obligations and/or rights consistent with this - * License. However, in accepting such obligations, You may act only - * on Your own behalf and on Your sole responsibility, not on behalf - * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason - * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following - * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include - * the brackets!) The text should be enclosed in the appropriate - * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the - * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] [name of copyright owner] + * 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. @@ -202,23 +14,11 @@ * limitations under the License. * */ - -/* - * $Id: ScopeEnum.java,v 1.4 2003/09/21 18:13:07 akarasulu Exp $ - * - * -- (c) LDAPd Group -- - * -- Please refer to the LICENSE.txt file in the root directory of -- - * -- any LDAPd project for copyright and distribution information. -- - * - */ - package org.apache.ldap.common.message ; import javax.naming.directory.SearchControls ; -import org.apache.avalon.framework.ValuedEnum ; - /** * Type-safe scope parameter enumeration. @@ -228,7 +28,7 @@ * @version $Revision: 1.4 $ */ public class ScopeEnum - extends ValuedEnum + extends org.apache.commons.lang.enum.ValuedEnum { /** Search scope parameter value for base object search */ public static final int BASEOBJECT_VAL = SearchControls.OBJECT_SCOPE ; Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/name/DnParser.java ============================================================================== --- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/name/DnParser.java (original) +++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/name/DnParser.java Sat Mar 13 07:45:13 2004 @@ -1,193 +1,5 @@ /* - * Apache License - * Version 2.0, January 2004 - * http://www.apache.org/licenses/ - * - * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - * - * 1. Definitions. - * - * "License" shall mean the terms and conditions for use, reproduction, - * and distribution as defined by Sections 1 through 9 of this document. - * - * "Licensor" shall mean the copyright owner or entity authorized by - * the copyright owner that is granting the License. - * - * "Legal Entity" shall mean the union of the acting entity and all - * other entities that control, are controlled by, or are under common - * control with that entity. For the purposes of this definition, - * "control" means (i) the power, direct or indirect, to cause the - * direction or management of such entity, whether by contract or - * otherwise, or (ii) ownership of fifty percent (50%) or more of the - * outstanding shares, or (iii) beneficial ownership of such entity. - * - * "You" (or "Your") shall mean an individual or Legal Entity - * exercising permissions granted by this License. - * - * "Source" form shall mean the preferred form for making modifications, - * including but not limited to software source code, documentation - * source, and configuration files. - * - * "Object" form shall mean any form resulting from mechanical - * transformation or translation of a Source form, including but - * not limited to compiled object code, generated documentation, - * and conversions to other media types. - * - * "Work" shall mean the work of authorship, whether in Source or - * Object form, made available under the License, as indicated by a - * copyright notice that is included in or attached to the work - * (an example is provided in the Appendix below). - * - * "Derivative Works" shall mean any work, whether in Source or Object - * form, that is based on (or derived from) the Work and for which the - * editorial revisions, annotations, elaborations, or other modifications - * represent, as a whole, an original work of authorship. For the purposes - * of this License, Derivative Works shall not include works that remain - * separable from, or merely link (or bind by name) to the interfaces of, - * the Work and Derivative Works thereof. - * - * "Contribution" shall mean any work of authorship, including - * the original version of the Work and any modifications or additions - * to that Work or Derivative Works thereof, that is intentionally - * submitted to Licensor for inclusion in the Work by the copyright owner - * or by an individual or Legal Entity authorized to submit on behalf of - * the copyright owner. For the purposes of this definition, "submitted" - * means any form of electronic, verbal, or written communication sent - * to the Licensor or its representatives, including but not limited to - * communication on electronic mailing lists, source code control systems, - * and issue tracking systems that are managed by, or on behalf of, the - * Licensor for the purpose of discussing and improving the Work, but - * excluding communication that is conspicuously marked or otherwise - * designated in writing by the copyright owner as "Not a Contribution." - * - * "Contributor" shall mean Licensor and any individual or Legal Entity - * on behalf of whom a Contribution has been received by Licensor and - * subsequently incorporated within the Work. - * - * 2. Grant of Copyright License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * copyright license to reproduce, prepare Derivative Works of, - * publicly display, publicly perform, sublicense, and distribute the - * Work and such Derivative Works in Source or Object form. - * - * 3. Grant of Patent License. Subject to the terms and conditions of - * this License, each Contributor hereby grants to You a perpetual, - * worldwide, non-exclusive, no-charge, royalty-free, irrevocable - * (except as stated in this section) patent license to make, have made, - * use, offer to sell, sell, import, and otherwise transfer the Work, - * where such license applies only to those patent claims licensable - * by such Contributor that are necessarily infringed by their - * Contribution(s) alone or by combination of their Contribution(s) - * with the Work to which such Contribution(s) was submitted. If You - * institute patent litigation against any entity (including a - * cross-claim or counterclaim in a lawsuit) alleging that the Work - * or a Contribution incorporated within the Work constitutes direct - * or contributory patent infringement, then any patent licenses - * granted to You under this License for that Work shall terminate - * as of the date such litigation is filed. - * - * 4. Redistribution. You may reproduce and distribute copies of the - * Work or Derivative Works thereof in any medium, with or without - * modifications, and in Source or Object form, provided that You - * meet the following conditions: - * - * (a) You must give any other recipients of the Work or - * Derivative Works a copy of this License; and - * - * (b) You must cause any modified files to carry prominent notices - * stating that You changed the files; and - * - * (c) You must retain, in the Source form of any Derivative Works - * that You distribute, all copyright, patent, trademark, and - * attribution notices from the Source form of the Work, - * excluding those notices that do not pertain to any part of - * the Derivative Works; and - * - * (d) If the Work includes a "NOTICE" text file as part of its - * distribution, then any Derivative Works that You distribute must - * include a readable copy of the attribution notices contained - * within such NOTICE file, excluding those notices that do not - * pertain to any part of the Derivative Works, in at least one - * of the following places: within a NOTICE text file distributed - * as part of the Derivative Works; within the Source form or - * documentation, if provided along with the Derivative Works; or, - * within a display generated by the Derivative Works, if and - * wherever such third-party notices normally appear. The contents - * of the NOTICE file are for informational purposes only and - * do not modify the License. You may add Your own attribution - * notices within Derivative Works that You distribute, alongside - * or as an addendum to the NOTICE text from the Work, provided - * that such additional attribution notices cannot be construed - * as modifying the License. - * - * You may add Your own copyright statement to Your modifications and - * may provide additional or different license terms and conditions - * for use, reproduction, or distribution of Your modifications, or - * for any such Derivative Works as a whole, provided Your use, - * reproduction, and distribution of the Work otherwise complies with - * the conditions stated in this License. - * - * 5. Submission of Contributions. Unless You explicitly state otherwise, - * any Contribution intentionally submitted for inclusion in the Work - * by You to the Licensor shall be under the terms and conditions of - * this License, without any additional terms or conditions. - * Notwithstanding the above, nothing herein shall supersede or modify - * the terms of any separate license agreement you may have executed - * with Licensor regarding such Contributions. - * - * 6. Trademarks. This License does not grant permission to use the trade - * names, trademarks, service marks, or product names of the Licensor, - * except as required for reasonable and customary use in describing the - * origin of the Work and reproducing the content of the NOTICE file. - * - * 7. Disclaimer of Warranty. Unless required by applicable law or - * agreed to in writing, Licensor provides the Work (and each - * Contributor provides its Contributions) on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied, including, without limitation, any warranties or conditions - * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - * PARTICULAR PURPOSE. You are solely responsible for determining the - * appropriateness of using or redistributing the Work and assume any - * risks associated with Your exercise of permissions under this License. - * - * 8. Limitation of Liability. In no event and under no legal theory, - * whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law (such as deliberate and grossly - * negligent acts) or agreed to in writing, shall any Contributor be - * liable to You for damages, including any direct, indirect, special, - * incidental, or consequential damages of any character arising as a - * result of this License or out of the use or inability to use the - * Work (including but not limited to damages for loss of goodwill, - * work stoppage, computer failure or malfunction, or any and all - * other commercial damages or losses), even if such Contributor - * has been advised of the possibility of such damages. - * - * 9. Accepting Warranty or Additional Liability. While redistributing - * the Work or Derivative Works thereof, You may choose to offer, - * and charge a fee for, acceptance of support, warranty, indemnity, - * or other liability obligations and/or rights consistent with this - * License. However, in accepting such obligations, You may act only - * on Your own behalf and on Your sole responsibility, not on behalf - * of any other Contributor, and only if You agree to indemnify, - * defend, and hold each Contributor harmless for any liability - * incurred by, or claims asserted against, such Contributor by reason - * of your accepting any such warranty or additional liability. - * - * END OF TERMS AND CONDITIONS - * - * APPENDIX: How to apply the Apache License to your work. - * - * To apply the Apache License to your work, attach the following - * boilerplate notice, with the fields enclosed by brackets "[]" - * replaced with your own identifying information. (Don't include - * the brackets!) The text should be enclosed in the appropriate - * comment syntax for the file format. We also recommend that a - * file or class name and description of purpose be included on the - * same "printed page" as the copyright notice for easier - * identification within third-party archives. - * - * Copyright [yyyy] [name of copyright owner] + * 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. @@ -202,16 +14,6 @@ * limitations under the License. * */ - -/* - * $Id: DnParser.java,v 1.7 2003/08/06 02:59:24 akarasulu Exp $ - * - * -- (c) LDAPd Group -- - * -- Please refer to the LICENSE.txt file in the root directory of -- - * -- any LDAPd project for copyright and distribution information. -- - * - */ - package org.apache.ldap.common.name ; @@ -224,13 +26,13 @@ import javax.naming.NamingException ; import javax.naming.InvalidNameException ; +import org.apache.commons.lang.exception.ExceptionUtils ; +import org.apache.commons.lang.exception.NestableRuntimeException ; + import antlr.TokenStreamSelector ; import antlr.RecognitionException ; import antlr.TokenStreamException ; -import org.apache.avalon.framework.ExceptionUtil ; -import org.apache.avalon.framework.CascadingRuntimeException ; - /** * Distinguished name parser. @@ -367,7 +169,7 @@ { String l_msg = "Parser failure on name:\n\t" + a_name ; l_msg += "\nAntlr exception trace:\n" + - ExceptionUtil.printStackTrace( e ) ; + ExceptionUtils.getFullStackTrace( e ) ; try { @@ -385,7 +187,7 @@ { String l_msg = "[34] Parser failure on name:\n\t" + a_name ; l_msg += "\nAntlr exception trace:\n" + - ExceptionUtil.printStackTrace( e ) ; + ExceptionUtils.getFullStackTrace( e ) ; try { @@ -403,7 +205,7 @@ { String l_msg = "[34] Parser failure on name:\n\t" + a_name ; l_msg += "\nAntlr exception trace:\n" + - ExceptionUtil.printStackTrace( e2 ) ; + ExceptionUtils.getFullStackTrace( e2 ) ; try { @@ -417,7 +219,7 @@ throw new InvalidNameException( l_msg ) ; } - catch ( CascadingRuntimeException e ) + catch ( NestableRuntimeException e ) { Throwable l_throwable = e.getCause() ; if ( l_throwable instanceof NamingException )