You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by fe...@apache.org on 2010/01/22 21:58:28 UTC
svn commit: r902265 - in /directory/apacheds/trunk:
core-entry/src/main/java/org/apache/directory/server/core/entry/
i18n/src/main/resources/org/apache/directory/server/i18n/
Author: felixk
Date: Fri Jan 22 20:58:28 2010
New Revision: 902265
URL: http://svn.apache.org/viewvc?rev=902265&view=rev
Log:
I18n
Modified:
directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java
directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java
directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java
directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java
directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties
Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java?rev=902265&r1=902264&r2=902265&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java Fri Jan 22 20:58:28 2010
@@ -30,6 +30,7 @@
import javax.naming.NamingException;
+import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.entry.Entry;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Value;
@@ -427,7 +428,7 @@
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerAttribute" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_455 ) );
}
@@ -438,7 +439,7 @@
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerEntry" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_456 ) );
}
Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java?rev=902265&r1=902264&r2=902265&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java Fri Jan 22 20:58:28 2010
@@ -163,7 +163,7 @@
{
if ( attributeType == null )
{
- throw new IllegalArgumentException( "The AttributeType parameter should not be null" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_457 ) );
}
setAttributeType( attributeType );
@@ -223,7 +223,7 @@
{
if ( attributeType == null )
{
- throw new IllegalArgumentException( "The AttributeType parameter should not be null" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_457 ) );
}
setAttributeType( attributeType );
@@ -255,7 +255,7 @@
{
if ( attributeType == null )
{
- throw new IllegalArgumentException( "The AttributeType parameter should not be null" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_457 ) );
}
setAttributeType( attributeType );
@@ -287,7 +287,7 @@
{
if ( attributeType == null )
{
- throw new IllegalArgumentException( "The AttributeType parameter should not be null" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_457 ) );
}
setAttributeType( attributeType );
@@ -967,15 +967,13 @@
else
{
// The id is incorrect : this is not allowed
- throw new IllegalArgumentException( "The ID '" + id + "'is incompatible with the AttributeType's id '" +
- attributeType.getName() + "'" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_458, id, attributeType.getName() ) );
}
}
}
else
{
- throw new IllegalArgumentException( "An ID cannnot be null, empty, or resolved to an emtpy" +
- " value when trimmed" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_459 ) );
}
}
@@ -1169,7 +1167,7 @@
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerAttribute" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_455 ) );
}
@@ -1230,7 +1228,7 @@
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerAttribute" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_455 ) );
}
Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java?rev=902265&r1=902264&r2=902265&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java Fri Jan 22 20:58:28 2010
@@ -2299,7 +2299,7 @@
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerEntry" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_456 ) );
}
@@ -2355,7 +2355,7 @@
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerAttribute" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_455 ) );
}
@@ -2395,7 +2395,7 @@
catch ( NamingException ne )
{
// We weren't able to find the OID. The attribute will not be added
- LOG.warn( "Cannot read the attribute as it's OID ('" + oid + "') does not exist" );
+ LOG.warn( I18n.err( I18n.ERR_460, oid ) );
}
}
Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java?rev=902265&r1=902264&r2=902265&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java Fri Jan 22 20:58:28 2010
@@ -114,12 +114,12 @@
if ( attributeType == null )
{
- throw new IllegalArgumentException( "The AttributeType parameter should not be null" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_461 ) );
}
if ( attributeType.getSyntax() == null )
{
- throw new IllegalArgumentException( "There is no Syntax associated with this attributeType" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_462 ) );
}
if ( attributeType.getSyntax().isHumanReadable() )
@@ -605,7 +605,7 @@
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerStringValue" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_463 ) );
}
@@ -702,7 +702,7 @@
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerStringValue" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_463 ) );
}
Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java?rev=902265&r1=902264&r2=902265&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java Fri Jan 22 20:58:28 2010
@@ -35,6 +35,7 @@
import javax.naming.directory.ModificationItem;
import javax.naming.directory.SearchResult;
+import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Modification;
@@ -300,7 +301,7 @@
break;
default:
- throw new IllegalStateException( "undefined modification type: " + modOp );
+ throw new IllegalStateException( I18n.err( I18n.ERR_464, modOp ) );
}
return targetEntry;
@@ -324,7 +325,7 @@
{
if ( attr0 == null && attr1 == null )
{
- throw new IllegalArgumentException( "Cannot figure out attribute ID if both args are null" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_465 ) );
}
else if ( attr0 == null )
{
@@ -336,7 +337,7 @@
}
else if ( !attr0.getAttributeType().equals( attr1.getAttributeType() ) )
{
- throw new IllegalArgumentException( "Cannot take union of attributes with different IDs!" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_466 ) );
}
ServerAttribute attr = (ServerAttribute)attr0.clone();
@@ -465,7 +466,7 @@
{
// The attributeType does not exist in the schema.
// It's an error
- String message = "The AttributeType '" + id + "' does not exist in the schema";
+ String message = I18n.err( I18n.ERR_467, id );
throw new LdapInvalidAttributeIdentifierException( message );
}
else
@@ -650,7 +651,7 @@
catch ( NamingException ne )
{
NoSuchElementException nsee =
- new NoSuchElementException( "Encountered NamingException on underlying enumeration." );
+ new NoSuchElementException( I18n.err( I18n.ERR_468 ) );
nsee.initCause( ne );
throw nsee;
}
Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java?rev=902265&r1=902264&r2=902265&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java Fri Jan 22 20:58:28 2010
@@ -253,7 +253,7 @@
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerEntry" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_456 ) );
}
@@ -264,7 +264,7 @@
*/
public void readExternal( ObjectInput in ) throws IOException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerEntry" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_456 ) );
}
@@ -304,7 +304,7 @@
{
if ( attribute == null )
{
- throw new IOException( "Cannot serialize a Modification with no attribute" );
+ throw new IOException( I18n.err( I18n.ERR_469 ) );
}
// Write the operation
Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java?rev=902265&r1=902264&r2=902265&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java Fri Jan 22 20:58:28 2010
@@ -106,12 +106,12 @@
if ( attributeType == null )
{
- throw new IllegalArgumentException( "The AttributeType parameter should not be null" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_470 ) );
}
if ( attributeType.getSyntax() == null )
{
- throw new IllegalArgumentException( "There is no Syntax associated with this attributeType" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_471 ) );
}
if ( ! attributeType.getSyntax().isHumanReadable() )
@@ -556,7 +556,7 @@
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerStringValue" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_463 ) );
}
@@ -629,7 +629,7 @@
*/
public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
{
- throw new IllegalStateException( "Cannot use standard serialization for a ServerStringValue" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_463 ) );
}
Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java?rev=902265&r1=902264&r2=902265&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java Fri Jan 22 20:58:28 2010
@@ -21,6 +21,7 @@
import javax.naming.NamingException;
+import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
@@ -155,7 +156,7 @@
return 2;
}
- throw new IllegalArgumentException( "Not a valid value" );
+ throw new IllegalArgumentException( I18n.err( I18n.ERR_472 ) );
}
} );
@@ -170,7 +171,7 @@
return new ClientStringValue( value.getString().toLowerCase() );
}
- throw new IllegalStateException( "expected string to normalize" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_473 ) );
}
@@ -274,12 +275,12 @@
return new ClientBinaryValue( StringTools.trim( newVal ) );
}
- throw new IllegalStateException( "expected byte[] to normalize" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_474 ) );
}
public String normalize( String value ) throws NamingException
{
- throw new IllegalStateException( "expected byte[] to normalize" );
+ throw new IllegalStateException( I18n.err( I18n.ERR_474 ) );
}
} );
Modified: directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties?rev=902265&r1=902264&r2=902265&view=diff
==============================================================================
--- directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties (original)
+++ directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties Fri Jan 22 20:58:28 2010
@@ -441,10 +441,10 @@
ERR_417=The following does not conform to the objectClassDescription syntax: {0}
ERR_418=Cannot permit the addition of an objectClass with an invalid superior objectClass: {0}
ERR_419=Cannot permit the addition of an objectClass with an invalid attributeType in the mayList: {0}
-ERR_420=Cannot permit the addition of an objectClass with an invalid attributeType in the mustList: {0}
+ERR_420=Cannot permit the addition of an objectClass with an invalid attributeType in the mustList\: {0}
ERR_421=The following does not conform to the matchingRuleUseDescription syntax: {0}
ERR_422=The following does not conform to the ldapSyntax description syntax: {0}
-ERR_423=Cannot permit the addition of a syntax without the prior creation of a \nsyntaxChecker with the same object identifier of the syntax!
+ERR_423=Cannot permit the addition of a syntax without the prior creation of a \nsyntaxChecker with the same object identifier of the syntax\!
ERR_424=The following does not conform to the matchingRuleDescription syntax: {0}
ERR_425=Cannot create a matchingRule that depends on non-existant syntax: {0}
ERR_426=The following does not conform to the ditStructureRuleDescription syntax: {0}
@@ -476,26 +476,26 @@
ERR_452=Cannot get ordered set in singleton mode.
ERR_453=Cannot set a orderedSet when in singleton mode: use switchToSingleValue()
ERR_454=Already in ordered set mode.
-ERR_455=
-ERR_456=
-ERR_457=
-ERR_458=
-ERR_459=
-ERR_460=
-ERR_461=
-ERR_462=
-ERR_463=
-ERR_464=
-ERR_465=
-ERR_466=
-ERR_467=
-ERR_468=
-ERR_469=
-ERR_470=
-ERR_471=
-ERR_472=
-ERR_473=
-ERR_474=
+ERR_455=Cannot use standard serialization for a ServerAttribute
+ERR_456=Cannot use standard serialization for a ServerEntry
+ERR_457=The AttributeType parameter should not be null
+ERR_458=The ID '{0}'is incompatible with the AttributeType's id '{1}'
+ERR_459=An ID cannnot be null, empty, or resolved to an emtpy value when trimmed
+ERR_460=Cannot read the attribute as it's OID ('{0}') does not exist
+ERR_461=The AttributeType parameter should not be null
+ERR_462=There is no Syntax associated with this attributeType
+ERR_463=Cannot use standard serialization for a ServerStringValue
+ERR_464=undefined modification type: {0}
+ERR_465=Cannot figure out attribute ID if both args are null
+ERR_466=Cannot take union of attributes with different IDs!
+ERR_467=The AttributeType '{0}' does not exist in the schema
+ERR_468=Encountered NamingException on underlying enumeration.
+ERR_469=Cannot serialize a Modification with no attribute
+ERR_470=The AttributeType parameter should not be null
+ERR_471=There is no Syntax associated with this attributeType
+ERR_472=Not a valid value
+ERR_473=expected string to normalize
+ERR_474=expected byte[] to normalize
ERR_475=
ERR_476=
ERR_477=