directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r912399 [2/4] - in /directory/shared/trunk: ./ asn1-codec/ asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/ asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/ ...
Date Sun, 21 Feb 2010 20:52:35 GMT
Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java Sun Feb 21 20:52:31 2010
@@ -42,6 +42,7 @@
 import org.apache.directory.shared.dsmlv2.request.BatchRequest.OnError;
 import org.apache.directory.shared.dsmlv2.request.BatchRequest.Processing;
 import org.apache.directory.shared.dsmlv2.request.BatchRequest.ResponseOrder;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
@@ -1073,7 +1074,7 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException( "Unknown value for 'processing' attribute.", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03013 ), xpp, null );
                 }
             }
             else
@@ -1094,7 +1095,7 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException( "Unknown value for 'onError' attribute.", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03014 ), xpp, null );
                 }
             }
             else
@@ -1115,7 +1116,7 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException( "Unknown value for 'responseOrder' attribute.", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03015 ), xpp, null );
                 }
             }
             else
@@ -1149,7 +1150,7 @@
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                    throw new XmlPullParserException( I18n.err(I18n.ERR_03016 ), xpp, null );
                 }
             }
             // abandonID
@@ -1162,12 +1163,12 @@
                 }
                 catch ( NumberFormatException e )
                 {
-                    throw new XmlPullParserException( "the given abandonID is not an integer", xpp, null );
+                    throw new XmlPullParserException( I18n.err(I18n.ERR_03017 ), xpp, null );
                 }
             }
             else
             {
-                throw new XmlPullParserException( "abandonID attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err(I18n.ERR_03018 ), xpp, null );
             }
         }
     };
@@ -1197,7 +1198,7 @@
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                    throw new XmlPullParserException( I18n.err(I18n.ERR_03016 ), xpp, null );
                 }
             }
             // dn
@@ -1215,7 +1216,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "dn attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err(I18n.ERR_03019 ), xpp, null );
             }
         }
     };
@@ -1243,12 +1244,12 @@
                 }
                 catch ( NamingException e )
                 {
-                    throw new XmlPullParserException( "can not add attribute value", xpp, e );
+                    throw new XmlPullParserException( I18n.err(I18n.ERR_03020 ), xpp, e );
                 }
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err(I18n.ERR_03012 ), xpp, null );
             }
         }
     };
@@ -1284,7 +1285,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err(I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -1318,7 +1319,7 @@
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                    throw new XmlPullParserException( I18n.err(I18n.ERR_03016 ), xpp, null );
                 }
             }
             // principal
@@ -1336,7 +1337,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "principal attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03021 ), xpp, null );
             }
         }
     };
@@ -1365,7 +1366,7 @@
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
             // dn
@@ -1383,7 +1384,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "dn attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null );
             }
         }
     };
@@ -1410,7 +1411,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
         }
     };
@@ -1447,7 +1448,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -1476,7 +1477,7 @@
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
             // dn
@@ -1494,7 +1495,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "dn attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null );
             }
         }
     };
@@ -1523,7 +1524,7 @@
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
         }
@@ -1544,7 +1545,7 @@
                 String nextText = xpp.nextText();
                 if ( nextText.equals( "" ) )
                 {
-                    throw new XmlPullParserException( "The request name can't be null", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03022 ), xpp, null );
                 }
                 else
                 {
@@ -1553,7 +1554,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
             catch ( DecoderException e )
             {
@@ -1593,7 +1594,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -1622,7 +1623,7 @@
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
             // dn
@@ -1640,7 +1641,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "dn attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null );
             }
             // newrdn
             attributeValue = xpp.getAttributeValue( "", "newrdn" );
@@ -1657,7 +1658,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "newrdn attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03023 ), xpp, null );
             }
             // deleteoldrdn
             attributeValue = xpp.getAttributeValue( "", "deleteoldrdn" );
@@ -1673,7 +1674,7 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException( "Incorrect value for 'deleteoldrdn' attribute", xpp, null );
+                    throw new XmlPullParserException(I18n.err( I18n.ERR_03024 ), xpp, null );
                 }
             }
             else
@@ -1722,7 +1723,7 @@
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
             // dn
@@ -1735,7 +1736,7 @@
                 }
                 catch ( InvalidNameException e )
                 {
-                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
+                    throw new XmlPullParserException( "" + e.getLocalizedMessage(), xpp, null );
                 }
             }
             else
@@ -1782,7 +1783,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "operation attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03025 ), xpp, null );
             }
             // name
             attributeValue = xpp.getAttributeValue( "", "name" );
@@ -1792,7 +1793,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
         }
     };
@@ -1828,7 +1829,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -1857,7 +1858,7 @@
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
             // dn
@@ -1875,7 +1876,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "dn attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null );
             }
             // scope
             attributeValue = xpp.getAttributeValue( "", "scope" );
@@ -1895,13 +1896,12 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException(
-                        "unknown scope. Scope must be 'baseObject', 'singleLevel' or 'wholeSubtree'.", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03026 ), xpp, null );
                 }
             }
             else
             {
-                throw new XmlPullParserException( "scope attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03027 ), xpp, null );
             }
             // derefAliases
             attributeValue = xpp.getAttributeValue( "", "derefAliases" );
@@ -1925,14 +1925,12 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException(
-                        "unknown derefAliases value. derefAliases must be 'neverDerefAliases', 'derefInSearching', 'derefFindingBaseObj' or 'derefAlways'.",
-                        xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03028 ), xpp, null );
                 }
             }
             else
             {
-                throw new XmlPullParserException( "derefAliases attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03029 ), xpp, null );
             }
             // sizeLimit
             attributeValue = xpp.getAttributeValue( "", "sizeLimit" );
@@ -1944,7 +1942,7 @@
                 }
                 catch ( NumberFormatException e )
                 {
-                    throw new XmlPullParserException( "the given sizeLimit is not an integer", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03030 ), xpp, null );
                 }
             }
             else
@@ -1961,7 +1959,7 @@
                 }
                 catch ( NumberFormatException e )
                 {
-                    throw new XmlPullParserException( "the given timeLimit is not an integer", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03031 ), xpp, null );
                 }
             }
             else
@@ -1982,7 +1980,7 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException( "typesOnly must be a boolean ('true' or 'false').", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03032 ), xpp, null );
                 }
             }
             else
@@ -2014,7 +2012,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
         }
     };
@@ -2053,7 +2051,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
         }
     };
@@ -2091,7 +2089,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -2128,7 +2126,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -2166,7 +2164,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -2307,7 +2305,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
 
             AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
@@ -2351,7 +2349,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
 
             AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
@@ -2395,7 +2393,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
 
             AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
@@ -2439,7 +2437,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
 
             AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( LdapConstants.APPROX_MATCH_FILTER );
@@ -2495,7 +2493,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -2556,7 +2554,7 @@
             }
             catch ( DecoderException e )
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
             searchRequest.setTerminalFilter( extensibleMatchFilter );
 
@@ -2576,7 +2574,7 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException( "dnAttributes must be a boolean ('true' or 'false').", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03033 ), xpp, null );
                 }
             }
             else
@@ -2633,7 +2631,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -2658,8 +2656,7 @@
             {
                 if ( !OID.isOID( attributeValue ) )
                 {
-                    throw new XmlPullParserException( "Incorrect value for 'type' attribute. This is not an OID.", xpp,
-                        null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03034 ), xpp, null );
                 }
                 
                 control = new ControlImpl( attributeValue );
@@ -2667,7 +2664,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "type attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03035 ), xpp, null );
             }
             
             // CRITICALITY
@@ -2685,7 +2682,7 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException( "Incorrect value for 'criticality' attribute", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03007 ), xpp, null );
                 }
             }
         }
@@ -2723,7 +2720,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };

Propchange: directory/shared/trunk/i18n/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Feb 21 20:52:31 2010
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: directory/shared/trunk/i18n/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/i18n/pom.xml?rev=912399&view=auto
==============================================================================
--- directory/shared/trunk/i18n/pom.xml (added)
+++ directory/shared/trunk/i18n/pom.xml Sun Feb 21 20:52:31 2010
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.directory.shared</groupId>
+    <artifactId>shared-parent</artifactId>
+    <version>0.9.18-SNAPSHOT</version>
+  </parent>
+  <artifactId>shared-i18n</artifactId>
+  <name>Apache Directory Shared I18n</name>
+  
+  <description>Internationalization of errors and other messages</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration> 
+          <forkMode>always</forkMode>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: directory/shared/trunk/i18n/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/shared/trunk/i18n/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java?rev=912399&view=auto
==============================================================================
--- directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java (added)
+++ directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java Sun Feb 21 20:52:31 2010
@@ -0,0 +1,476 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package org.apache.directory.shared.i18n;
+
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+/**
+ * Provides i18n handling of error codes.
+ * About formatting see also {@link MessageFormat}
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class I18n
+{
+    private final static ResourceBundle errBundle = ResourceBundle
+        .getBundle( "org/apache/directory/shared/i18n/errors" );
+    private final static ResourceBundle msgBundle = ResourceBundle
+        .getBundle( "org/apache/directory/shared/i18n/messages" );
+
+	// asn1
+	public static final String ERR_00001 = "ERR_00001";
+	public static final String ERR_00002 = "ERR_00002";
+	public static final String ERR_00003 = "ERR_00003";
+	public static final String ERR_00004 = "ERR_00004";
+	public static final String ERR_00005 = "ERR_00005";
+	public static final String ERR_00006 = "ERR_00006";
+	public static final String ERR_00007 = "ERR_00007";
+	public static final String ERR_00008 = "ERR_00008";
+	public static final String ERR_00009 = "ERR_00009";
+	public static final String ERR_00010 = "ERR_00010";
+	public static final String ERR_00011 = "ERR_00011";
+	public static final String ERR_00012 = "ERR_00012";
+	public static final String ERR_00013 = "ERR_00013";
+	public static final String ERR_00014 = "ERR_00014";
+	public static final String ERR_00015 = "ERR_00015";
+	public static final String ERR_00016 = "ERR_00016";
+	public static final String ERR_00017 = "ERR_00017";
+	public static final String ERR_00018 = "ERR_00018";
+	public static final String ERR_00019 = "ERR_00019";
+	public static final String ERR_00020 = "ERR_00020";
+	public static final String ERR_00021 = "ERR_00021";
+	public static final String ERR_00022 = "ERR_00022";
+	public static final String ERR_00023 = "ERR_00023";
+	public static final String ERR_00024 = "ERR_00024";
+	public static final String ERR_00025 = "ERR_00025";
+	public static final String ERR_00026 = "ERR_00026";
+	public static final String ERR_00027 = "ERR_00027";
+	public static final String ERR_00028 = "ERR_00028";
+	public static final String ERR_00029 = "ERR_00029";
+	public static final String ERR_00030 = "ERR_00030";
+	public static final String ERR_00031 = "ERR_00031";
+	public static final String ERR_00032 = "ERR_00032";
+	public static final String ERR_00033 = "ERR_00033";
+	public static final String ERR_00034 = "ERR_00034";
+	public static final String ERR_00035 = "ERR_00035";
+	public static final String ERR_00036 = "ERR_00036";
+	public static final String ERR_00037 = "ERR_00037";
+	public static final String ERR_00038 = "ERR_00038";
+	public static final String ERR_00039 = "ERR_00039";
+	public static final String ERR_00040 = "ERR_00040";
+	public static final String ERR_00041 = "ERR_00041";
+	
+	// asn1-codec
+	public static final String ERR_01001 = "ERR_01001";
+
+	// cursor
+	public static final String ERR_02001 = "ERR_02001";
+	public static final String ERR_02002 = "ERR_02002";
+	public static final String ERR_02003 = "ERR_02003";
+	public static final String ERR_02004 = "ERR_02004";
+	public static final String ERR_02005 = "ERR_02005";
+	public static final String ERR_02006 = "ERR_02006";
+	public static final String ERR_02007 = "ERR_02007";
+	public static final String ERR_02008 = "ERR_02008";
+	public static final String ERR_02009 = "ERR_02009";
+	public static final String ERR_02010 = "ERR_02010";
+	public static final String ERR_02011 = "ERR_02011";
+	public static final String ERR_02012 = "ERR_02012";
+	public static final String ERR_02013 = "ERR_02013";
+
+	// dsml-parser
+	public static final String ERR_03001 = "ERR_03001";
+	public static final String ERR_03002 = "ERR_03002";
+	public static final String ERR_03003 = "ERR_03003";
+	public static final String ERR_03004 = "ERR_03004";
+	public static final String ERR_03005 = "ERR_03005";
+	public static final String ERR_03006 = "ERR_03006";
+	public static final String ERR_03007 = "ERR_03007";
+	public static final String ERR_03008 = "ERR_03008";
+	public static final String ERR_03009 = "ERR_03009";
+	public static final String ERR_03010 = "ERR_03010";
+	public static final String ERR_03011 = "ERR_03011";
+	public static final String ERR_03012 = "ERR_03012";
+	public static final String ERR_03013 = "ERR_03013";
+	public static final String ERR_03014 = "ERR_03014";
+	public static final String ERR_03015 = "ERR_03015";
+	public static final String ERR_03016 = "ERR_03016";
+	public static final String ERR_03017 = "ERR_03017";
+	public static final String ERR_03018 = "ERR_03018";
+	public static final String ERR_03019 = "ERR_03019";
+	public static final String ERR_03020 = "ERR_03020";
+	public static final String ERR_03021 = "ERR_03021";
+	public static final String ERR_03022 = "ERR_03022";
+	public static final String ERR_03023 = "ERR_03023";
+	public static final String ERR_03024 = "ERR_03024";
+	public static final String ERR_03025 = "ERR_00025";
+	public static final String ERR_03026 = "ERR_03026";
+	public static final String ERR_03027 = "ERR_03027";
+	public static final String ERR_03028 = "ERR_03028";
+	public static final String ERR_03029 = "ERR_03029";
+	public static final String ERR_03030 = "ERR_03030";
+	public static final String ERR_03031 = "ERR_03031";
+	public static final String ERR_03032 = "ERR_03032";
+	public static final String ERR_03033 = "ERR_03033";
+	public static final String ERR_03034 = "ERR_03034";
+	public static final String ERR_03035 = "ERR_03035";
+	public static final String ERR_03036 = "ERR_03036";
+	public static final String ERR_03037 = "ERR_03037";
+	public static final String ERR_03038 = "ERR_03038";
+	public static final String ERR_03039 = "ERR_03039";
+	public static final String ERR_03040 = "ERR_03040";
+
+	// ldap
+	public static final String ERR_04001 = "ERR_04001";
+	public static final String ERR_04002 = "ERR_04002";
+	public static final String ERR_04003 = "ERR_04003";
+	public static final String ERR_04004 = "ERR_04004";
+	public static final String ERR_04005 = "ERR_04005";
+	public static final String ERR_04006 = "ERR_04006";
+	public static final String ERR_04007 = "ERR_04007";
+	public static final String ERR_04008 = "ERR_04008";
+	public static final String ERR_04009 = "ERR_04009";
+	public static final String ERR_04010 = "ERR_04010";
+	public static final String ERR_04011 = "ERR_04011";
+	public static final String ERR_04012 = "ERR_04012";
+	public static final String ERR_04013 = "ERR_04013";
+	public static final String ERR_04014 = "ERR_04014";
+	public static final String ERR_04015 = "ERR_04015";
+	public static final String ERR_04016 = "ERR_04016";
+	public static final String ERR_04017 = "ERR_04017";
+	public static final String ERR_04018 = "ERR_04018";
+	public static final String ERR_04019 = "ERR_04019";
+	public static final String ERR_04020 = "ERR_04020";
+	public static final String ERR_04021 = "ERR_04021";
+	public static final String ERR_04022 = "ERR_04022";
+	public static final String ERR_04023 = "ERR_04023";
+	public static final String ERR_04024 = "ERR_04024";
+	public static final String ERR_04025 = "ERR_00025";
+	public static final String ERR_04026 = "ERR_04026";
+	public static final String ERR_04027 = "ERR_04027";
+	public static final String ERR_04028 = "ERR_04028";
+	public static final String ERR_04029 = "ERR_04029";
+	public static final String ERR_04030 = "ERR_04030";
+	public static final String ERR_04031 = "ERR_04031";
+	public static final String ERR_04032 = "ERR_04032";
+	public static final String ERR_04033 = "ERR_04033";
+	public static final String ERR_04034 = "ERR_04034";
+	public static final String ERR_04035 = "ERR_04035";
+	public static final String ERR_04036 = "ERR_04036";
+	public static final String ERR_04037 = "ERR_04037";
+	public static final String ERR_04038 = "ERR_04038";
+	public static final String ERR_04039 = "ERR_04039";
+	public static final String ERR_04040 = "ERR_04040";
+	public static final String ERR_04041 = "ERR_04041";
+	public static final String ERR_04042 = "ERR_04042";
+	public static final String ERR_04043 = "ERR_04043";
+	public static final String ERR_04044 = "ERR_04044";
+	public static final String ERR_04045 = "ERR_04045";
+	public static final String ERR_04046 = "ERR_04046";
+	public static final String ERR_04047 = "ERR_04047";
+	public static final String ERR_04048 = "ERR_04048";
+	public static final String ERR_04049 = "ERR_04049";
+	public static final String ERR_04050 = "ERR_04050";
+	public static final String ERR_04051 = "ERR_04051";
+	public static final String ERR_04052 = "ERR_04052";
+	public static final String ERR_04053 = "ERR_04053";
+	public static final String ERR_04054 = "ERR_04054";
+	public static final String ERR_04055 = "ERR_04055";
+	public static final String ERR_04056 = "ERR_04056";
+	public static final String ERR_04057 = "ERR_04057";
+	public static final String ERR_04058 = "ERR_04058";
+	public static final String ERR_04059 = "ERR_04059";
+	public static final String ERR_04060 = "ERR_04060";
+	public static final String ERR_04061 = "ERR_04061";
+	public static final String ERR_04062 = "ERR_04062";
+	public static final String ERR_04063 = "ERR_04063";
+	public static final String ERR_04064 = "ERR_04064";
+	public static final String ERR_04065 = "ERR_04065";
+	public static final String ERR_04066 = "ERR_04066";
+	public static final String ERR_04067 = "ERR_04067";
+	public static final String ERR_04068 = "ERR_04068";
+	public static final String ERR_04069 = "ERR_04069";
+	public static final String ERR_04070 = "ERR_04070";
+	public static final String ERR_04071 = "ERR_04071";
+	public static final String ERR_04072 = "ERR_04072";
+	public static final String ERR_04073 = "ERR_04073";
+	public static final String ERR_04074 = "ERR_04074";
+	public static final String ERR_04075 = "ERR_04075";
+	public static final String ERR_04076 = "ERR_04076";
+	public static final String ERR_04077 = "ERR_04077";
+	public static final String ERR_04078 = "ERR_04078";
+	public static final String ERR_04079 = "ERR_04079";
+	public static final String ERR_04080 = "ERR_04080";
+	public static final String ERR_04081 = "ERR_04081";
+	public static final String ERR_04082 = "ERR_04082";
+	public static final String ERR_04083 = "ERR_04083";
+	public static final String ERR_04084 = "ERR_04084";
+	public static final String ERR_04085 = "ERR_04085";
+	public static final String ERR_04086 = "ERR_04086";
+	public static final String ERR_04087 = "ERR_04087";
+	public static final String ERR_04088 = "ERR_04088";
+	public static final String ERR_04089 = "ERR_04089";
+	public static final String ERR_04090 = "ERR_04090";
+	public static final String ERR_04091 = "ERR_04091";
+	public static final String ERR_04092 = "ERR_04092";
+	public static final String ERR_04093 = "ERR_04093";
+	public static final String ERR_04094 = "ERR_04094";
+	public static final String ERR_04095 = "ERR_04095";
+	public static final String ERR_04096 = "ERR_04096";
+	public static final String ERR_04097 = "ERR_04097";
+	public static final String ERR_04098 = "ERR_04098";
+	public static final String ERR_04099 = "ERR_04099";
+	public static final String ERR_04100 = "ERR_04100";
+	public static final String ERR_04101 = "ERR_04101";
+	public static final String ERR_04102 = "ERR_04102";
+	public static final String ERR_04103 = "ERR_04103";
+	public static final String ERR_04104 = "ERR_04104";
+	public static final String ERR_04105 = "ERR_04105";
+	public static final String ERR_04106 = "ERR_04106";
+	public static final String ERR_04107 = "ERR_04107";
+	public static final String ERR_04108 = "ERR_04108";
+	public static final String ERR_04109 = "ERR_04109";
+	public static final String ERR_04110 = "ERR_04110";
+	public static final String ERR_04111 = "ERR_04111";
+	public static final String ERR_04112 = "ERR_04112";
+	public static final String ERR_04113 = "ERR_04113";
+	public static final String ERR_04114 = "ERR_04114";
+	public static final String ERR_04115 = "ERR_04115";
+	public static final String ERR_04116 = "ERR_04116";
+	public static final String ERR_04117 = "ERR_04117";
+	public static final String ERR_04118 = "ERR_04118";
+	public static final String ERR_04119 = "ERR_04119";
+	public static final String ERR_04120 = "ERR_04120";
+	public static final String ERR_04121 = "ERR_04121";
+	public static final String ERR_04122 = "ERR_04122";
+	public static final String ERR_04123 = "ERR_04123";
+	public static final String ERR_04124 = "ERR_04124";
+	public static final String ERR_04125 = "ERR_00025";
+	public static final String ERR_04126 = "ERR_04126";
+	public static final String ERR_04127 = "ERR_04127";
+	public static final String ERR_04128 = "ERR_04128";
+	public static final String ERR_04129 = "ERR_04129";
+	public static final String ERR_04130 = "ERR_04130";
+	public static final String ERR_04131 = "ERR_04131";
+	public static final String ERR_04132 = "ERR_04132";
+	public static final String ERR_04133 = "ERR_04133";
+	public static final String ERR_04134 = "ERR_04134";
+	public static final String ERR_04135 = "ERR_04135";
+	public static final String ERR_04136 = "ERR_04136";
+	public static final String ERR_04137 = "ERR_04137";
+	public static final String ERR_04138 = "ERR_04138";
+	public static final String ERR_04139 = "ERR_04139";
+	public static final String ERR_04140 = "ERR_04140";
+	public static final String ERR_04141 = "ERR_04141";
+	public static final String ERR_04142 = "ERR_04142";
+	public static final String ERR_04143 = "ERR_04143";
+	public static final String ERR_04144 = "ERR_04144";
+	public static final String ERR_04145 = "ERR_04145";
+	public static final String ERR_04146 = "ERR_04146";
+	public static final String ERR_04147 = "ERR_04147";
+	public static final String ERR_04148 = "ERR_04148";
+	public static final String ERR_04149 = "ERR_04149";
+	public static final String ERR_04150 = "ERR_04150";
+	public static final String ERR_04151 = "ERR_04151";
+	public static final String ERR_04152 = "ERR_04152";
+	public static final String ERR_04153 = "ERR_04153";
+	public static final String ERR_04154 = "ERR_04154";
+	public static final String ERR_04155 = "ERR_04155";
+	public static final String ERR_04156 = "ERR_04156";
+	public static final String ERR_04157 = "ERR_04157";
+	public static final String ERR_04158 = "ERR_04158";
+	public static final String ERR_04159 = "ERR_04159";
+	public static final String ERR_04160 = "ERR_04160";
+	public static final String ERR_04161 = "ERR_04161";
+	public static final String ERR_04162 = "ERR_04162";
+	public static final String ERR_04163 = "ERR_04163";
+	public static final String ERR_04164 = "ERR_04164";
+	public static final String ERR_04165 = "ERR_04165";
+	public static final String ERR_04166 = "ERR_04166";
+	public static final String ERR_04167 = "ERR_04167";
+	public static final String ERR_04168 = "ERR_04168";
+	public static final String ERR_04169 = "ERR_04169";
+	public static final String ERR_04170 = "ERR_04170";
+	public static final String ERR_04171 = "ERR_04171";
+	public static final String ERR_04172 = "ERR_04172";
+	public static final String ERR_04173 = "ERR_04173";
+	public static final String ERR_04174 = "ERR_04174";
+	public static final String ERR_04175 = "ERR_04175";
+	public static final String ERR_04176 = "ERR_04176";
+	public static final String ERR_04177 = "ERR_04177";
+	public static final String ERR_04178 = "ERR_04178";
+	public static final String ERR_04179 = "ERR_04179";
+	public static final String ERR_04180 = "ERR_04180";
+	public static final String ERR_04181 = "ERR_04181";
+	public static final String ERR_04182 = "ERR_04182";
+	public static final String ERR_04183 = "ERR_04183";
+	public static final String ERR_04184 = "ERR_04184";
+	public static final String ERR_04185 = "ERR_04185";
+	public static final String ERR_04186 = "ERR_04186";
+	public static final String ERR_04187 = "ERR_04187";
+	public static final String ERR_04188 = "ERR_04188";
+	public static final String ERR_04189 = "ERR_04189";
+	public static final String ERR_04190 = "ERR_04190";
+	public static final String ERR_04191 = "ERR_04191";
+	public static final String ERR_04192 = "ERR_04192";
+	public static final String ERR_04193 = "ERR_04193";
+	public static final String ERR_04194 = "ERR_04194";
+	public static final String ERR_04195 = "ERR_04195";
+	public static final String ERR_04196 = "ERR_04196";
+	public static final String ERR_04197 = "ERR_04197";
+	public static final String ERR_04198 = "ERR_04198";
+	public static final String ERR_04199 = "ERR_04199";
+	public static final String ERR_04200 = "ERR_04200";
+	public static final String ERR_04201 = "ERR_04201";
+	public static final String ERR_04202 = "ERR_04202";
+	public static final String ERR_04203 = "ERR_04203";
+	public static final String ERR_04204 = "ERR_04204";
+	public static final String ERR_04205 = "ERR_04205";
+	public static final String ERR_04206 = "ERR_04206";
+	public static final String ERR_04207 = "ERR_04207";
+	public static final String ERR_04208 = "ERR_04208";
+	public static final String ERR_04209 = "ERR_04209";
+	public static final String ERR_04210 = "ERR_04210";
+
+	// cursor
+	public static final String ERR_05001 = "ERR_05001";
+	public static final String ERR_05002 = "ERR_05002";
+	public static final String ERR_05003 = "ERR_05003";
+	public static final String ERR_05004 = "ERR_05004";
+	public static final String ERR_05005 = "ERR_05005";
+	public static final String ERR_05006 = "ERR_05006";
+	public static final String ERR_05007 = "ERR_05007";
+	public static final String ERR_05008 = "ERR_05008";
+	public static final String ERR_05009 = "ERR_05009";
+	public static final String ERR_05010 = "ERR_05010";
+	public static final String ERR_05011 = "ERR_05011";
+	public static final String ERR_05012 = "ERR_05012";
+	public static final String ERR_05013 = "ERR_05013";
+	public static final String ERR_05014 = "ERR_05014";
+	public static final String ERR_05015 = "ERR_05015";
+	public static final String ERR_05016 = "ERR_05016";
+	public static final String ERR_05017 = "ERR_05017";
+	public static final String ERR_05018 = "ERR_05018";
+	public static final String ERR_05019 = "ERR_05019";
+	public static final String ERR_05020 = "ERR_05020";
+	public static final String ERR_05021 = "ERR_05021";
+	public static final String ERR_05022 = "ERR_05022";
+	public static final String ERR_05023 = "ERR_05023";
+	public static final String ERR_05024 = "ERR_05024";
+	public static final String ERR_05025 = "ERR_00025";
+	public static final String ERR_05026 = "ERR_05026";
+	public static final String ERR_05027 = "ERR_05027";
+	public static final String ERR_05028 = "ERR_05028";
+	public static final String ERR_05029 = "ERR_05029";
+	public static final String ERR_05030 = "ERR_05030";
+	public static final String ERR_05031 = "ERR_05031";
+	public static final String ERR_05032 = "ERR_05032";
+	public static final String ERR_05033 = "ERR_05033";
+	public static final String ERR_05034 = "ERR_05034";
+	public static final String ERR_05035 = "ERR_05035";
+	public static final String ERR_05036 = "ERR_05036";
+	public static final String ERR_05037 = "ERR_05037";
+	public static final String ERR_05038 = "ERR_05038";
+	public static final String ERR_05039 = "ERR_05039";
+	public static final String ERR_05040 = "ERR_05040";
+
+	
+    /**
+     * 
+     * Translate an error code with argument(s)
+     *
+     * @param err The error code
+     * @param args The argument(s)
+     * @return
+     */
+    public static String err( String err, Object... args )
+    {
+        try
+        {
+            return err + " " + MessageFormat.format( errBundle.getString( err ), args );
+        }
+        catch ( Exception e )
+        {
+            StringBuffer sb = new StringBuffer();
+            boolean comma = false;
+            for ( Object obj : args )
+            {
+                if ( comma )
+                {
+                    sb.append( "," );
+                }
+                else
+                {
+                    comma = true;
+                }
+                sb.append( obj );
+            }
+            return err + " (" + sb.toString() + ")";
+        }
+    }
+
+
+    /**
+     * 
+     * Translate a message with argument(s)
+     *
+     * @param msg The message
+     * @param args The argument(s)
+     * @return
+     */
+    public static String msg( String msg, Object... args )
+    {
+        try
+        {
+            return MessageFormat.format( msgBundle.getString( msg ), args );
+        }
+        catch ( MissingResourceException mre )
+        {
+            try
+            {
+                return MessageFormat.format( msg, args );
+            }
+            catch ( Exception e )
+            {
+                StringBuffer sb = new StringBuffer();
+                boolean comma = false;
+                for ( Object obj : args )
+                {
+                    if ( comma )
+                    {
+                        sb.append( "," );
+                    }
+                    else
+                    {
+                        comma = true;
+                    }
+                    sb.append( obj );
+                }
+                return msg + " (" + sb.toString() + ")";
+            }
+        }
+    }
+
+}

Propchange: directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
URL: http://svn.apache.org/viewvc/directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties?rev=912399&view=auto
==============================================================================
--- directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties (added)
+++ directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties Sun Feb 21 20:52:31 2010
@@ -0,0 +1,388 @@
+# asn1
+ERR_00001=Bad transition from state {0}, tag {1}
+ERR_00002=Bad transition !
+ERR_00003=Cannot put a PDU in a null buffer !
+ERR_00004=The PDU buffer size is too small !
+ERR_00005=Overflow : can't have more than 4 bytes long length
+ERR_00006=Length reserved extension used
+ERR_00007=The current container TLV is null.
+ERR_00008=The current Value length {0} is above the expected length {1}
+ERR_00009=The PDU is decoded, but we should have had more TLVs
+ERR_00010=Truncated PDU. Some elements are lacking, accordingly to the grammar
+ERR_00011=Length above 126 bytes are not allowed for a definite form Length
+ERR_00012=argument not a byte array
+ERR_00013=Odd number of characters.
+ERR_00014=Illegal hexadecimal charcter {0} at index {1}
+ERR_00015=non-hex character '{0}' encountered
+ERR_00016=End of stream.
+ERR_00017=EOF found when length expected.
+ERR_00018=DER length more than 4 bytes.
+ERR_00019=EOF found reading length.
+ERR_00020=Corrupted steam - negative length found.
+ERR_00021=EOF encountered in middle of object.
+ERR_00022=Attempt to read past end of file.
+ERR_00023=Unknown BER object encountered.
+ERR_00024=Object not DEREncodable.
+ERR_00025={0} found in input should only contain DEROctetString.
+ERR_00026=Exception converting octets {0}
+ERR_00027=Not implemented: {0}
+ERR_00028=Internal error encoding BitString.
+ERR_00029=Null or negative length are not allowed
+ERR_00030=Bad bit number : out of bound
+ERR_00031=Cannot get a bit at position {0} when the BitString contains only {1} ints
+ERR_00032=Null OID
+ERR_00033=Invalid OID : {0}
+ERR_00034=The value is 0 byte long. This is not allowed for a boolean
+ERR_00035=The value is not 1 byte long. This is not allowed for a boolean
+ERR_00036=The value is 0 byte long. This is not allowed for an integer
+ERR_00037=The value is more than 4 bytes long. This is not allowed for an integer
+ERR_00038=The value is not in the range [{0}, {1}]
+ERR_00039=The value is 0 byte long. This is not allowed for a long
+ERR_00040=The value is more than 4 bytes long. This is not allowed for a long
+ERR_00041=Current Length is above expected Length
+
+# asn1-codec
+ERR_01001=Encoded result is not a ByteBuffer: {0}
+
+# cursor
+ERR_02001=monitor
+ERR_02002=Failure on underlying Cursor.
+ERR_02003=Underlying Cursor does not support removal.
+ERR_02004=This cursor is empty and cannot return elements!
+ERR_02005=start index '{0}' out of range
+ERR_02006=end index '{0}' out of range
+ERR_02007=start index '{0}' greater than or equal to end index '{1}' just does not make sense
+ERR_02008=don't know if list is sorted and checking that is not worth it
+ERR_02009=Cursor not positioned at an element
+ERR_02010=Without a comparator I cannot advance to just before the specified element.
+ERR_02011=Without a comparator I cannot advance to just after the specified element.
+ERR_02012=Cannot access element if positioned before first.
+ERR_02013=Cannot access element if positioned after last.
+
+# dsml-parser
+ERR_03001={0} - Line {1} - Column {2}
+ERR_03002=A requestID must be specified to each request when Processing is Parallel and ReponseOrder is Unordered.
+ERR_03003=Internal Error: {0}
+ERR_03004=Unknown type
+ERR_03005=type attribute is required
+ERR_03006=Incorrect value for 'type' attribute. This is not an OID.
+ERR_03007=Incorrect value for 'criticality' attribute
+ERR_03008=An unexpected error ocurred : {0}
+ERR_03009=the given resultCode is not an integer
+ERR_03010=code attribute is required
+ERR_03011=descr ('{0}') doesn't match with the possible values
+ERR_03012=name attribute is required
+ERR_03013=Unknown value for 'processing' attribute.
+ERR_03014=Unknown value for 'onError' attribute.
+ERR_03015=Unknown value for 'responseOrder' attribute.
+ERR_03016=requestID attribute is required
+ERR_03017=the given abandonID is not an integer
+ERR_03018=abandonID attribute is required
+ERR_03019=dn attribute is required
+ERR_03020=can not add attribute value
+ERR_03021=principal attribute is required
+ERR_03022=The request name can't be null
+ERR_03023=newrdn attribute is required
+ERR_03024=Incorrect value for 'deleteoldrdn' attribute
+ERR_03025=operation attribute is required
+ERR_03026=unknown scope. Scope must be 'baseObject', 'singleLevel' or 'wholeSubtree'.
+ERR_03027=scope attribute is required
+ERR_03028=unknown derefAliases value. derefAliases must be 'neverDerefAliases', 'derefInSearching', 'derefFindingBaseObj' or 'derefAlways'.
+ERR_03029=derefAliases attribute is required
+ERR_03030=the given sizeLimit is not an integer
+ERR_03031=the given timeLimit is not an integer
+ERR_03032=typesOnly must be a boolean ('true' or 'false').
+ERR_03033=dnAttributes must be a boolean ('true' or 'false').
+ERR_03034=Incorrect value for 'type' attribute. This is not an OID.
+ERR_03035=type attribute is required
+ERR_03036=The tag {0} can't be found at this position
+ERR_03037=An IOException occurred during parsing : {0}
+ERR_03038=The attribute requestID can't be equal to 0
+ERR_03039=the given requestID is not an integer
+ERR_03040=unable to find the batch request
+
+# ldap
+ERR_04001=identificationTag
+ERR_04002=precedence: {0}
+ERR_04003=authenticationLevel
+ERR_04004=Parser failure on ACIItem:\n\t{0}\nAntlr exception trace:\n{1}
+ERR_04005=The PDU buffer size is too small !
+ERR_04006=The And filter PDU must not be empty
+ERR_04007=The attribute description is empty
+ERR_04008=The type can't be null
+ERR_04009=The Not filter PDU must not be empty
+ERR_04010=The Or filter PDU must not be empty
+ERR_04011=The Referrals must not be null
+ERR_04012=The Substring filter PDU must not be empty
+ERR_04013=Incorrect DN given : {0} ({1}) is invalid : {2}
+ERR_04014=Incorrect DN given : {0}
+ERR_04015=The URL {0} is not valid : {1} 
+ERR_04016=Invalid URL : {0}
+ERR_04017=The name must not be null
+ERR_04018=The result code {0} is invalid : {1}. The result code must be between (0 .. 121)
+ERR_04019=The substring any filter is empty
+ERR_04020=The substring final filter is empty
+ERR_04021=The URL {0} is not valid : {1}
+ERR_04022=The type cannot be null in a MatchingRuleAssertion
+ERR_04023=Cannot put a PDU in a null buffer !
+ERR_04024=failed to decode the refreshDeletes flag for SyncDoneValueControl
+ERR_04025=failed to decode the refreshDone flag for SyncInfoValueControl
+ERR_04026=failed to decode the refreshDeletes flag for SyncInfoValueControl
+ERR_04027=Bad UUID value, its length is incorrect ( it should be 16 bytes long)
+ERR_04028=failed to decode the mode for SyncRequestValueControl
+ERR_04029=failed to decode the reloadHint flag for SyncRequestValueControl
+ERR_04030=failed to decode the mode for SyncStateValueControl
+ERR_04031=failed to decode the cancelId, the value should be between 0 and 2^31-1, it is '{0}'
+ERR_04032=invalid target DN {0}
+ERR_04033=failed to decode the target DN, it cannot be null or empty it is '{0}'
+ERR_04034=invalid issuer DN {0}
+ERR_04035=invalid subject DN {0}
+ERR_04036=failed to decode the delay, the value should be between 0 and 86400 seconds, it is '{0}'
+ERR_04037=failed to decode the timeOffline, the value should be between 0 and 720 minutes, it is '{0}'
+ERR_04038=The stored procedure language is null
+ERR_04039=The procedure can't be null
+ERR_04040=The parameter type can't be null
+ERR_04041=The parameter value can't be null
+ERR_04042=The parameter value is empty. This is not allowed.
+ERR_04043=The request name must not be null
+ERR_04044=failed to decode the changeType for EntryChangeControl
+ERR_04045=The previousDN field should not contain anything if the changeType is not MODDN
+ERR_04046=Previous DN is not allowed for this change type
+ERR_04047=Bad Previous DN : '{0}'
+ERR_04048=failed to decode the previous DN
+ERR_04049=failed to decode the changeNumber for EntryChangeControl
+ERR_04050=failed to decode the size for PagedSearchControl
+ERR_04051=failed to decode the changeTypes for PSearchControl
+ERR_04052=failed to decode the changesOnly for PSearchControl
+ERR_04053=failed to decode the returnECs for PSearchControl
+ERR_04054=The visibility flag {0} is invalid : {1}. It should be 0 or 255
+ERR_04055=Undefined changeType value: {0}
+ERR_04056=Cannot have a null matching rule and a null type
+ERR_04057=Cannot have more than one Filter within a Not Filter
+ERR_04058=Cannot have a null initial, any and final substring
+ERR_04059=Expected either a byte[] or ByteBuffer argument but got a {0}
+ERR_04060=Ldap decoder failure : {0}
+ERR_04061=Ldap decoder failure!
+ERR_04062=Ldap decoder failure, PDU does not contain enough data
+ERR_04063=The input stream does not contain a full PDU
+ERR_04064=Ldap decoder failure : The input stream does not contain a full PDU
+ERR_04065=Ldap encoder failed to encode object: {0}, error : {1}
+ERR_04066=The LdapMessage has a zero length. This is not allowed
+ERR_04067=The LdapMessage should not be empty
+ERR_04068=The messageId has a zero length. This is not allowed
+ERR_04069=The messageId should not be null
+ERR_04070=The Message Id {0} is invalid : {1}. The message ID must be between (0 .. 2 147 483 647)
+ERR_04071=The length of a UnBindRequest must be null, the actual value is {0}
+ERR_04072=The length of a UnBindRequest must be null
+ERR_04073=The entry must not be null
+ERR_04074=The DN to delete : {0} ({1}) is invalid : {2}
+ERR_04075=The AbandonRequest messageId must not be null
+ERR_04076=The Abandonned Message Id {0} is invalid : {1}. The message ID must be between (0 .. 2 147 483 647)
+ERR_04077=The BindRequest must not be null
+ERR_04078=The version {0} is invalid : {1}. The version must be between (0 .. 127)
+ERR_04079=The SaslCredential must not be null
+ERR_04080=The Referrals must not be null
+ERR_04081=The AttributeType can't be empty
+ERR_04082=Invalid operation ({0}), it should be 0, 1 or 2
+ERR_04083=The type can't be null
+ERR_04084=The AddRequest must not be null
+ERR_04085=Empty entry DN given
+ERR_04086=Null or empty types are not allowed
+ERR_04087=Error while injecting the AttributeType
+ERR_04088=The AddResponse must not be null
+ERR_04089=The entry must not be null
+ERR_04090=The newrdn must not be null
+ERR_04091=The oldRDN flag {0} is invalid : {1}. It should be 0 or 255
+ERR_04092=The new superior must not be null if the flag 'delete old DN' is set to true
+ERR_04093=The attribute description must not be null
+ERR_04094=The CompareResponse must not be null
+ERR_04095=The name must not be null
+ERR_04096=The length of a control must not be null
+ERR_04097=The OID must not be null
+ERR_04098=The control type {0} is not a valid OID
+ERR_04099=Invalid control OID : {0}
+ERR_04100=The control criticality flag {0} is invalid : {1}. It should be 0 or 255
+ERR_04101=The scope is not in [0..2] : {0}
+ERR_04102=The derefAlias is not in [0..3] : {0}
+ERR_04103=The sizeLimit is not a valid Integer: {0}
+ERR_04104=The timeLimit is not a valid Integer: {0}
+ERR_04105=The types only flag {0} is invalid : {1}. It should be 0 or 255
+ERR_04106=The attribute description should not be null
+ERR_04107=The substrings sequence is empty
+ERR_04108=The substring initial filter is empty
+ERR_04109=The matching rule is empty
+ERR_04110=The DN attributes flag {0} is invalid : {1}. It should be 0 or 255
+ERR_04111=Could not parse matchedDN while transforming Codec value to Internal: {0}
+ERR_04112=Error while transforming a ExprNode : {0}
+ERR_04113=shouldn't happen - if it does then we have issues
+ERR_04114=
+ERR_04115=
+ERR_04116=
+ERR_04117=
+ERR_04118=
+ERR_04119=
+ERR_04120=
+ERR_04121=
+ERR_04122=
+ERR_04123=
+ERR_04124=
+ERR_04125=
+ERR_04126=
+ERR_04127=
+ERR_04128=
+ERR_04129=
+ERR_04130=
+ERR_04131=
+ERR_04132=
+ERR_04133=
+ERR_04134=
+ERR_04135=
+ERR_04136=
+ERR_04137=
+ERR_04138=
+ERR_04139=
+ERR_04140=
+ERR_04141=
+ERR_04142=
+ERR_04143=
+ERR_04144=
+ERR_04145=
+ERR_04146=
+ERR_04147=
+ERR_04148=
+ERR_04149=
+ERR_04150=
+ERR_04151=
+ERR_04152=
+ERR_04153=
+ERR_04154=
+ERR_04155=
+ERR_04156=
+ERR_04157=
+ERR_04158=
+ERR_04159=
+ERR_04160=
+ERR_04161=
+ERR_04162=
+ERR_04163=
+ERR_04164=
+ERR_04165=
+ERR_04166=
+ERR_04167=
+ERR_04168=
+ERR_04169=
+ERR_04170=
+ERR_04171=
+ERR_04172=
+ERR_04173=
+ERR_04174=
+ERR_04175=
+ERR_04176=
+ERR_04177=
+ERR_04178=
+ERR_04179=
+ERR_04180=
+ERR_04181=
+ERR_04182=
+ERR_04183=
+ERR_04184=
+ERR_04185=
+ERR_04186=
+ERR_04187=
+ERR_04188=
+ERR_04189=
+ERR_04190=
+ERR_04191=
+ERR_04192=
+ERR_04193=
+ERR_04194=
+ERR_04195=
+ERR_04196=
+ERR_04197=
+ERR_04198=
+ERR_04199=
+ERR_04200=
+ERR_04201=
+ERR_04202=
+ERR_04203=
+ERR_04204=
+ERR_04205=
+ERR_04206=
+ERR_04207=
+ERR_04208=
+ERR_04209=
+ERR_04210=
+ERR_04211=
+ERR_04212=
+ERR_04213=
+ERR_04214=
+ERR_04215=
+ERR_04216=
+ERR_04217=
+ERR_04218=
+ERR_04219=
+ERR_04220=
+ERR_04221=
+ERR_04222=
+ERR_04223=
+ERR_04224=
+ERR_04225=
+ERR_04226=
+ERR_04227=
+ERR_04228=
+ERR_04229=
+ERR_04230=
+ERR_04231=
+ERR_04232=
+ERR_04233=
+ERR_04234=
+ERR_04235=
+ERR_04236=
+ERR_04237=
+ERR_04238=
+ERR_04239=
+ERR_04240=
+
+# ldap
+ERR_04001=
+ERR_04002=
+ERR_04003=
+ERR_04004=
+ERR_04005=
+ERR_04006=
+ERR_04007=
+ERR_04008=
+ERR_04009=
+ERR_04010=
+ERR_04011=
+ERR_04012=
+ERR_04013=
+ERR_04014=
+ERR_04015=
+ERR_04016=
+ERR_04017=
+ERR_04018=
+ERR_04019=
+ERR_04020=
+ERR_04021=
+ERR_04022=
+ERR_04023=
+ERR_04024=
+ERR_04025=
+ERR_04026=
+ERR_04027=
+ERR_04028=
+ERR_04029=
+ERR_04030=
+ERR_04031=
+ERR_04032=
+ERR_04033=
+ERR_04034=
+ERR_04035=
+ERR_04036=
+ERR_04037=
+ERR_04038=
+ERR_04039=
+ERR_04040=
+
+

Propchange: directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/messages.properties
URL: http://svn.apache.org/viewvc/directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/messages.properties?rev=912399&view=auto
==============================================================================
    (empty)

Propchange: directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/messages.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: directory/shared/trunk/ldap/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/pom.xml?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/ldap/pom.xml (original)
+++ directory/shared/trunk/ldap/pom.xml Sun Feb 21 20:52:31 2010
@@ -66,6 +66,12 @@
     </dependency>
 
     <dependency>
+      <artifactId>shared-i18n</artifactId>
+      <groupId>${groupId}</groupId>
+      <version>${version}</version>
+    </dependency> 
+    
+    <dependency>
       <groupId>antlr</groupId>
       <artifactId>antlr</artifactId>
       <version>${antlr.version}</version>

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java Sun Feb 21 20:52:31 2010
@@ -25,6 +25,7 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 
 
@@ -60,15 +61,15 @@
     {
         if ( identificationTag == null )
         {
-            throw new NullPointerException( "identificationTag" );
+            throw new NullPointerException( I18n.err( I18n.ERR_04001 ) );
         }
         if ( precedence < 0 || precedence > 255 )
         {
-            throw new IllegalArgumentException( "precedence: " + precedence );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04002, precedence ) );
         }
         if ( authenticationLevel == null )
         {
-            throw new NullPointerException( "authenticationLevel" );
+            throw new NullPointerException( I18n.err( I18n.ERR_04003 ) );
         }
 
         this.identificationTag = identificationTag;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java Sun Feb 21 20:52:31 2010
@@ -24,6 +24,8 @@
 import java.io.StringReader;
 import java.text.ParseException;
 
+import org.apache.directory.shared.i18n.I18n;
+
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
 
@@ -94,15 +96,11 @@
         }
         catch ( TokenStreamException e )
         {
-            String msg = "Parser failure on ACIItem:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
-            throw new ParseException( msg, 0 );
+            throw new ParseException( I18n.err( I18n.ERR_00004, spec, e.getLocalizedMessage() ), 0 );
         }
         catch ( RecognitionException e )
         {
-            String msg = "Parser failure on ACIItem:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
-            throw new ParseException( msg, e.getColumn() );
+            throw new ParseException( I18n.err( I18n.ERR_00004, spec, e.getLocalizedMessage() ), e.getColumn() );
         }
 
         return;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java Sun Feb 21 20:52:31 2010
@@ -25,6 +25,7 @@
 import java.text.ParseException;
 import java.util.Map;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 
@@ -118,15 +119,11 @@
         }
         catch ( TokenStreamException e )
         {
-            String msg = "Parser failure on ACIItem:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
-            throw new ParseException( msg, 0 );
+            throw new ParseException( I18n.err( I18n.ERR_00004, spec, e.getLocalizedMessage() ), 0 );
         }
         catch ( RecognitionException e )
         {
-            String msg = "Parser failure on ACIItem:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
-            throw new ParseException( msg, e.getColumn() );
+            throw new ParseException( I18n.err( I18n.ERR_00004, spec, e.getLocalizedMessage() ), e.getColumn() );
         }
 
         return aCIItem;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java Sun Feb 21 20:52:31 2010
@@ -27,6 +27,7 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 
 
@@ -80,12 +81,12 @@
     {
         if ( authenticationLevel == null )
         {
-            throw new NullPointerException( "authenticationLevel" );
+            throw new NullPointerException( I18n.err( I18n.ERR_04003) );
         }
 
         if ( precedence < 0 || precedence > 255 )
         {
-            throw new IllegalArgumentException( "precedence: " + precedence );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04002, precedence ) );
         }
 
         this.userClasses = Collections.unmodifiableCollection( new ArrayList<UserClass>( userClasses ) );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java Sun Feb 21 20:52:31 2010
@@ -28,6 +28,7 @@
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.stateful.DecoderCallback;
 import org.apache.directory.shared.asn1.codec.stateful.DecoderMonitor;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.message.spi.BinaryAttributeDetector;
 import org.apache.directory.shared.ldap.message.spi.Provider;
 import org.apache.directory.shared.ldap.message.spi.ProviderDecoder;
@@ -102,8 +103,7 @@
         }
         else
         {
-            throw new DecoderException( "Expected either a byte[] or " + "ByteBuffer argument but got a "
-                + encoded.getClass() );
+            throw new DecoderException( I18n.err( I18n.ERR_04059, encoded.getClass() ) );
         }
 
         while ( buf.hasRemaining() )
@@ -182,8 +182,8 @@
         }
         catch ( Exception e )
         {
-            log.error( "Ldap decoder failure : " + e.getMessage() );
-            ProviderException pe = new ProviderException( provider, "Ldap decoder failure!" );
+            log.error( I18n.err( I18n.ERR_04060, e.getLocalizedMessage() ) );
+            ProviderException pe = new ProviderException( provider, I18n.err( I18n.ERR_04061 ) );
             pe.addThrowable( e );
             throw pe;
         }
@@ -215,10 +215,10 @@
             }
             else
             {
-                log.error( "Ldap decoder failure, PDU does not contain enough data" );
-                ProviderException pe = new ProviderException( provider, "Ldap decoder failure!" );
+                log.error( I18n.err( I18n.ERR_04062 ) );
+                ProviderException pe = new ProviderException( provider, I18n.err( I18n.ERR_04061 ) );
                 //noinspection ThrowableInstanceNeverThrown
-                pe.addThrowable( new DecoderException( "The input stream does not contain a full PDU" ) );
+                pe.addThrowable( new DecoderException( I18n.err( I18n.ERR_04063 ) ) );
                 throw pe;
             }
         }
@@ -238,8 +238,8 @@
             }
             catch ( Exception e )
             {
-                log.error( "Ldap decoder failure : " + e.getMessage() );
-                ProviderException pe = new ProviderException( provider, "Ldap decoder failure!" );
+                log.error( I18n.err( I18n.ERR_04060, e.getLocalizedMessage() ) );
+                ProviderException pe = new ProviderException( provider, I18n.err( I18n.ERR_04061 ) );
                 pe.addThrowable( e );
                 throw pe;
             }
@@ -255,10 +255,10 @@
             }
             else
             {
-                log.error( "Ldap decoder failure : The input stream does not contain a full PDU" );
-                ProviderException pe = new ProviderException( provider, "Ldap decoder failure!" );
+                log.error( I18n.err( I18n.ERR_04064 ) );
+                ProviderException pe = new ProviderException( provider, I18n.err( I18n.ERR_04062 ) );
                 //noinspection ThrowableInstanceNeverThrown
-                pe.addThrowable( new DecoderException( "The input stream does not contain a full PDU" ) );
+                pe.addThrowable( new DecoderException( I18n.err( I18n.ERR_04063 ) ) );
                 throw pe;
             }
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java Sun Feb 21 20:52:31 2010
@@ -30,6 +30,7 @@
 import org.apache.directory.shared.asn1.codec.stateful.EncoderCallback;
 import org.apache.directory.shared.asn1.codec.stateful.EncoderMonitor;
 import org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.message.spi.Provider;
 import org.apache.directory.shared.ldap.message.spi.ProviderEncoder;
@@ -98,9 +99,8 @@
         }
         catch ( EncoderException e )
         {
-            log.error( "Ldap encoder failed to encode object: " + obj + ", error : " + e.getMessage() );
-            ProviderException pe = new ProviderException( provider, "Ldap encoder failed to encode object: " + obj
-                + ", error : " + e.getMessage() );
+            log.error( I18n.err( I18n.ERR_04065, obj, e.getLocalizedMessage() ) );
+            ProviderException pe = new ProviderException( provider, I18n.err( I18n.ERR_04065, obj, e.getLocalizedMessage() ) );
             throw pe;
         }
     }
@@ -135,9 +135,8 @@
         }
         catch ( EncoderException e )
         {
-            log.error( "Ldap encoder failed to encode object: " + obj + ", error : " + e.getMessage() );
-            ProviderException pe = new ProviderException( provider, "Ldap encoder failed to encode object: " + obj
-                + ", error : " + e.getMessage() );
+            log.error( I18n.err( I18n.ERR_04065, obj, e.getLocalizedMessage() ) );
+            ProviderException pe = new ProviderException( provider, I18n.err( I18n.ERR_04065, obj, e.getLocalizedMessage() ) );
             throw pe;
         }
     }
@@ -171,9 +170,8 @@
         }
         catch ( EncoderException e )
         {
-            log.error( "Ldap encoder failed to encode object: " + obj + ", error : " + e.getMessage() );
-            ProviderException pe = new ProviderException( provider, "Ldap encoder failed to encode object: " + obj
-                + ", error : " + e.getMessage() );
+            log.error( I18n.err( I18n.ERR_04065,  obj, e.getLocalizedMessage() ) );
+            ProviderException pe = new ProviderException( provider, I18n.err( I18n.ERR_04065, obj, e.getLocalizedMessage() ) );
             throw pe;
         }
     }
@@ -262,8 +260,7 @@
             }
             catch ( IOException e )
             {
-                ProviderException pe = new ProviderException( provider,
-                    "Ldap encoder failed to encode object, error : " + e.getMessage() );
+                ProviderException pe = new ProviderException( provider, I18n.err( I18n.ERR_04065, "", e.getLocalizedMessage() ) );
                 throw pe;
             }
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java Sun Feb 21 20:52:31 2010
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.codec.EncoderException;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.controls.CodecControl;
 import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
@@ -375,7 +376,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_04005 ) );
         }
 
         // The message Id



Mime
View raw message