directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1085792 - in /directory/studio/trunk/plugins: apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/ apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/edito...
Date Sat, 26 Mar 2011 19:20:22 GMT
Author: elecharny
Date: Sat Mar 26 19:20:21 2011
New Revision: 1085792

URL: http://svn.apache.org/viewvc?rev=1085792&view=rev
Log:
Handling the LdapInvalidAttributeValueException (changes made in shared)

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/PartitionsDiffComputer.java
    directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java
    directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java
    directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java
    directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java
    directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/PartitionsDiffComputer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/PartitionsDiffComputer.java?rev=1085792&r1=1085791&r2=1085792&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/PartitionsDiffComputer.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/PartitionsDiffComputer.java
Sat Mar 26 19:20:21 2011
@@ -33,10 +33,12 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.DefaultModification;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.*;
+import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.model.filter.FilterParser;
 import org.apache.directory.shared.ldap.model.filter.SearchScope;
 import org.apache.directory.shared.ldap.model.ldif.ChangeType;
@@ -355,9 +357,17 @@ public class PartitionsDiffComputer
                     modification.setOperation( ModificationOperation.ADD_ATTRIBUTE );
                     EntryAttribute attribute = new DefaultEntryAttribute( destinationAttributeType
);
                     modification.setAttribute( attribute );
+                    
                     for ( Value<?> value : destinationAttribute )
                     {
-                        attribute.add( value );
+                        try
+                        {
+                            attribute.add( value );
+                        }
+                        catch ( LdapInvalidAttributeValueException liave )
+                        {
+                            // TODO : handle the exception
+                        }
                     }
 
                     modificationEntry.addModificationItem( modification );
@@ -394,7 +404,15 @@ public class PartitionsDiffComputer
                 modification.setOperation( ModificationOperation.REMOVE_ATTRIBUTE );
                 EntryAttribute attribute = new DefaultEntryAttribute( originalAttribute.getAttributeType()
);
                 modification.setAttribute( attribute );
-                attribute.add( originalValue );
+                
+                try
+                {
+                    attribute.add( originalValue );
+                }
+                catch ( LdapInvalidAttributeValueException liave )
+                {
+                    // TODO : handle the exception
+                }
 
                 modificationEntry.addModificationItem( modification );
             }
@@ -412,7 +430,15 @@ public class PartitionsDiffComputer
                 modification.setOperation( ModificationOperation.ADD_ATTRIBUTE );
                 EntryAttribute attribute = new DefaultEntryAttribute( originalAttribute.getAttributeType()
);
                 modification.setAttribute( attribute );
-                attribute.add( destinationValue );
+                
+                try
+                { 
+                    attribute.add( destinationValue );
+                }
+                catch ( LdapInvalidAttributeValueException liave )
+                {
+                    // TODO : handle the exception
+                }
 
                 modificationEntry.addModificationItem( modification );
             }

Modified: directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java?rev=1085792&r1=1085791&r2=1085792&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java
Sat Mar 26 19:20:21 2011
@@ -24,10 +24,12 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.directory.shared.ldap.model.entry.*;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.studio.apacheds.configuration.editor.v150.dialogs.AttributeValueDialog;
 import org.apache.directory.studio.apacheds.configuration.editor.v150.dialogs.AttributeValueObject;
 import org.apache.directory.studio.apacheds.configuration.editor.v150.dialogs.IndexedAttributeDialog;
@@ -165,10 +167,18 @@ public class PartitionDetailsPage implem
             {
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                 EntryAttribute attribute = contextEntry.get( newAttributeValueObject.getAttribute()
);
+                
                 if ( attribute != null )
                 {
-                    attribute.add( newAttributeValueObject.getValue() );
-                }
+                    try
+                    {
+                        attribute.add( newAttributeValueObject.getValue() );
+                    }
+                    catch ( LdapInvalidAttributeValueException liave )
+                    {
+                        // TODO : handle the exception
+                    }
+}
                 else
                 {
                     try
@@ -784,9 +794,17 @@ public class PartitionDetailsPage implem
 
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                 attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
+                
                 if ( attribute != null )
                 {
-                    attribute.add( newAttributeValueObject.getValue() );
+                    try
+                    {
+                        attribute.add( newAttributeValueObject.getValue() );
+                    }
+                    catch ( LdapInvalidAttributeValueException liave )
+                    {
+                        // TODO : handle the exception
+                    }
                 }
                 else
                 {

Modified: directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java?rev=1085792&r1=1085791&r2=1085792&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java
Sat Mar 26 19:20:21 2011
@@ -24,11 +24,12 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.directory.shared.ldap.model.entry.*;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
-import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.studio.apacheds.configuration.editor.v151.dialogs.AttributeValueDialog;
 import org.apache.directory.studio.apacheds.configuration.editor.v151.dialogs.AttributeValueObject;
 import org.apache.directory.studio.apacheds.configuration.editor.v151.dialogs.IndexedAttributeDialog;
@@ -166,9 +167,17 @@ public class PartitionDetailsPage implem
             {
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                 EntryAttribute attribute = contextEntry.get( newAttributeValueObject.getAttribute()
);
+                
                 if ( attribute != null )
                 {
-                    attribute.add( newAttributeValueObject.getValue() );
+                    try
+                    {
+                        attribute.add( newAttributeValueObject.getValue() );
+                    }
+                    catch ( LdapInvalidAttributeValueException liave )
+                    {
+                        // TODO : handle the exception
+                    }
                 }
                 else
                 {
@@ -785,9 +794,17 @@ public class PartitionDetailsPage implem
 
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                 attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
+                
                 if ( attribute != null )
                 {
-                    attribute.add( newAttributeValueObject.getValue() );
+                    try
+                    {
+                        attribute.add( newAttributeValueObject.getValue() );
+                    }
+                    catch ( LdapInvalidAttributeValueException liave )
+                    {
+                        // TODO : handle the exception
+                    }
                 }
                 else
                 {

Modified: directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java?rev=1085792&r1=1085791&r2=1085792&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java
Sat Mar 26 19:20:21 2011
@@ -24,11 +24,12 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.directory.shared.ldap.model.entry.*;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.studio.apacheds.configuration.editor.v152.dialogs.AttributeValueDialog;
 import org.apache.directory.studio.apacheds.configuration.editor.v152.dialogs.AttributeValueObject;
 import org.apache.directory.studio.apacheds.configuration.editor.v152.dialogs.IndexedAttributeDialog;
@@ -166,9 +167,17 @@ public class PartitionDetailsPage implem
             {
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                 EntryAttribute attribute = contextEntry.get( newAttributeValueObject.getAttribute()
);
+                
                 if ( attribute != null )
                 {
-                    attribute.add( newAttributeValueObject.getValue() );
+                    try
+                    { 
+                        attribute.add( newAttributeValueObject.getValue() );
+                    }
+                    catch ( LdapInvalidAttributeValueException liave )
+                    {
+                        // TODO : handle the exception
+                    }
                 }
                 else
                 {
@@ -785,9 +794,17 @@ public class PartitionDetailsPage implem
 
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                 attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
+                
                 if ( attribute != null )
                 {
-                    attribute.add( newAttributeValueObject.getValue() );
+                    try
+                    {
+                        attribute.add( newAttributeValueObject.getValue() );
+                    }
+                    catch ( LdapInvalidAttributeValueException liave )
+                    {
+                        // TODO : handle the exception
+                    }
                 }
                 else
                 {

Modified: directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java?rev=1085792&r1=1085791&r2=1085792&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java
Sat Mar 26 19:20:21 2011
@@ -24,10 +24,12 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.directory.shared.ldap.model.entry.*;
-import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.studio.apacheds.configuration.editor.v153.dialogs.AttributeValueDialog;
 import org.apache.directory.studio.apacheds.configuration.editor.v153.dialogs.AttributeValueObject;
 import org.apache.directory.studio.apacheds.configuration.editor.v153.dialogs.IndexedAttributeDialog;
@@ -165,9 +167,17 @@ public class PartitionDetailsPage implem
             {
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                 EntryAttribute attribute = contextEntry.get( newAttributeValueObject.getAttribute()
);
+                
                 if ( attribute != null )
                 {
-                    attribute.add( newAttributeValueObject.getValue() );
+                    try
+                    {
+                        attribute.add( newAttributeValueObject.getValue() );
+                    }
+                    catch ( LdapInvalidAttributeValueException liave )
+                    {
+                        // TODO : handle the exception
+                    }
                 }
                 else
                 {
@@ -782,9 +792,17 @@ public class PartitionDetailsPage implem
 
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
                 attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
+                
                 if ( attribute != null )
                 {
-                    attribute.add( newAttributeValueObject.getValue() );
+                    try
+                    {
+                        attribute.add( newAttributeValueObject.getValue() );
+                    }
+                    catch ( LdapInvalidAttributeValueException liave )
+                    {
+                        // TODO : handle the exception
+                    }
                 }
                 else
                 {

Modified: directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java?rev=1085792&r1=1085791&r2=1085792&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
(original)
+++ directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
Sat Mar 26 19:20:21 2011
@@ -52,6 +52,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.DefaultModification;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.model.filter.SearchScope;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
 import org.apache.directory.shared.ldap.model.message.AddRequestImpl;
@@ -699,7 +700,16 @@ public class DirectoryApiConnectionWrapp
             for ( ModificationItem modificationItem : modificationItems )
             {
                 Modification modification = new DefaultModification();
-                modification.setAttribute( AttributeUtils.toClientAttribute( modificationItem.getAttribute()
) );
+                
+                try
+                {
+                    modification.setAttribute( AttributeUtils.toClientAttribute( modificationItem.getAttribute()
) );
+                }
+                catch ( LdapInvalidAttributeValueException liave )
+                {
+                    // TODO : handle the exception
+                }
+
                 modification.setOperation( convertModificationOperation( modificationItem.getModificationOp()
) );
                 modifications.add( modification );
             }



Mime
View raw message