directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
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 GMT
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() );
     				}
     			}
     		}



Mime
View raw message