directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1005372 - in /directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration: ./ src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/ src/main/java/org/apache/directory/studio/apacheds/configuration/ed...
Date Thu, 07 Oct 2010 09:07:45 GMT
Author: pamarcelot
Date: Thu Oct  7 09:07:44 2010
New Revision: 1005372

URL: http://svn.apache.org/viewvc?rev=1005372&view=rev
Log:
Fixed 'apacheds.configuration' module.

Modified:
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/pom.xml
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/AttributeValueObject.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/AttributeValueObject.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/AttributeValueObject.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/dialogs/AttributeValueObject.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/AbstractServerXmlIO.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/Partition.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/ServerXmlIOV150.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/Partition.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/Partition.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/Partition.java
    directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/ServerXmlIOV153.java

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/pom.xml?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/pom.xml (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/pom.xml Thu Oct  7 09:07:44 2010
@@ -111,7 +111,7 @@
             <Eclipse-LazyStart>true</Eclipse-LazyStart>
             <Bundle-Activator>org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin</Bundle-Activator>
             <Require-Bundle>
- org.apache.directory.shared.ldap;bundle-version="${org.apache.directory.shared.version}",
+ org.apache.directory.shared.ldap;bundle-version="${org.apache.directory.shared.validversion}",
  org.eclipse.core.resources,
  org.eclipse.core.runtime,
  org.eclipse.jface.text,

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/PartitionDetailsPage.java Thu Oct  7 09:07:44 2010
@@ -21,14 +21,14 @@ package org.apache.directory.studio.apac
 
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-
+import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 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;
@@ -92,7 +92,7 @@ public class PartitionDetailsPage implem
     private Partition input;
 
     /** The Context Entry */
-    private Attributes contextEntry;
+    private Entry contextEntry;
 
     /** The Indexed Attributes List */
     private List<IndexedAttribute> indexedAttributes;
@@ -165,15 +165,22 @@ public class PartitionDetailsPage implem
             if ( Dialog.OK == dialog.open() && dialog.isDirty() )
             {
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
-                Attribute attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
+                EntryAttribute attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
                 if ( attribute != null )
                 {
                     attribute.add( newAttributeValueObject.getValue() );
                 }
                 else
                 {
-                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
-                        newAttributeValueObject.getValue() ) );
+                    try
+                    {
+                        contextEntry.put( new DefaultEntryAttribute( newAttributeValueObject.getAttribute(),
+                            newAttributeValueObject.getValue() ) );
+                    }
+                    catch ( LdapException e1 )
+                    {
+                        // Will never occur
+                    }
                 }
 
                 contextEntryTableViewer.refresh();
@@ -203,7 +210,7 @@ public class PartitionDetailsPage implem
             {
                 AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();
 
-                Attribute attribute = contextEntry.get( attributeValueObject.getAttribute() );
+                EntryAttribute attribute = contextEntry.get( attributeValueObject.getAttribute() );
                 if ( attribute != null )
                 {
                     attribute.remove( attributeValueObject.getValue() );
@@ -405,24 +412,21 @@ public class PartitionDetailsPage implem
             public Object[] getElements( Object inputElement )
             {
                 List<AttributeValueObject> elements = new ArrayList<AttributeValueObject>();
+                Entry entry = ( Entry ) inputElement;
 
-                Attributes attributes = ( Attributes ) inputElement;
-
-                NamingEnumeration<? extends Attribute> ne = attributes.getAll();
-                while ( ne.hasMoreElements() )
+                Iterator<EntryAttribute> attributes = entry.iterator();
+                while ( attributes.hasNext() )
                 {
-                    Attribute attribute = ( Attribute ) ne.nextElement();
-                    try
-                    {
-                        NamingEnumeration<?> values = attribute.getAll();
-                        while ( values.hasMoreElements() )
-                        {
-                            elements.add( new AttributeValueObject( attribute.getID(), values.nextElement() ) );
-                        }
-                    }
-                    catch ( NamingException e )
+                    EntryAttribute attribute = attributes.next();
+
+                    Iterator<Value<?>> values = attribute.iterator();
+                    while ( values.hasNext() )
                     {
+                        Value<?> value = values.next();
+                        elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) );
+
                     }
+
                 }
 
                 return elements.toArray();
@@ -768,12 +772,12 @@ public class PartitionDetailsPage implem
             AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();
 
             String oldId = attributeValueObject.getAttribute();
-            Object oldValue = attributeValueObject.getValue();
+            String oldValue = attributeValueObject.getValue();
 
             AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
             if ( Dialog.OK == dialog.open() && dialog.isDirty() )
             {
-                Attribute attribute = contextEntry.get( oldId );
+                EntryAttribute attribute = contextEntry.get( oldId );
                 if ( attribute != null )
                 {
                     attribute.remove( oldValue );
@@ -787,8 +791,15 @@ public class PartitionDetailsPage implem
                 }
                 else
                 {
-                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
-                        newAttributeValueObject.getValue() ) );
+                    try
+                    {
+                        contextEntry.put( new DefaultEntryAttribute( newAttributeValueObject.getAttribute(),
+                            newAttributeValueObject.getValue() ) );
+                    }
+                    catch ( LdapException e )
+                    {
+                        // Will never occur
+                    }
                 }
 
                 contextEntryTableViewer.refresh();

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/AttributeValueObject.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/AttributeValueObject.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/AttributeValueObject.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v150/dialogs/AttributeValueObject.java Thu Oct  7 09:07:44 2010
@@ -31,7 +31,7 @@ public class AttributeValueObject
     private String attribute;
 
     /** The value */
-    private Object value;
+    private String value;
 
 
     /**
@@ -42,7 +42,7 @@ public class AttributeValueObject
      * @param value
      *      the value
      */
-    public AttributeValueObject( String attribute, Object value )
+    public AttributeValueObject( String attribute, String value )
     {
         this.attribute = attribute;
         this.value = value;
@@ -79,7 +79,7 @@ public class AttributeValueObject
      * @return
      *      the value
      */
-    public Object getValue()
+    public String getValue()
     {
         return value;
     }
@@ -91,7 +91,7 @@ public class AttributeValueObject
      * @param value
      *      the new value
      */
-    public void setValue( Object value )
+    public void setValue( String value )
     {
         this.value = value;
     }

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/PartitionDetailsPage.java Thu Oct  7 09:07:44 2010
@@ -21,14 +21,14 @@ package org.apache.directory.studio.apac
 
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-
+import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 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;
@@ -92,7 +92,7 @@ public class PartitionDetailsPage implem
     private Partition input;
 
     /** The Context Entry */
-    private Attributes contextEntry;
+    private Entry contextEntry;
 
     /** The Indexed Attributes List */
     private List<IndexedAttribute> indexedAttributes;
@@ -165,15 +165,22 @@ public class PartitionDetailsPage implem
             if ( Dialog.OK == dialog.open() && dialog.isDirty() )
             {
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
-                Attribute attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
+                EntryAttribute attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
                 if ( attribute != null )
                 {
                     attribute.add( newAttributeValueObject.getValue() );
                 }
                 else
                 {
-                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
-                        newAttributeValueObject.getValue() ) );
+                    try
+                    {
+                        contextEntry.put( new DefaultEntryAttribute( newAttributeValueObject.getAttribute(),
+                            newAttributeValueObject.getValue() ) );
+                    }
+                    catch ( LdapException e1 )
+                    {
+                        // Will never occur
+                    }
                 }
 
                 contextEntryTableViewer.refresh();
@@ -203,7 +210,7 @@ public class PartitionDetailsPage implem
             {
                 AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();
 
-                Attribute attribute = contextEntry.get( attributeValueObject.getAttribute() );
+                EntryAttribute attribute = contextEntry.get( attributeValueObject.getAttribute() );
                 if ( attribute != null )
                 {
                     attribute.remove( attributeValueObject.getValue() );
@@ -405,24 +412,21 @@ public class PartitionDetailsPage implem
             public Object[] getElements( Object inputElement )
             {
                 List<AttributeValueObject> elements = new ArrayList<AttributeValueObject>();
+                Entry entry = ( Entry ) inputElement;
 
-                Attributes attributes = ( Attributes ) inputElement;
-
-                NamingEnumeration<? extends Attribute> ne = attributes.getAll();
-                while ( ne.hasMoreElements() )
+                Iterator<EntryAttribute> attributes = entry.iterator();
+                while ( attributes.hasNext() )
                 {
-                    Attribute attribute = ( Attribute ) ne.nextElement();
-                    try
-                    {
-                        NamingEnumeration<?> values = attribute.getAll();
-                        while ( values.hasMoreElements() )
-                        {
-                            elements.add( new AttributeValueObject( attribute.getID(), values.nextElement() ) );
-                        }
-                    }
-                    catch ( NamingException e )
+                    EntryAttribute attribute = attributes.next();
+
+                    Iterator<Value<?>> values = attribute.iterator();
+                    while ( values.hasNext() )
                     {
+                        Value<?> value = values.next();
+                        elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) );
+
                     }
+
                 }
 
                 return elements.toArray();
@@ -768,12 +772,12 @@ public class PartitionDetailsPage implem
             AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();
 
             String oldId = attributeValueObject.getAttribute();
-            Object oldValue = attributeValueObject.getValue();
+            String oldValue = attributeValueObject.getValue();
 
             AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
             if ( Dialog.OK == dialog.open() && dialog.isDirty() )
             {
-                Attribute attribute = contextEntry.get( oldId );
+                EntryAttribute attribute = contextEntry.get( oldId );
                 if ( attribute != null )
                 {
                     attribute.remove( oldValue );
@@ -787,8 +791,15 @@ public class PartitionDetailsPage implem
                 }
                 else
                 {
-                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
-                        newAttributeValueObject.getValue() ) );
+                    try
+                    {
+                        contextEntry.put( new DefaultEntryAttribute( newAttributeValueObject.getAttribute(),
+                            newAttributeValueObject.getValue() ) );
+                    }
+                    catch ( LdapException e )
+                    {
+                        // Will never occur
+                    }
                 }
 
                 contextEntryTableViewer.refresh();

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/AttributeValueObject.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/AttributeValueObject.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/AttributeValueObject.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v151/dialogs/AttributeValueObject.java Thu Oct  7 09:07:44 2010
@@ -31,7 +31,7 @@ public class AttributeValueObject
     private String attribute;
 
     /** The value */
-    private Object value;
+    private String value;
 
 
     /**
@@ -42,7 +42,7 @@ public class AttributeValueObject
      * @param value
      *      the value
      */
-    public AttributeValueObject( String attribute, Object value )
+    public AttributeValueObject( String attribute, String value )
     {
         this.attribute = attribute;
         this.value = value;
@@ -79,7 +79,7 @@ public class AttributeValueObject
      * @return
      *      the value
      */
-    public Object getValue()
+    public String getValue()
     {
         return value;
     }
@@ -91,7 +91,7 @@ public class AttributeValueObject
      * @param value
      *      the new value
      */
-    public void setValue( Object value )
+    public void setValue( String value )
     {
         this.value = value;
     }

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/PartitionDetailsPage.java Thu Oct  7 09:07:44 2010
@@ -21,14 +21,14 @@ package org.apache.directory.studio.apac
 
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-
+import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 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;
@@ -92,7 +92,7 @@ public class PartitionDetailsPage implem
     private Partition input;
 
     /** The Context Entry */
-    private Attributes contextEntry;
+    private Entry contextEntry;
 
     /** The Indexed Attributes List */
     private List<IndexedAttribute> indexedAttributes;
@@ -165,15 +165,22 @@ public class PartitionDetailsPage implem
             if ( Dialog.OK == dialog.open() && dialog.isDirty() )
             {
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
-                Attribute attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
+                EntryAttribute attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
                 if ( attribute != null )
                 {
                     attribute.add( newAttributeValueObject.getValue() );
                 }
                 else
                 {
-                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
-                        newAttributeValueObject.getValue() ) );
+                    try
+                    {
+                        contextEntry.put( new DefaultEntryAttribute( newAttributeValueObject.getAttribute(),
+                            newAttributeValueObject.getValue() ) );
+                    }
+                    catch ( LdapException e1 )
+                    {
+                        // Will never occur
+                    }
                 }
 
                 contextEntryTableViewer.refresh();
@@ -203,7 +210,7 @@ public class PartitionDetailsPage implem
             {
                 AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();
 
-                Attribute attribute = contextEntry.get( attributeValueObject.getAttribute() );
+                EntryAttribute attribute = contextEntry.get( attributeValueObject.getAttribute() );
                 if ( attribute != null )
                 {
                     attribute.remove( attributeValueObject.getValue() );
@@ -405,24 +412,21 @@ public class PartitionDetailsPage implem
             public Object[] getElements( Object inputElement )
             {
                 List<AttributeValueObject> elements = new ArrayList<AttributeValueObject>();
+                Entry entry = ( Entry ) inputElement;
 
-                Attributes attributes = ( Attributes ) inputElement;
-
-                NamingEnumeration<? extends Attribute> ne = attributes.getAll();
-                while ( ne.hasMoreElements() )
+                Iterator<EntryAttribute> attributes = entry.iterator();
+                while ( attributes.hasNext() )
                 {
-                    Attribute attribute = ( Attribute ) ne.nextElement();
-                    try
-                    {
-                        NamingEnumeration<?> values = attribute.getAll();
-                        while ( values.hasMoreElements() )
-                        {
-                            elements.add( new AttributeValueObject( attribute.getID(), values.nextElement() ) );
-                        }
-                    }
-                    catch ( NamingException e )
+                    EntryAttribute attribute = attributes.next();
+
+                    Iterator<Value<?>> values = attribute.iterator();
+                    while ( values.hasNext() )
                     {
+                        Value<?> value = values.next();
+                        elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) );
+
                     }
+
                 }
 
                 return elements.toArray();
@@ -768,12 +772,12 @@ public class PartitionDetailsPage implem
             AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();
 
             String oldId = attributeValueObject.getAttribute();
-            Object oldValue = attributeValueObject.getValue();
+            String oldValue = attributeValueObject.getValue();
 
             AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
             if ( Dialog.OK == dialog.open() && dialog.isDirty() )
             {
-                Attribute attribute = contextEntry.get( oldId );
+                EntryAttribute attribute = contextEntry.get( oldId );
                 if ( attribute != null )
                 {
                     attribute.remove( oldValue );
@@ -787,10 +791,18 @@ public class PartitionDetailsPage implem
                 }
                 else
                 {
-                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
-                        newAttributeValueObject.getValue() ) );
+                    try
+                    {
+                        contextEntry.put( new DefaultEntryAttribute( newAttributeValueObject.getAttribute(),
+                            newAttributeValueObject.getValue() ) );
+                    }
+                    catch ( LdapException e )
+                    {
+                        // Will never occur
+                    }
                 }
 
+
                 contextEntryTableViewer.refresh();
                 resizeContextEntryTableColumnsToFit();
                 masterDetailsBlock.setEditorDirty();

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/AttributeValueObject.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/AttributeValueObject.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/AttributeValueObject.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/AttributeValueObject.java Thu Oct  7 09:07:44 2010
@@ -31,7 +31,7 @@ public class AttributeValueObject
     private String attribute;
 
     /** The value */
-    private Object value;
+    private String value;
 
 
     /**
@@ -42,7 +42,7 @@ public class AttributeValueObject
      * @param value
      *      the value
      */
-    public AttributeValueObject( String attribute, Object value )
+    public AttributeValueObject( String attribute, String value )
     {
         this.attribute = attribute;
         this.value = value;
@@ -79,7 +79,7 @@ public class AttributeValueObject
      * @return
      *      the value
      */
-    public Object getValue()
+    public String getValue()
     {
         return value;
     }
@@ -91,7 +91,7 @@ public class AttributeValueObject
      * @param value
      *      the new value
      */
-    public void setValue( Object value )
+    public void setValue( String value )
     {
         this.value = value;
     }

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/PartitionDetailsPage.java Thu Oct  7 09:07:44 2010
@@ -21,14 +21,14 @@ package org.apache.directory.studio.apac
 
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-
+import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 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;
@@ -92,7 +92,7 @@ public class PartitionDetailsPage implem
     private Partition input;
 
     /** The Context Entry */
-    private Attributes contextEntry;
+    private Entry contextEntry;
 
     /** The Indexed Attributes List */
     private List<IndexedAttribute> indexedAttributes;
@@ -165,15 +165,22 @@ public class PartitionDetailsPage implem
             if ( Dialog.OK == dialog.open() && dialog.isDirty() )
             {
                 AttributeValueObject newAttributeValueObject = dialog.getAttributeValueObject();
-                Attribute attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
+                EntryAttribute attribute = contextEntry.get( newAttributeValueObject.getAttribute() );
                 if ( attribute != null )
                 {
                     attribute.add( newAttributeValueObject.getValue() );
                 }
                 else
                 {
-                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
-                        newAttributeValueObject.getValue() ) );
+                    try
+                    {
+                        contextEntry.put( new DefaultEntryAttribute( newAttributeValueObject.getAttribute(),
+                            newAttributeValueObject.getValue() ) );
+                    }
+                    catch ( LdapException e1 )
+                    {
+                        // Will never occur
+                    }
                 }
 
                 contextEntryTableViewer.refresh();
@@ -203,7 +210,7 @@ public class PartitionDetailsPage implem
             {
                 AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();
 
-                Attribute attribute = contextEntry.get( attributeValueObject.getAttribute() );
+                EntryAttribute attribute = contextEntry.get( attributeValueObject.getAttribute() );
                 if ( attribute != null )
                 {
                     attribute.remove( attributeValueObject.getValue() );
@@ -405,23 +412,18 @@ public class PartitionDetailsPage implem
             public Object[] getElements( Object inputElement )
             {
                 List<AttributeValueObject> elements = new ArrayList<AttributeValueObject>();
+                Entry entry = ( Entry ) inputElement;
 
-                Attributes attributes = ( Attributes ) inputElement;
-
-                NamingEnumeration<? extends Attribute> ne = attributes.getAll();
-                while ( ne.hasMoreElements() )
+                Iterator<EntryAttribute> attributes = entry.iterator();
+                while ( attributes.hasNext() )
                 {
-                    Attribute attribute = ( Attribute ) ne.nextElement();
-                    try
-                    {
-                        NamingEnumeration<?> values = attribute.getAll();
-                        while ( values.hasMoreElements() )
-                        {
-                            elements.add( new AttributeValueObject( attribute.getID(), values.nextElement() ) );
-                        }
-                    }
-                    catch ( NamingException e )
+                    EntryAttribute attribute = attributes.next();
+
+                    Iterator<Value<?>> values = attribute.iterator();
+                    while ( values.hasNext() )
                     {
+                        Value<?> value = values.next();
+                        elements.add( new AttributeValueObject( attribute.getId(), value.getString() ) );
                     }
                 }
 
@@ -768,12 +770,12 @@ public class PartitionDetailsPage implem
             AttributeValueObject attributeValueObject = ( AttributeValueObject ) selection.getFirstElement();
 
             String oldId = attributeValueObject.getAttribute();
-            Object oldValue = attributeValueObject.getValue();
+            String oldValue = attributeValueObject.getValue();
 
             AttributeValueDialog dialog = new AttributeValueDialog( attributeValueObject );
             if ( Dialog.OK == dialog.open() && dialog.isDirty() )
             {
-                Attribute attribute = contextEntry.get( oldId );
+                EntryAttribute attribute = contextEntry.get( oldId );
                 if ( attribute != null )
                 {
                     attribute.remove( oldValue );
@@ -787,8 +789,15 @@ public class PartitionDetailsPage implem
                 }
                 else
                 {
-                    contextEntry.put( new BasicAttribute( newAttributeValueObject.getAttribute(),
-                        newAttributeValueObject.getValue() ) );
+                    try
+                    {
+                        contextEntry.put( new DefaultEntryAttribute( newAttributeValueObject.getAttribute(),
+                            newAttributeValueObject.getValue() ) );
+                    }
+                    catch ( LdapException e )
+                    {
+                        // Will never occur
+                    }
                 }
 
                 contextEntryTableViewer.refresh();

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/dialogs/AttributeValueObject.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/dialogs/AttributeValueObject.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/dialogs/AttributeValueObject.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v153/dialogs/AttributeValueObject.java Thu Oct  7 09:07:44 2010
@@ -31,7 +31,7 @@ public class AttributeValueObject
     private String attribute;
 
     /** The value */
-    private Object value;
+    private String value;
 
 
     /**
@@ -42,7 +42,7 @@ public class AttributeValueObject
      * @param value
      *      the value
      */
-    public AttributeValueObject( String attribute, Object value )
+    public AttributeValueObject( String attribute, String value )
     {
         this.attribute = attribute;
         this.value = value;
@@ -79,7 +79,7 @@ public class AttributeValueObject
      * @return
      *      the value
      */
-    public Object getValue()
+    public String getValue()
     {
         return value;
     }
@@ -91,7 +91,7 @@ public class AttributeValueObject
      * @param value
      *      the new value
      */
-    public void setValue( Object value )
+    public void setValue( String value )
     {
         this.value = value;
     }

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/AbstractServerXmlIO.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/AbstractServerXmlIO.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/AbstractServerXmlIO.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/AbstractServerXmlIO.java Thu Oct  7 09:07:44 2010
@@ -21,16 +21,14 @@ package org.apache.directory.studio.apac
 
 
 import java.io.BufferedReader;
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.Reader;
 import java.io.StringReader;
 import java.util.Iterator;
 
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
-
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.studio.apacheds.configuration.StudioEntityResolver;
@@ -191,13 +189,13 @@ public abstract class AbstractServerXmlI
      *            The ldif format text
      * @return An Attributes.
      */
-    public Attributes readContextEntry( String text )
+    public Entry readContextEntry( String text )
     {
         StringReader strIn = new StringReader( text );
         BufferedReader in = new BufferedReader( strIn );
 
         String line = null;
-        Attributes attributes = new BasicAttributes( true );
+        Entry entry = new DefaultEntry();
 
         try
         {
@@ -215,33 +213,26 @@ public abstract class AbstractServerXmlI
                     continue;
                 }
 
-                javax.naming.directory.Attribute attribute = LdifReader.parseAttributeValue( addedLine );
-                javax.naming.directory.Attribute oldAttribute = attributes.get( attribute.getID() );
+                EntryAttribute attribute = LdifReader.parseAttributeValue( addedLine );
+                EntryAttribute oldAttribute = entry.get( attribute.getId() );
 
                 if ( oldAttribute != null )
                 {
-                    try
-                    {
-                        oldAttribute.add( attribute.get() );
-                        attributes.put( oldAttribute );
-                    }
-                    catch ( NamingException ne )
-                    {
-                        // Do nothing
-                    }
+                    oldAttribute.add( attribute.get() );
+                    entry.put( oldAttribute );
                 }
                 else
                 {
-                    attributes.put( attribute );
+                    entry.put( attribute );
                 }
             }
         }
-        catch ( IOException ioe )
+        catch ( Exception e )
         {
             // Do nothing : we can't reach this point !
         }
 
-        return attributes;
+        return entry;
     }
 
 

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/Partition.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/Partition.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/Partition.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/Partition.java Thu Oct  7 09:07:44 2010
@@ -23,8 +23,8 @@ package org.apache.directory.studio.apac
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
 
 
 /**
@@ -50,7 +50,7 @@ public class Partition
     private boolean synchronizationOnWrite;
 
     /** The Context Entry */
-    private Attributes contextEntry;
+    private Entry contextEntry;
 
     /** The indexed attributes */
     private List<IndexedAttribute> indexedAttributes;
@@ -65,7 +65,7 @@ public class Partition
     public Partition()
     {
         indexedAttributes = new ArrayList<IndexedAttribute>();
-        contextEntry = new BasicAttributes( true );
+        contextEntry = new DefaultEntry();
     }
 
 
@@ -78,7 +78,7 @@ public class Partition
     public Partition( String id )
     {
         indexedAttributes = new ArrayList<IndexedAttribute>();
-        contextEntry = new BasicAttributes( true );
+        contextEntry = new DefaultEntry();
         this.id = id;
     }
 
@@ -137,7 +137,7 @@ public class Partition
      * @return
      *      the Content Entry
      */
-    public Attributes getContextEntry()
+    public Entry getContextEntry()
     {
         return contextEntry;
     }
@@ -149,7 +149,7 @@ public class Partition
      * @param contextEntry
      *      the new Context Entry
      */
-    public void setContextEntry( Attributes contextEntry )
+    public void setContextEntry( Entry contextEntry )
     {
         this.contextEntry = contextEntry;
     }

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/ServerXmlIOV150.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/ServerXmlIOV150.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/ServerXmlIOV150.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v150/ServerXmlIOV150.java Thu Oct  7 09:07:44 2010
@@ -28,12 +28,10 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
-
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.studio.apacheds.configuration.StudioEntityResolver;
 import org.apache.directory.studio.apacheds.configuration.model.AbstractServerXmlIO;
 import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
@@ -513,7 +511,7 @@ public class ServerXmlIOV150 extends Abs
      * @return
      *      the Context Entry
      */
-    private Attributes readPartitionContextEntry( Element partitionBean )
+    private Entry readPartitionContextEntry( Element partitionBean )
     {
         Element propertyElement = getBeanPropertyElement( "contextEntry", partitionBean ); //$NON-NLS-1$
         if ( propertyElement != null )
@@ -525,7 +523,7 @@ public class ServerXmlIOV150 extends Abs
             }
         }
 
-        return new BasicAttributes( true );
+        return new DefaultEntry();
     }
 
 
@@ -999,22 +997,17 @@ public class ServerXmlIOV150 extends Abs
         {
             Element valueElement = propertyElement.addElement( "value" ); //$NON-NLS-1$
 
-            Attributes contextEntry = partition.getContextEntry();
+            Entry contextEntry = partition.getContextEntry();
             StringBuffer sb = new StringBuffer();
-            NamingEnumeration<? extends Attribute> ne = contextEntry.getAll();
-            while ( ne.hasMoreElements() )
+            Iterator<EntryAttribute> attributes = contextEntry.iterator();
+            while ( attributes.hasNext() )
             {
-                Attribute attribute = ( Attribute ) ne.nextElement();
-                try
-                {
-                    NamingEnumeration<?> values = attribute.getAll();
-                    while ( values.hasMoreElements() )
-                    {
-                        sb.append( attribute.getID() + ": " + values.nextElement() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
-                    }
-                }
-                catch ( NamingException e )
+                EntryAttribute attribute = attributes.next();
+                Iterator<Value<?>> values = attribute.iterator();
+                while ( values.hasNext() )
                 {
+                    Value<?> value = values.next();
+                    sb.append( attribute.getId() + ": " + value.getString() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
                 }
             }
 

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/Partition.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/Partition.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/Partition.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/Partition.java Thu Oct  7 09:07:44 2010
@@ -23,8 +23,8 @@ package org.apache.directory.studio.apac
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
 
 
 /**
@@ -50,7 +50,7 @@ public class Partition
     private boolean synchronizationOnWrite;
 
     /** The Context Entry */
-    private Attributes contextEntry;
+    private Entry contextEntry;
 
     /** The indexed attributes */
     private List<IndexedAttribute> indexedAttributes;
@@ -65,7 +65,7 @@ public class Partition
     public Partition()
     {
         indexedAttributes = new ArrayList<IndexedAttribute>();
-        contextEntry = new BasicAttributes( true );
+        contextEntry = new DefaultEntry();
     }
 
 
@@ -78,7 +78,7 @@ public class Partition
     public Partition( String id )
     {
         indexedAttributes = new ArrayList<IndexedAttribute>();
-        contextEntry = new BasicAttributes( true );
+        contextEntry = new DefaultEntry();
         this.id = id;
     }
 
@@ -137,7 +137,7 @@ public class Partition
      * @return
      *      the Content Entry
      */
-    public Attributes getContextEntry()
+    public Entry getContextEntry()
     {
         return contextEntry;
     }
@@ -149,7 +149,7 @@ public class Partition
      * @param contextEntry
      *      the new Context Entry
      */
-    public void setContextEntry( Attributes contextEntry )
+    public void setContextEntry( Entry contextEntry )
     {
         this.contextEntry = contextEntry;
     }

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v151/ServerXmlIOV151.java Thu Oct  7 09:07:44 2010
@@ -28,12 +28,10 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
-
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.studio.apacheds.configuration.StudioEntityResolver;
 import org.apache.directory.studio.apacheds.configuration.model.AbstractServerXmlIO;
 import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
@@ -764,7 +762,7 @@ public class ServerXmlIOV151 extends Abs
      * @return
      *      the Context Entry
      */
-    private Attributes readPartitionContextEntry( Element partitionBean )
+    private Entry readPartitionContextEntry( Element partitionBean )
     {
         Element propertyElement = getBeanPropertyElement( "contextEntry", partitionBean ); //$NON-NLS-1$
         if ( propertyElement != null )
@@ -776,7 +774,7 @@ public class ServerXmlIOV151 extends Abs
             }
         }
 
-        return new BasicAttributes( true );
+        return new DefaultEntry();
     }
 
 
@@ -1471,22 +1469,17 @@ public class ServerXmlIOV151 extends Abs
         {
             Element valueElement = propertyElement.addElement( "value" ); //$NON-NLS-1$
 
-            Attributes contextEntry = partition.getContextEntry();
+            Entry contextEntry = partition.getContextEntry();
             StringBuffer sb = new StringBuffer();
-            NamingEnumeration<? extends Attribute> ne = contextEntry.getAll();
-            while ( ne.hasMoreElements() )
+            Iterator<EntryAttribute> attributes = contextEntry.iterator();
+            while ( attributes.hasNext() )
             {
-                Attribute attribute = ( Attribute ) ne.nextElement();
-                try
-                {
-                    NamingEnumeration<?> values = attribute.getAll();
-                    while ( values.hasMoreElements() )
-                    {
-                        sb.append( attribute.getID() + ": " + values.nextElement() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
-                    }
-                }
-                catch ( NamingException e )
+                EntryAttribute attribute = attributes.next();
+                Iterator<Value<?>> values = attribute.iterator();
+                while ( values.hasNext() )
                 {
+                    Value<?> value = values.next();
+                    sb.append( attribute.getId() + ": " + value.getString() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
                 }
             }
 

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/Partition.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/Partition.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/Partition.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/Partition.java Thu Oct  7 09:07:44 2010
@@ -23,8 +23,8 @@ package org.apache.directory.studio.apac
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
 
 
 /**
@@ -50,7 +50,7 @@ public class Partition
     private boolean synchronizationOnWrite;
 
     /** The Context Entry */
-    private Attributes contextEntry;
+    private Entry contextEntry;
 
     /** The indexed attributes */
     private List<IndexedAttribute> indexedAttributes;
@@ -65,7 +65,7 @@ public class Partition
     public Partition()
     {
         indexedAttributes = new ArrayList<IndexedAttribute>();
-        contextEntry = new BasicAttributes( true );
+        contextEntry = new DefaultEntry();
     }
 
 
@@ -78,7 +78,7 @@ public class Partition
     public Partition( String id )
     {
         indexedAttributes = new ArrayList<IndexedAttribute>();
-        contextEntry = new BasicAttributes( true );
+        contextEntry = new DefaultEntry();
         this.id = id;
     }
 
@@ -137,7 +137,7 @@ public class Partition
      * @return
      *      the Content Entry
      */
-    public Attributes getContextEntry()
+    public Entry getContextEntry()
     {
         return contextEntry;
     }
@@ -149,7 +149,7 @@ public class Partition
      * @param contextEntry
      *      the new Context Entry
      */
-    public void setContextEntry( Attributes contextEntry )
+    public void setContextEntry( Entry contextEntry )
     {
         this.contextEntry = contextEntry;
     }

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java Thu Oct  7 09:07:44 2010
@@ -28,11 +28,9 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.studio.apacheds.configuration.StudioEntityResolver;
 import org.apache.directory.studio.apacheds.configuration.model.AbstractServerXmlIO;
 import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
@@ -544,7 +542,7 @@ public class ServerXmlIOV152 extends Abs
      *      the corresponding attributes
      * @throws ServerXmlIOException 
      */
-    private Attributes readContextEntry( Element element ) throws ServerXmlIOException
+    private Entry readContextEntry( Element element ) throws ServerXmlIOException
     {
         Element contextEntryElement = element.element( ServerXmlIOV152.ELEMENT_CONTEXT_ENTRY );
         if ( contextEntryElement == null )
@@ -1617,7 +1615,7 @@ public class ServerXmlIOV152 extends Abs
      * @param dn 
      *      the dn
      */
-    private void createContextEntry( Element element, Attributes contextEntry, String id, String dn )
+    private void createContextEntry( Element element, Entry contextEntry, String id, String dn )
     {
         // Adding the 'contextEntry' element
         element.addElement( ServerXmlIOV152.ELEMENT_CONTEXT_ENTRY ).setText( "#" + id + "ContextEntry" ); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1664,21 +1662,15 @@ public class ServerXmlIOV152 extends Abs
         // Creating a string buffer to contain the LDIF data
         StringBuffer sb = new StringBuffer();
 
-        // Looping on attributes
-        NamingEnumeration<? extends Attribute> ne = contextEntry.getAll();
-        while ( ne.hasMoreElements() )
+        Iterator<EntryAttribute> attributes = contextEntry.iterator();
+        while ( attributes.hasNext() )
         {
-            Attribute attribute = ( Attribute ) ne.nextElement();
-            try
-            {
-                NamingEnumeration<?> values = attribute.getAll();
-                while ( values.hasMoreElements() )
-                {
-                    sb.append( attribute.getID() + ": " + values.nextElement() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
-                }
-            }
-            catch ( NamingException e )
+            EntryAttribute attribute = attributes.next();
+            Iterator<Value<?>> values = attribute.iterator();
+            while ( values.hasNext() )
             {
+                Value<?> value = values.next();
+                sb.append( attribute.getId() + ": " + value.getString() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
 

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/Partition.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/Partition.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/Partition.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/Partition.java Thu Oct  7 09:07:44 2010
@@ -23,8 +23,8 @@ package org.apache.directory.studio.apac
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttributes;
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.entry.Entry;
 
 
 /**
@@ -50,7 +50,7 @@ public class Partition
     private boolean synchronizationOnWrite;
 
     /** The Context Entry */
-    private Attributes contextEntry;
+    private Entry contextEntry;
 
     /** The indexed attributes */
     private List<IndexedAttribute> indexedAttributes;
@@ -65,7 +65,7 @@ public class Partition
     public Partition()
     {
         indexedAttributes = new ArrayList<IndexedAttribute>();
-        contextEntry = new BasicAttributes( true );
+        contextEntry = new DefaultEntry();
     }
 
 
@@ -78,7 +78,7 @@ public class Partition
     public Partition( String id )
     {
         indexedAttributes = new ArrayList<IndexedAttribute>();
-        contextEntry = new BasicAttributes( true );
+        contextEntry = new DefaultEntry();
         this.id = id;
     }
 
@@ -137,7 +137,7 @@ public class Partition
      * @return
      *      the Content Entry
      */
-    public Attributes getContextEntry()
+    public Entry getContextEntry()
     {
         return contextEntry;
     }
@@ -149,7 +149,7 @@ public class Partition
      * @param contextEntry
      *      the new Context Entry
      */
-    public void setContextEntry( Attributes contextEntry )
+    public void setContextEntry( Entry contextEntry )
     {
         this.contextEntry = contextEntry;
     }

Modified: directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/ServerXmlIOV153.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/ServerXmlIOV153.java?rev=1005372&r1=1005371&r2=1005372&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/ServerXmlIOV153.java (original)
+++ directory/studio/branches/shared-trunk-merge/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v153/ServerXmlIOV153.java Thu Oct  7 09:07:44 2010
@@ -28,11 +28,9 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.studio.apacheds.configuration.StudioEntityResolver;
 import org.apache.directory.studio.apacheds.configuration.model.AbstractServerXmlIO;
 import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
@@ -558,7 +556,7 @@ public class ServerXmlIOV153 extends Abs
      *      the corresponding attributes
      * @throws ServerXmlIOException 
      */
-    private Attributes readContextEntry( Element element ) throws ServerXmlIOException
+    private Entry readContextEntry( Element element ) throws ServerXmlIOException
     {
         Element contextEntryElement = element.element( ServerXmlIOV153.ELEMENT_CONTEXT_ENTRY );
         if ( contextEntryElement == null )
@@ -1674,7 +1672,7 @@ public class ServerXmlIOV153 extends Abs
      * @param dn 
      *      the dn
      */
-    private void createContextEntry( Element element, Attributes contextEntry, String id, String dn )
+    private void createContextEntry( Element element, Entry contextEntry, String id, String dn )
     {
         // Adding the 'contextEntry' element
         element.addElement( ServerXmlIOV153.ELEMENT_CONTEXT_ENTRY ).setText( "#" + id + "ContextEntry" ); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1720,22 +1718,16 @@ public class ServerXmlIOV153 extends Abs
 
         // Creating a string buffer to contain the LDIF data
         StringBuffer sb = new StringBuffer();
-
-        // Looping on attributes
-        NamingEnumeration<? extends Attribute> ne = contextEntry.getAll();
-        while ( ne.hasMoreElements() )
-        {
-            Attribute attribute = ( Attribute ) ne.nextElement();
-            try
-            {
-                NamingEnumeration<?> values = attribute.getAll();
-                while ( values.hasMoreElements() )
-                {
-                    sb.append( attribute.getID() + ": " + values.nextElement() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
-                }
-            }
-            catch ( NamingException e )
+        
+        Iterator<EntryAttribute> attributes = contextEntry.iterator();
+        while ( attributes.hasNext() )
+        {
+            EntryAttribute attribute = attributes.next();
+            Iterator<Value<?>> values = attribute.iterator();
+            while ( values.hasNext() )
             {
+                Value<?> value = values.next();
+                sb.append( attribute.getId() + ": " + value.getString() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
 



Mime
View raw message