directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r689560 - in /directory/studio/trunk: connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/
Date Wed, 27 Aug 2008 18:56:07 GMT
Author: seelmann
Date: Wed Aug 27 11:56:06 2008
New Revision: 689560

URL: http://svn.apache.org/viewvc?rev=689560&view=rev
Log:
Adapted changes in LdapURL class

Modified:
    directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/AuthenticationParameterPage.java
    directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java

Modified: directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/AuthenticationParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/AuthenticationParameterPage.java?rev=689560&r1=689559&r2=689560&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/AuthenticationParameterPage.java
(original)
+++ directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/AuthenticationParameterPage.java
Wed Aug 27 11:56:06 2008
@@ -23,6 +23,7 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.util.LdapURL.Extension;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionParameter;
 import org.apache.directory.studio.connection.core.ConnectionParameter.AuthenticationMethod;
@@ -55,19 +56,19 @@
  */
 public class AuthenticationParameterPage extends AbstractConnectionParameterPage
 {
-    
+
     private static final String X_AUTH_METHOD = "X-AUTH-METHOD";
-    
+
     private static final String X_AUTH_METHOD_ANONYMOUS = "Anonymous";
 
     private static final String X_AUTH_METHOD_SIMPLE = "Simple";
-    
+
     private static final String X_AUTH_METHOD_DIGEST_MD5 = "DIGEST-MD5";
-    
+
     private static final String X_AUTH_METHOD_CRAM_MD5 = "CRAM-MD5";
-    
+
     private static final String X_BIND_USER = "X-BIND-USER";
-    
+
     private static final String X_BIND_PASSWORD = "X-BIND-PASSWORD";
 
     private static final String X_SASL_REALM = "X-SASL-REALM";
@@ -426,40 +427,40 @@
         switch ( parameter.getAuthMethod() )
         {
             case SASL_CRAM_MD5:
-                ldapUrl.getExtensions().put( X_AUTH_METHOD, X_AUTH_METHOD_CRAM_MD5 );
+                ldapUrl.getExtensions().add( new Extension( false, X_AUTH_METHOD, X_AUTH_METHOD_CRAM_MD5
) );
                 break;
             case SASL_DIGEST_MD5:
-                ldapUrl.getExtensions().put( X_AUTH_METHOD, X_AUTH_METHOD_DIGEST_MD5 );
+                ldapUrl.getExtensions().add( new Extension( false, X_AUTH_METHOD, X_AUTH_METHOD_DIGEST_MD5
) );
                 break;
             case SIMPLE:
                 if ( StringUtils.isEmpty( parameter.getBindPrincipal() ) )
                 {
                     // default if bind user is present
-                    ldapUrl.getExtensions().put( X_AUTH_METHOD, X_AUTH_METHOD_SIMPLE );
+                    ldapUrl.getExtensions().add( new Extension( false, X_AUTH_METHOD, X_AUTH_METHOD_SIMPLE
) );
                 }
                 break;
             case NONE:
                 if ( StringUtils.isNotEmpty( parameter.getBindPrincipal() ) )
                 {
                     // default if bind user is absent
-                    ldapUrl.getExtensions().put( X_AUTH_METHOD, X_AUTH_METHOD_ANONYMOUS );
+                    ldapUrl.getExtensions().add( new Extension( false, X_AUTH_METHOD, X_AUTH_METHOD_ANONYMOUS
) );
                 }
                 break;
         }
 
         if ( StringUtils.isNotEmpty( parameter.getBindPrincipal() ) )
         {
-            ldapUrl.getExtensions().put( X_BIND_USER, parameter.getBindPrincipal() );
+            ldapUrl.getExtensions().add( new Extension( false, X_BIND_USER, parameter.getBindPrincipal()
) );
         }
 
         if ( StringUtils.isNotEmpty( parameter.getBindPassword() ) )
         {
-            ldapUrl.getExtensions().put( X_BIND_PASSWORD, parameter.getBindPassword() );
+            ldapUrl.getExtensions().add( new Extension( false, X_BIND_PASSWORD, parameter.getBindPassword()
) );
         }
 
         if ( StringUtils.isNotEmpty( parameter.getSaslRealm() ) )
         {
-            ldapUrl.getExtensions().put( X_SASL_REALM, parameter.getSaslRealm() );
+            ldapUrl.getExtensions().add( new Extension( false, X_SASL_REALM, parameter.getSaslRealm()
) );
         }
     }
 
@@ -470,18 +471,18 @@
     public void mergeLdapUrlToParameters( LdapURL ldapUrl, ConnectionParameter parameter
)
     {
         // bind user and password, none if empty or absent
-        String principal = ldapUrl.getExtensions().get( X_BIND_USER );
+        String principal = ldapUrl.getExtensionValue( X_BIND_USER );
         if ( principal == null )
         {
             principal = StringUtils.EMPTY;
         }
         parameter.setBindPrincipal( principal );
 
-        String password = ldapUrl.getExtensions().get( X_BIND_PASSWORD );
+        String password = ldapUrl.getExtensionValue( X_BIND_PASSWORD );
         parameter.setBindPassword( password );
 
         // auth method, simple if unknown or absent and X-BIND-USER is present, else anonymous

-        String authMethod = ldapUrl.getExtensions().get( X_AUTH_METHOD );
+        String authMethod = ldapUrl.getExtensionValue( X_AUTH_METHOD );
         if ( StringUtils.isNotEmpty( authMethod ) && X_AUTH_METHOD_ANONYMOUS.equalsIgnoreCase(
authMethod ) )
         {
             parameter.setAuthMethod( ConnectionParameter.AuthenticationMethod.NONE );
@@ -508,7 +509,7 @@
         }
 
         // SASL realm, none if empty or absent 
-        String saslRealm = ldapUrl.getExtensions().get( X_SASL_REALM );
+        String saslRealm = ldapUrl.getExtensionValue( X_SASL_REALM );
         if ( StringUtils.isNotEmpty( saslRealm ) )
         {
             parameter.setSaslRealm( saslRealm );

Modified: directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java?rev=689560&r1=689559&r2=689560&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java
(original)
+++ directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/NetworkParameterPage.java
Wed Aug 27 11:56:06 2008
@@ -26,6 +26,7 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.util.LdapURL.Extension;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.ConnectionParameter;
@@ -381,7 +382,7 @@
      */
     public void mergeParametersToLdapURL( ConnectionParameter parameter, LdapURL ldapUrl
)
     {
-        ldapUrl.getExtensions().put( X_CONNECTION_NAME, parameter.getName() );
+        ldapUrl.getExtensions().add( new Extension( false, X_CONNECTION_NAME, parameter.getName()
) );
 
         ldapUrl.setHost( parameter.getHost() );
 
@@ -393,10 +394,10 @@
                 // default
                 break;
             case LDAPS:
-                ldapUrl.getExtensions().put( X_ENCRYPTION, X_ENCRYPTION_LDAPS );
+                ldapUrl.getExtensions().add( new Extension( false, X_ENCRYPTION, X_ENCRYPTION_LDAPS
) );
                 break;
             case START_TLS:
-                ldapUrl.getExtensions().put( X_ENCRYPTION, X_ENCRYPTION_START_TLS );
+                ldapUrl.getExtensions().add( new Extension( false, X_ENCRYPTION, X_ENCRYPTION_START_TLS
) );
                 break;
         }
     }
@@ -408,7 +409,7 @@
     public void mergeLdapUrlToParameters( LdapURL ldapUrl, ConnectionParameter parameter
)
     {
         // connection name, current date if absent
-        String name = ldapUrl.getExtensions().get( X_CONNECTION_NAME );
+        String name = ldapUrl.getExtensionValue( X_CONNECTION_NAME );
         if ( StringUtils.isEmpty( name ) )
         {
             name = new SimpleDateFormat( "yyyy-MM-dd HH-mm-ss" ).format( new Date() ); //$NON-NLS-1$
@@ -422,7 +423,7 @@
         parameter.setPort( ldapUrl.getPort() );
 
         // encryption method, none if unknown or absent 
-        String encryption = ldapUrl.getExtensions().get( X_ENCRYPTION );
+        String encryption = ldapUrl.getExtensionValue( X_ENCRYPTION );
         if ( StringUtils.isNotEmpty( encryption ) && X_ENCRYPTION_LDAPS.equalsIgnoreCase(
encryption ) )
         {
             parameter.setEncryptionMethod( ConnectionParameter.EncryptionMethod.LDAPS );

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java?rev=689560&r1=689559&r2=689560&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java
Wed Aug 27 11:56:06 2008
@@ -26,6 +26,7 @@
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.util.LdapURL.Extension;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionParameter;
 import org.apache.directory.studio.connection.ui.AbstractConnectionParameterPage;
@@ -444,21 +445,23 @@
         String baseDn = parameter.getExtendedProperty( IBrowserConnection.CONNECTION_PARAMETER_BASE_DN
);
         if ( !fetchBaseDns && StringUtils.isNotEmpty( baseDn ) )
         {
-            ldapUrl.getExtensions().put( X_BASE_DN, baseDn );
+            ldapUrl.getExtensions().add( new Extension( false, X_BASE_DN, baseDn ) );
         }
 
         int countLimit = parameter.getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_COUNT_LIMIT
);
         if ( countLimit != 0 )
         {
-            ldapUrl.getExtensions().put( X_COUNT_LIMIT,
-                parameter.getExtendedProperty( IBrowserConnection.CONNECTION_PARAMETER_COUNT_LIMIT
) );
+            ldapUrl.getExtensions().add(
+                new Extension( false, X_COUNT_LIMIT, parameter
+                    .getExtendedProperty( IBrowserConnection.CONNECTION_PARAMETER_COUNT_LIMIT
) ) );
         }
 
         int timeLimit = parameter.getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT
);
         if ( timeLimit != 0 )
         {
-            ldapUrl.getExtensions().put( X_TIME_LIMIT,
-                parameter.getExtendedProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT
) );
+            ldapUrl.getExtensions().add(
+                new Extension( false, X_TIME_LIMIT, parameter
+                    .getExtendedProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT
) ) );
         }
 
         int aliasesDereferencingMethodOrdinal = parameter
@@ -471,13 +474,13 @@
                 // default
                 break;
             case FINDING:
-                ldapUrl.getExtensions().put( X_ALIAS_HANDLING, X_ALIAS_HANDLING_FINDING );
+                ldapUrl.getExtensions().add( new Extension( false, X_ALIAS_HANDLING, X_ALIAS_HANDLING_FINDING
) );
                 break;
             case SEARCH:
-                ldapUrl.getExtensions().put( X_ALIAS_HANDLING, X_ALIAS_HANDLING_SEARCHING
);
+                ldapUrl.getExtensions().add( new Extension( false, X_ALIAS_HANDLING, X_ALIAS_HANDLING_SEARCHING
) );
                 break;
             case NEVER:
-                ldapUrl.getExtensions().put( X_ALIAS_HANDLING, X_ALIAS_HANDLING_NEVER );
+                ldapUrl.getExtensions().add( new Extension( false, X_ALIAS_HANDLING, X_ALIAS_HANDLING_NEVER
) );
                 break;
         }
 
@@ -491,10 +494,10 @@
                 // default
                 break;
             case IGNORE:
-                ldapUrl.getExtensions().put( X_REFERRAL_HANDLING, X_REFERRAL_HANDLING_IGNORE
);
+                ldapUrl.getExtensions().add( new Extension( false, X_REFERRAL_HANDLING, X_REFERRAL_HANDLING_IGNORE
) );
                 break;
             case MANAGE:
-                ldapUrl.getExtensions().put( X_REFERRAL_HANDLING, X_REFERRAL_HANDLING_MANAGE
);
+                ldapUrl.getExtensions().add( new Extension( false, X_REFERRAL_HANDLING, X_REFERRAL_HANDLING_MANAGE
) );
                 break;
         }
 
@@ -507,7 +510,7 @@
     public void mergeLdapUrlToParameters( LdapURL ldapUrl, ConnectionParameter parameter
)
     {
         // base DN, get from Root DSE if absent, may be empty 
-        String baseDn = ldapUrl.getExtensions().get( X_BASE_DN );
+        String baseDn = ldapUrl.getExtensionValue( X_BASE_DN );
         if ( baseDn == null )
         {
             parameter.setExtendedBoolProperty( IBrowserConnection.CONNECTION_PARAMETER_FETCH_BASE_DNS,
true );
@@ -520,7 +523,7 @@
         }
 
         // count limit, 1000 if non-numeric or absent 
-        String countLimit = ldapUrl.getExtensions().get( X_COUNT_LIMIT );
+        String countLimit = ldapUrl.getExtensionValue( X_COUNT_LIMIT );
         try
         {
             parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_COUNT_LIMIT,
new Integer(
@@ -532,7 +535,7 @@
         }
 
         // time limit, 0 if non-numeric or absent 
-        String timeLimit = ldapUrl.getExtensions().get( X_TIME_LIMIT );
+        String timeLimit = ldapUrl.getExtensionValue( X_TIME_LIMIT );
         try
         {
             parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT,
new Integer(
@@ -544,7 +547,7 @@
         }
 
         // alias handling, ALWAYS if unknown or absent
-        String alias = ldapUrl.getExtensions().get( X_ALIAS_HANDLING );
+        String alias = ldapUrl.getExtensionValue( X_ALIAS_HANDLING );
         if ( StringUtils.isNotEmpty( alias ) && X_ALIAS_HANDLING_FINDING.equalsIgnoreCase(
alias ) )
         {
             parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD,
@@ -567,7 +570,7 @@
         }
 
         // referral handling, FOLLOW if unknown or absent
-        String referral = ldapUrl.getExtensions().get( X_REFERRAL_HANDLING );
+        String referral = ldapUrl.getExtensionValue( X_REFERRAL_HANDLING );
         if ( StringUtils.isNotEmpty( referral ) && X_REFERRAL_HANDLING_IGNORE.equalsIgnoreCase(
referral ) )
         {
             parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD,



Mime
View raw message