Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 66603 invoked from network); 9 Oct 2005 13:54:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Oct 2005 13:54:10 -0000 Received: (qmail 2502 invoked by uid 500); 9 Oct 2005 13:54:10 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 2447 invoked by uid 500); 9 Oct 2005 13:54:09 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 2435 invoked by uid 99); 9 Oct 2005 13:54:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2005 06:54:09 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 09 Oct 2005 06:54:12 -0700 Received: (qmail 66574 invoked by uid 65534); 9 Oct 2005 13:53:48 -0000 Message-ID: <20051009135348.66573.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r307433 - /directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixTransformer.java Date: Sun, 09 Oct 2005 13:53:48 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: elecharny Date: Sun Oct 9 06:53:44 2005 New Revision: 307433 URL: http://svn.apache.org/viewcvs?rev=307433&view=rev Log: Changed the class to reflect modifications done in primitives and in pojos. Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixTransformer.java Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixTransformer.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixTransformer.java?rev=307433&r1=307432&r2=307433&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixTransformer.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/TwixTransformer.java Sun Oct 9 06:53:44 2005 @@ -21,6 +21,7 @@ import java.util.Collection; import java.util.Iterator; +import javax.naming.InvalidNameException; import javax.naming.NamingEnumeration; import javax.naming.directory.Attribute; import javax.naming.directory.BasicAttribute; @@ -31,7 +32,9 @@ import org.apache.asn1new.ldap.codec.LdapConstants; import org.apache.asn1new.ldap.codec.primitives.LdapDN; import org.apache.asn1new.ldap.codec.primitives.LdapString; +import org.apache.asn1new.ldap.codec.primitives.LdapStringEncodingException; import org.apache.asn1new.ldap.codec.primitives.LdapURL; +import org.apache.asn1new.ldap.codec.primitives.LdapURLEncodingException; import org.apache.asn1new.ldap.pojo.AbandonRequest; import org.apache.asn1new.ldap.pojo.AddRequest; import org.apache.asn1new.ldap.pojo.AddResponse; @@ -728,9 +731,9 @@ twixLdapResult.setErrorMessage( new LdapString( snickersLdapResult.getErrorMessage().getBytes() ) ); } } - catch ( DecoderException de ) + catch (LdapStringEncodingException lsee ) { - log.warn( "The error message " + snickersLdapResult.getErrorMessage() + " is invalid : " + de.getMessage() ); + log.warn( "The error message " + snickersLdapResult.getErrorMessage() + " is invalid : " + lsee.getMessage() ); twixLdapResult.setErrorMessage( LdapString.EMPTY_STRING ); } @@ -741,17 +744,17 @@ if ( ( matchedDn == null ) || ( matchedDn.length() == 0 ) ) { - twixLdapResult.setMatchedDN( LdapDN.EMPTY_STRING ); + twixLdapResult.setMatchedDN( LdapDN.EMPTY_LDAPDN ); } else { - twixLdapResult.setMatchedDN( new LdapDN( snickersLdapResult.getMatchedDn().getBytes() ) ); + twixLdapResult.setMatchedDN( new LdapDN( snickersLdapResult.getMatchedDn() ) ); } } - catch ( DecoderException de ) + catch ( InvalidNameException ine ) { - log.warn( "The DN " + snickersLdapResult.getMatchedDn() + " is invalid : " + de.getMessage() ); - twixLdapResult.setMatchedDN( LdapDN.EMPTY_STRING ); + log.warn( "The DN " + snickersLdapResult.getMatchedDn() + " is invalid : " + ine.getMessage() ); + twixLdapResult.setMatchedDN( LdapDN.EMPTY_LDAPDN ); } // Snickers : Referral referral -> Twix : ArrayList referrals @@ -770,10 +773,10 @@ LdapURL ldapUrl = new LdapURL( referral.getBytes() ); twixLdapResult.addReferral( ldapUrl ); } - catch ( DecoderException de ) + catch ( LdapURLEncodingException lude ) { - log.warn( "The referral " + referral + " is invalid : " + de.getMessage() ); - twixLdapResult.addReferral( LdapURL.EMPTY_STRING ); + log.warn( "The referral " + referral + " is invalid : " + lude.getMessage() ); + twixLdapResult.addReferral( LdapURL.EMPTY_URL ); } } } @@ -961,10 +964,10 @@ { searchResultEntry.setObjectName( new LdapDN( snickersSearchResultResponse.getObjectName().getBytes() ) ); } - catch (DecoderException de) + catch (InvalidNameException ine) { - log.warn( "The DN " + snickersSearchResultResponse.getObjectName() + " is invalid : " + de.getMessage() ); - searchResultEntry.setObjectName( LdapDN.EMPTY_STRING ); + log.warn( "The DN " + snickersSearchResultResponse.getObjectName() + " is invalid : " + ine.getMessage() ); + searchResultEntry.setObjectName( LdapDN.EMPTY_LDAPDN ); } // Snickers : Attributes attributes -> Twix : ArrayList partialAttributeList @@ -1004,9 +1007,9 @@ { searchResultReference.addSearchResultReference( new LdapURL( urlValue ) ); } - catch ( DecoderException de ) + catch ( LdapURLEncodingException luee ) { - log.warn( "The LdapURL " + urlValue + " is incorrect : " + de.getMessage() ); + log.warn( "The LdapURL " + urlValue + " is incorrect : " + luee.getMessage() ); } } }