directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1005116 [4/4] - in /directory/studio/branches/shared-trunk-merge/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core: ./ events/ jobs/ model/ model/impl/ model/schema/ utils/
Date Wed, 06 Oct 2010 16:40:46 GMT
Modified: directory/studio/branches/shared-trunk-merge/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java?rev=1005116&r1=1005115&r2=1005116&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java
(original)
+++ directory/studio/branches/shared-trunk-merge/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java
Wed Oct  6 16:40:44 2010
@@ -27,12 +27,12 @@ package org.apache.directory.studio.ldap
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.naming.InvalidNameException;
 import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
 
-import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -68,10 +68,10 @@ public class ModelConverter
      *
      * @return the resulting dummy entry
      *
-     * @throws InvalidNameException
+     * @throws LdapInvalidDnException
      */
     public static DummyEntry ldifContentRecordToEntry( LdifContentRecord ldifContentRecord,
-        IBrowserConnection connection ) throws InvalidNameException
+        IBrowserConnection connection ) throws LdapInvalidDnException
     {
         return createIntern( ldifContentRecord, connection );
     }
@@ -85,10 +85,10 @@ public class ModelConverter
      *
      * @return the resulting dummy entry
      *
-     * @throws InvalidNameException
+     * @throws LdapInvalidDnException
      */
     public static DummyEntry ldifChangeAddRecordToEntry( LdifChangeAddRecord ldifChangeAddRecord,
-        IBrowserConnection connection ) throws InvalidNameException
+        IBrowserConnection connection ) throws LdapInvalidDnException
     {
         return createIntern( ldifChangeAddRecord, connection );
     }
@@ -102,16 +102,16 @@ public class ModelConverter
      *
      * @return the dummy entry
      *
-     * @throws InvalidNameException
+     * @throws LdapInvalidDnException
      */
     private static DummyEntry createIntern( LdifRecord ldifRecord, IBrowserConnection connection
)
-        throws InvalidNameException
+        throws LdapInvalidDnException
     {
         LdifPart[] parts = ldifRecord.getParts();
 
         EventRegistry.suspendEventFiringInCurrentThread();
 
-        DummyEntry entry = new DummyEntry( new LdapDN( ldifRecord.getDnLine().getValueAsString()
), connection );
+        DummyEntry entry = new DummyEntry( new DN( ldifRecord.getDnLine().getValueAsString()
), connection );
 
         for ( int i = 0; i < parts.length; i++ )
         {
@@ -159,7 +159,7 @@ public class ModelConverter
             }
         }
 
-        LdifChangeAddRecord record = new LdifChangeAddRecord( LdifDnLine.create( entry.getDn().getUpName()
) );
+        LdifChangeAddRecord record = new LdifChangeAddRecord( LdifDnLine.create( entry.getDn().getName()
) );
         if ( mustCreateChangeTypeLine )
         {
             addControls( record, entry );
@@ -209,7 +209,7 @@ public class ModelConverter
 
     public static LdifContentRecord entryToLdifContentRecord( IEntry entry )
     {
-        LdifContentRecord record = LdifContentRecord.create( entry.getDn().getUpName() );
+        LdifContentRecord record = LdifContentRecord.create( entry.getDn().getName() );
 
         if ( entry.getAttributes() != null )
         {
@@ -278,9 +278,9 @@ public class ModelConverter
     }
 
 
-    public static LdifDnLine dnToLdifDnLine( LdapDN dn )
+    public static LdifDnLine dnToLdifDnLine( DN dn )
     {
-        LdifDnLine line = LdifDnLine.create( dn.getUpName() );
+        LdifDnLine line = LdifDnLine.create( dn.getName() );
         return line;
     }
 

Modified: directory/studio/branches/shared-trunk-merge/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/shared-trunk-merge/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java?rev=1005116&r1=1005115&r2=1005116&view=diff
==============================================================================
--- directory/studio/branches/shared-trunk-merge/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
(original)
+++ directory/studio/branches/shared-trunk-merge/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
Wed Oct  6 16:40:44 2010
@@ -35,22 +35,22 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
-import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.Rdn;
-import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription;
+import org.apache.directory.shared.ldap.name.AVA;
+import org.apache.directory.shared.ldap.name.DN;
+import org.apache.directory.shared.ldap.name.RDN;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.util.LdapURL;
-import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
+import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ModifyMode;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ModifyOrder;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ModifyMode;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ModifyOrder;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.apache.directory.studio.ldifparser.LdifFormatParameters;
@@ -86,14 +86,14 @@ public class Utils
      * 
      * @return the oid string
      */
-    public static String getNormalizedOidString( LdapDN dn, Schema schema )
+    public static String getNormalizedOidString( DN dn, Schema schema )
     {
         StringBuffer sb = new StringBuffer();
 
-        Iterator<Rdn> it = dn.getRdns().iterator();
+        Iterator<RDN> it = dn.getRdns().iterator();
         while ( it.hasNext() )
         {
-            Rdn rdn = it.next();
+            RDN rdn = it.next();
             sb.append( getOidString( rdn, schema ) );
             if ( it.hasNext() )
             {
@@ -105,15 +105,15 @@ public class Utils
     }
 
 
-    private static String getOidString( Rdn rdn, Schema schema )
+    private static String getOidString( RDN rdn, Schema schema )
     {
         StringBuffer sb = new StringBuffer();
 
-        Iterator<AttributeTypeAndValue> it = rdn.iterator();
+        Iterator<AVA> it = rdn.iterator();
         while ( it.hasNext() )
         {
-            AttributeTypeAndValue atav = it.next();
-            sb.append( getOidString( atav, schema ) );
+            AVA ava = it.next();
+            sb.append( getOidString( ava, schema ) );
             if ( it.hasNext() )
             {
                 sb.append( '+' );
@@ -124,11 +124,11 @@ public class Utils
     }
 
 
-    private static String getOidString( AttributeTypeAndValue atav, Schema schema )
+    private static String getOidString( AVA ava, Schema schema )
     {
-        String oid = schema != null ? schema.getAttributeTypeDescription( atav.getNormType()
).getNumericOid() : atav
+        String oid = schema != null ? schema.getAttributeTypeDescription( ava.getNormType()
).getOid() : ava
             .getNormType();
-        return oid.trim().toLowerCase() + "=" + atav.getUpValue().getString().trim().toLowerCase();
//$NON-NLS-1$
+        return oid.trim().toLowerCase() + "=" + ava.getUpValue().getString().trim().toLowerCase();
//$NON-NLS-1$
     }
 
 
@@ -385,7 +385,7 @@ public class Utils
         }
 
         // prepare the LDIF record containing the modifications
-        LdifChangeModifyRecord record = new LdifChangeModifyRecord( LdifDnLine.create( newEntry.getDn().getUpName()
) );
+        LdifChangeModifyRecord record = new LdifChangeModifyRecord( LdifDnLine.create( newEntry.getDn().getName()
) );
         if ( newEntry.isReferral() )
         {
             record.addControl( LdifControlLine.create( StudioControl.MANAGEDSAIT_CONTROL.getOid(),
@@ -398,7 +398,7 @@ public class Utils
         {
             // get attribute type schema information
             Schema schema = oldEntry.getBrowserConnection().getSchema();
-            AttributeTypeDescription atd = schema.getAttributeTypeDescription( attributeDescription
);
+            AttributeType atd = schema.getAttributeTypeDescription( attributeDescription
);
             boolean hasEMR = SchemaUtils.getEqualityMatchingRuleNameOrNumericOidTransitive(
atd, schema ) != null;
             boolean isReplaceForced = ( hasEMR && modifyMode == ModifyMode.REPLACE
)
                 || ( !hasEMR && modifyModeNoEMR == ModifyMode.REPLACE );



Mime
View raw message