directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r587265 [1/2] - in /directory/studio/trunk: studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/ studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/ stud...
Date Mon, 22 Oct 2007 21:20:02 GMT
Author: seelmann
Date: Mon Oct 22 14:20:01 2007
New Revision: 587265

URL: http://svn.apache.org/viewvc?rev=587265&view=rev
Log:
Replaced some int constants by Enums.

Modified:
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/ScopeDialog.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/AliasesDereferencingWidget.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReferralsHandlingWidget.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ScopeWidget.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyConnection.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Search.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/URL.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/BatchOperationApplyOnWizardPage.java

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/BrowserSelectionUtils.java Mon Oct 22 14:20:01 2007
@@ -42,6 +42,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
 import org.apache.directory.studio.ldapbrowser.core.utils.LdapFilterUtils;
 import org.eclipse.jface.viewers.ISelection;
@@ -81,7 +82,7 @@
         ISearch exampleSearch = new Search();
         String oldName = exampleSearch.getSearchParameter().getName();
         exampleSearch.getSearchParameter().setName( null );
-        exampleSearch.setScope( ISearch.SCOPE_SUBTREE );
+        exampleSearch.setScope( SearchScope.SUBTREE );
 
         if ( selection != null && !selection.isEmpty() && selection instanceof StructuredSelection )
         {

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/PasteAction.java Mon Oct 22 14:20:01 2007
@@ -27,9 +27,8 @@
 import org.apache.directory.studio.ldapbrowser.core.jobs.CopyEntriesJob;
 import org.apache.directory.studio.ldapbrowser.core.jobs.CreateValuesJob;
 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.ISearch.SearchScope;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.dnd.Clipboard;
 import org.eclipse.swt.dnd.Transfer;
@@ -152,7 +151,7 @@
      */
     private void pasteEntries( final IEntry parent, final IEntry[] entriesToPaste )
     {
-        int scope = ISearch.SCOPE_OBJECT;
+        SearchScope scope = SearchScope.OBJECT;
         boolean askForScope = false;
         for ( int i = 0; i < entriesToPaste.length; i++ )
         {

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/ScopeDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/ScopeDialog.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/ScopeDialog.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/ScopeDialog.java Mon Oct 22 14:20:01 2007
@@ -22,7 +22,7 @@
 
 
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
@@ -50,7 +50,7 @@
     private boolean multipleEntriesSelected;
 
     /** The scope. */
-    private int scope = -1;
+    private SearchScope scope;
 
     /** The object scope button. */
     private Button objectScopeButton;
@@ -93,8 +93,8 @@
      */
     protected void okPressed()
     {
-        scope = objectScopeButton.getSelection() ? ISearch.SCOPE_OBJECT
-            : onelevelScopeButton.getSelection() ? ISearch.SCOPE_ONELEVEL : ISearch.SCOPE_SUBTREE;
+        scope = objectScopeButton.getSelection() ? SearchScope.OBJECT
+            : onelevelScopeButton.getSelection() ? SearchScope.ONELEVEL : SearchScope.SUBTREE;
         super.okPressed();
     }
 
@@ -141,7 +141,7 @@
      * 
      * @return the scope
      */
-    public int getScope()
+    public SearchScope getScope()
     {
         return scope;
     }

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java Mon Oct 22 14:20:01 2007
@@ -34,6 +34,8 @@
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.NameException;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
@@ -135,7 +137,7 @@
      * 
      * @return the aliases dereferencing method
      */
-    private int getAliasesDereferencingMethod()
+    private AliasDereferencingMethod getAliasesDereferencingMethod()
     {
         return aliasesDereferencingWidget.getAliasesDereferencingMethod();
     }
@@ -146,7 +148,7 @@
      * 
      * @return the referrals handling method
      */
-    private int getReferralsHandlingMethod()
+    private ReferralHandlingMethod getReferralsHandlingMethod()
     {
         return referralsHandlingWidget.getReferralsHandlingMethod();
     }
@@ -325,11 +327,16 @@
         int timeLimit = parameter.getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT );
         limitWidget.setTimeLimit( timeLimit );
 
-        int referralsHandlingMethod = parameter
+        int referralsHandlingMethodOrdinal = parameter
             .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD );
+        ReferralHandlingMethod referralsHandlingMethod = ReferralHandlingMethod
+            .getByOrdinal( referralsHandlingMethodOrdinal );
         referralsHandlingWidget.setReferralsHandlingMethod( referralsHandlingMethod );
-        int aliasesDereferencingMethod = parameter
+
+        int aliasesDereferencingMethodOrdinal = parameter
             .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD );
+        AliasDereferencingMethod aliasesDereferencingMethod = AliasDereferencingMethod
+            .getByOrdinal( aliasesDereferencingMethodOrdinal );
         aliasesDereferencingWidget.setAliasesDereferencingMethod( aliasesDereferencingMethod );
 
         connectionPageModified();
@@ -347,9 +354,9 @@
         parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_COUNT_LIMIT, getCountLimit() );
         parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT, getTimeLimit() );
         parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD,
-            getReferralsHandlingMethod() );
+            getReferralsHandlingMethod().getOrdinal() );
         parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD,
-            getAliasesDereferencingMethod() );
+            getAliasesDereferencingMethod().getOrdinal() );
     }
 
 
@@ -378,10 +385,15 @@
         int countLimit = connectionParameter
             .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_COUNT_LIMIT );
         int timeLimit = connectionParameter.getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT );
-        int referralsHandlingMethod = connectionParameter
+        int referralsHandlingMethodOrdinal = connectionParameter
             .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD );
-        int aliasesDereferencingMethod = connectionParameter
+        ReferralHandlingMethod referralsHandlingMethod = ReferralHandlingMethod
+            .getByOrdinal( referralsHandlingMethodOrdinal );
+        int aliasesDereferencingMethodOrdinal = connectionParameter
             .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD );
+        AliasDereferencingMethod aliasesDereferencingMethod = AliasDereferencingMethod
+            .getByOrdinal( aliasesDereferencingMethodOrdinal );
+        aliasesDereferencingWidget.setAliasesDereferencingMethod( aliasesDereferencingMethod );
 
         return isReconnectionRequired() || countLimit != getCountLimit() || timeLimit != getTimeLimit()
             || referralsHandlingMethod != getReferralsHandlingMethod()

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/AliasesDereferencingWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/AliasesDereferencingWidget.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/AliasesDereferencingWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/AliasesDereferencingWidget.java Mon Oct 22 14:20:01 2007
@@ -23,7 +23,7 @@
 
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
@@ -43,7 +43,7 @@
 {
 
     /** The initial aliases dereferencing method */
-    private int initialAliasesDereferencingMethod;
+    private AliasDereferencingMethod initialAliasesDereferencingMethod;
 
     /** The group. */
     private Group group;
@@ -57,13 +57,11 @@
 
     /**
      * Creates a new instance of AliasesDereferencingWidget with the given
-     * derefenencing method. This must be one of {@link IBrowserConnection#DEREFERENCE_ALIASES_NEVER},
-     * {@link IBrowserConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IBrowserConnection#DEREFERENCE_ALIASES_FINDING}
-     * or {@link IBrowserConnection#DEREFERENCE_ALIASES_ALWAYS}.
+     * dereferencing method.
      * 
      * @param initialAliasesDereferencingMethod the initial aliases dereferencing method
      */
-    public AliasesDereferencingWidget( int initialAliasesDereferencingMethod )
+    public AliasesDereferencingWidget( AliasDereferencingMethod initialAliasesDereferencingMethod )
     {
         this.initialAliasesDereferencingMethod = initialAliasesDereferencingMethod;
     }
@@ -71,11 +69,11 @@
 
     /**
      * Creates a new instance of AliasesDereferencingWidget. The initial 
-     * dereferncing method is set to {@link IBrowserConnection#DEREFERENCE_ALIASES_NEVER}.
+     * dereferencing method is set to {@link AliasDereferencingMethod.NEVER}.
      */
     public AliasesDereferencingWidget()
     {
-        this.initialAliasesDereferencingMethod = IBrowserConnection.DEREFERENCE_ALIASES_NEVER;
+        this.initialAliasesDereferencingMethod = AliasDereferencingMethod.NEVER;
     }
 
 
@@ -113,46 +111,42 @@
 
 
     /**
-     * Sets the aliases dereferencing method, must be one of {@link IBrowserConnection#DEREFERENCE_ALIASES_NEVER},
-     * {@link IBrowserConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IBrowserConnection#DEREFERENCE_ALIASES_FINDING}
-     * or {@link IBrowserConnection#DEREFERENCE_ALIASES_ALWAYS}.
+     * Sets the aliases dereferencing method.
      * 
      * @param aliasesDereferencingMethod the aliases dereferencing method
      */
-    public void setAliasesDereferencingMethod( int aliasesDereferencingMethod )
+    public void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod )
     {
         initialAliasesDereferencingMethod = aliasesDereferencingMethod;
-        findingButton.setSelection( initialAliasesDereferencingMethod == IBrowserConnection.DEREFERENCE_ALIASES_FINDING
-            || initialAliasesDereferencingMethod == IBrowserConnection.DEREFERENCE_ALIASES_ALWAYS );
-        searchButton.setSelection( initialAliasesDereferencingMethod == IBrowserConnection.DEREFERENCE_ALIASES_SEARCH
-            || initialAliasesDereferencingMethod == IBrowserConnection.DEREFERENCE_ALIASES_ALWAYS );
+        findingButton.setSelection( initialAliasesDereferencingMethod == AliasDereferencingMethod.FINDING
+            || initialAliasesDereferencingMethod == AliasDereferencingMethod.ALWAYS );
+        searchButton.setSelection( initialAliasesDereferencingMethod == AliasDereferencingMethod.SEARCH
+            || initialAliasesDereferencingMethod == AliasDereferencingMethod.ALWAYS );
     }
 
 
     /**
-     * Gets the aliases dereferencing method, one of {@link IBrowserConnection#DEREFERENCE_ALIASES_NEVER},
-     * {@link IBrowserConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IBrowserConnection#DEREFERENCE_ALIASES_FINDING}
-     * or {@link IBrowserConnection#DEREFERENCE_ALIASES_ALWAYS}.
+     * Gets the aliases dereferencing method.
      * 
      * @return the aliases dereferencing method
      */
-    public int getAliasesDereferencingMethod()
+    public AliasDereferencingMethod getAliasesDereferencingMethod()
     {
         if ( findingButton.getSelection() && searchButton.getSelection() )
         {
-            return IBrowserConnection.DEREFERENCE_ALIASES_ALWAYS;
+            return AliasDereferencingMethod.ALWAYS;
         }
         else if ( findingButton.getSelection() )
         {
-            return IBrowserConnection.DEREFERENCE_ALIASES_FINDING;
+            return AliasDereferencingMethod.FINDING;
         }
         else if ( searchButton.getSelection() )
         {
-            return IBrowserConnection.DEREFERENCE_ALIASES_SEARCH;
+            return AliasDereferencingMethod.SEARCH;
         }
         else
         {
-            return IBrowserConnection.DEREFERENCE_ALIASES_NEVER;
+            return AliasDereferencingMethod.NEVER;
         }
     }
 

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReferralsHandlingWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReferralsHandlingWidget.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReferralsHandlingWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReferralsHandlingWidget.java Mon Oct 22 14:20:01 2007
@@ -23,7 +23,7 @@
 
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
@@ -43,7 +43,7 @@
 {
 
     /** The initial referrals handling method. */
-    private int initialReferralsHandlingMethod;
+    private ReferralHandlingMethod initialReferralsHandlingMethod;
 
     /** The group. */
     private Group group;
@@ -57,13 +57,11 @@
 
     /**
      * Creates a new instance of ReferralsHandlingWidget with the given
-     * referrals handling method. This must be one of
-     * {@link IBrowserConnection#HANDLE_REFERRALS_IGNORE} or
-     * {@link IBrowserConnection#HANDLE_REFERRALS_FOLLOW}.  
+     * referrals handling method.  
      * 
      * @param initialReferralsHandlingMethod the initial referrals handling method
      */
-    public ReferralsHandlingWidget( int initialReferralsHandlingMethod )
+    public ReferralsHandlingWidget( ReferralHandlingMethod initialReferralsHandlingMethod )
     {
         this.initialReferralsHandlingMethod = initialReferralsHandlingMethod;
     }
@@ -71,11 +69,11 @@
 
     /**
      * Creates a new instance of ReferralsHandlingWidget with initial 
-     * referrals handling method {@link IBrowserConnection#HANDLE_REFERRALS_IGNORE}.
+     * referrals handling method {@link ReferralHandlingMethod.IGNORE}.
      */
     public ReferralsHandlingWidget()
     {
-        this.initialReferralsHandlingMethod = IBrowserConnection.HANDLE_REFERRALS_IGNORE;
+        this.initialReferralsHandlingMethod = ReferralHandlingMethod.IGNORE;
     }
 
 
@@ -113,36 +111,32 @@
 
 
     /**
-     * Sets the referrals handling method must be one of
-     *  {@link IBrowserConnection#HANDLE_REFERRALS_IGNORE} or
-     * {@link IBrowserConnection#HANDLE_REFERRALS_FOLLOW}. 
+     * Sets the referrals handling method. 
      * 
      * @param referralsHandlingMethod the referrals handling method
      */
-    public void setReferralsHandlingMethod( int referralsHandlingMethod )
+    public void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod )
     {
         initialReferralsHandlingMethod = referralsHandlingMethod;
-        ignoreButton.setSelection( initialReferralsHandlingMethod == IBrowserConnection.HANDLE_REFERRALS_IGNORE );
-        followButton.setSelection( initialReferralsHandlingMethod == IBrowserConnection.HANDLE_REFERRALS_FOLLOW );
+        ignoreButton.setSelection( initialReferralsHandlingMethod == ReferralHandlingMethod.IGNORE );
+        followButton.setSelection( initialReferralsHandlingMethod == ReferralHandlingMethod.FOLLOW );
     }
 
 
     /**
-     * Gets the referrals handling method, one of
-     * {@link IBrowserConnection#HANDLE_REFERRALS_IGNORE} or
-     * {@link IBrowserConnection#HANDLE_REFERRALS_FOLLOW}.
+     * Gets the referrals handling method.
      * 
      * @return the referrals handling method
      */
-    public int getReferralsHandlingMethod()
+    public ReferralHandlingMethod getReferralsHandlingMethod()
     {
         if ( ignoreButton.getSelection() )
         {
-            return IBrowserConnection.HANDLE_REFERRALS_IGNORE;
+            return ReferralHandlingMethod.IGNORE;
         }
         else
         {
-            return IBrowserConnection.HANDLE_REFERRALS_FOLLOW;
+            return ReferralHandlingMethod.FOLLOW;
         }
     }
 

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ScopeWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ScopeWidget.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ScopeWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ScopeWidget.java Mon Oct 22 14:20:01 2007
@@ -22,7 +22,7 @@
 
 
 import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -44,7 +44,7 @@
 {
 
     /** The initial scope. */
-    private int initialScope;
+    private SearchScope initialScope;
 
     /** The scope group. */
     private Group scopeGroup;
@@ -61,12 +61,11 @@
 
     /**
      * Creates a new instance of ScopeWidget with the given
-     * initial scope. That must be one of {@link ISearch#SCOPE_OBJECT},
-     * {@link ISearch#SCOPE_ONELEVEL} or {@link ISearch#SCOPE_SUBTREE}.
+     * initial scope.
      * 
      * @param initialScope the initial scope
      */
-    public ScopeWidget( int initialScope )
+    public ScopeWidget( SearchScope initialScope )
     {
         this.initialScope = initialScope;
     }
@@ -74,11 +73,11 @@
 
     /**
      * Creates a new instance of ScopeWidget with initial scope
-     * {@link ISearch#SCOPE_OBJECT}.
+     * {@link SearchScope.OBJECT}.
      */
     public ScopeWidget()
     {
-        this.initialScope = 0;
+        this.initialScope = SearchScope.OBJECT;
     }
 
 
@@ -134,45 +133,43 @@
 
 
     /**
-     * Sets the scope, must be one of {@link ISearch#SCOPE_OBJECT},
-     * {@link ISearch#SCOPE_ONELEVEL} or {@link ISearch#SCOPE_SUBTREE}.
+     * Sets the scope.
      * 
      * @param scope the scope
      */
-    public void setScope( int scope )
+    public void setScope( SearchScope scope )
     {
         initialScope = scope;
-        scopeObjectButton.setSelection( initialScope == ISearch.SCOPE_OBJECT );
-        scopeOnelevelButton.setSelection( initialScope == ISearch.SCOPE_ONELEVEL );
-        scopeSubtreeButton.setSelection( initialScope == ISearch.SCOPE_SUBTREE );
+        scopeObjectButton.setSelection( initialScope == SearchScope.OBJECT );
+        scopeOnelevelButton.setSelection( initialScope == SearchScope.ONELEVEL );
+        scopeSubtreeButton.setSelection( initialScope == SearchScope.SUBTREE );
     }
 
 
     /**
-     * Gets the scope, one of {@link ISearch#SCOPE_OBJECT},
-     * {@link ISearch#SCOPE_ONELEVEL} or {@link ISearch#SCOPE_SUBTREE}.
+     * Gets the scope.
      * 
      * @return the scope
      */
-    public int getScope()
+    public SearchScope getScope()
     {
-        int scope;
+        SearchScope scope;
 
         if ( scopeSubtreeButton.getSelection() )
         {
-            scope = ISearch.SCOPE_SUBTREE;
+            scope = SearchScope.SUBTREE;
         }
         else if ( scopeOnelevelButton.getSelection() )
         {
-            scope = ISearch.SCOPE_ONELEVEL;
+            scope =SearchScope.ONELEVEL;
         }
         else if ( scopeObjectButton.getSelection() )
         {
-            scope = ISearch.SCOPE_OBJECT;
+            scope = SearchScope.OBJECT;
         }
         else
         {
-            scope = ISearch.SCOPE_ONELEVEL;
+            scope = SearchScope.ONELEVEL;
         }
 
         return scope;

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java Mon Oct 22 14:20:01 2007
@@ -34,6 +34,9 @@
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.eclipse.swt.events.ModifyEvent;
@@ -715,7 +718,7 @@
 
         if ( scopeWidget != null )
         {
-            int scope = scopeWidget.getScope();;
+            SearchScope scope = scopeWidget.getScope();
             if ( scope != search.getScope() )
             {
                 search.getSearchParameter().setScope( scope );
@@ -739,7 +742,8 @@
         }
         if ( aliasesDereferencingWidget != null )
         {
-            int aliasesDereferencingMethod = aliasesDereferencingWidget.getAliasesDereferencingMethod();
+            AliasDereferencingMethod aliasesDereferencingMethod = aliasesDereferencingWidget
+                .getAliasesDereferencingMethod();
             if ( aliasesDereferencingMethod != search.getAliasesDereferencingMethod() )
             {
                 search.getSearchParameter().setAliasesDereferencingMethod( aliasesDereferencingMethod );
@@ -748,7 +752,7 @@
         }
         if ( referralsHandlingWidget != null )
         {
-            int referralsHandlingMethod = referralsHandlingWidget.getReferralsHandlingMethod();
+            ReferralHandlingMethod referralsHandlingMethod = referralsHandlingWidget.getReferralsHandlingMethod();
             if ( referralsHandlingMethod != search.getReferralsHandlingMethod() )
             {
                 search.getSearchParameter().setReferralsHandlingMethod( referralsHandlingMethod );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java Mon Oct 22 14:20:01 2007
@@ -21,7 +21,10 @@
 package org.apache.directory.studio.ldapbrowser.core;
 
 
+import java.beans.Encoder;
 import java.beans.ExceptionListener;
+import java.beans.Expression;
+import java.beans.PersistenceDelegate;
 import java.beans.XMLDecoder;
 import java.beans.XMLEncoder;
 import java.io.BufferedInputStream;
@@ -32,6 +35,8 @@
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -57,6 +62,9 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.utils.LdifUtils;
 import org.eclipse.core.runtime.IPath;
@@ -588,6 +596,9 @@
             String tempFilename = filename + "-temp";
             Thread.currentThread().setContextClassLoader( getClass().getClassLoader() );
             encoder = new XMLEncoder( new BufferedOutputStream( new FileOutputStream( tempFilename ) ) );
+            encoder.setPersistenceDelegate( SearchScope.class, new TypeSafeEnumPersistenceDelegate() );
+            encoder.setPersistenceDelegate( ReferralHandlingMethod.class, new TypeSafeEnumPersistenceDelegate() );
+            encoder.setPersistenceDelegate( AliasDereferencingMethod.class, new TypeSafeEnumPersistenceDelegate() );
             encoder.setExceptionListener( new ExceptionListener()
             {
                 public void exceptionThrown( Exception e )
@@ -620,4 +631,47 @@
             }
         }
     }
+    
+    
+    class TypeSafeEnumPersistenceDelegate extends PersistenceDelegate
+    {
+        protected boolean mutatesTo( Object oldInstance, Object newInstance )
+        {
+            return oldInstance == newInstance;
+        }
+
+
+        protected Expression instantiate( Object oldInstance, Encoder out )
+        {
+            Class<?> type = oldInstance.getClass();
+            if ( !Modifier.isPublic( type.getModifiers() ) )
+            {
+                throw new IllegalArgumentException( "Could not instantiate instance of non-public class: "
+                    + oldInstance );
+            }
+
+            for ( Field field : type.getFields() )
+            {
+                int mod = field.getModifiers();
+                if ( Modifier.isPublic( mod ) && Modifier.isStatic( mod ) && Modifier.isFinal( mod )
+                    && ( type == field.getDeclaringClass() ) )
+                {
+                    try
+                    {
+                        if ( oldInstance == field.get( null ) )
+                        {
+                            return new Expression( oldInstance, field, "get", new Object[]
+                                { null } );
+                        }
+                    }
+                    catch ( IllegalAccessException exception )
+                    {
+                        throw new IllegalArgumentException( "Could not get value of the field: " + field, exception );
+                    }
+                }
+            }
+            throw new IllegalArgumentException( "Could not instantiate value: " + oldInstance );
+        }
+    }
+
 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/BrowserConnection.java Mon Oct 22 14:20:01 2007
@@ -85,21 +85,13 @@
         {
             connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_COUNT_LIMIT, 0 );
             connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_TIME_LIMIT, 0 );
-            connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD, IBrowserConnection.DEREFERENCE_ALIASES_NEVER );
-            connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD, IBrowserConnection.HANDLE_REFERRALS_IGNORE );
+            connection.getConnectionParameter().setExtendedIntProperty(
+                CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD, AliasDereferencingMethod.NEVER.getOrdinal() );
+            connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD,
+                ReferralHandlingMethod.IGNORE.getOrdinal() );
             connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_FETCH_BASE_DNS, true );
             connection.getConnectionParameter().setExtendedProperty( CONNECTION_PARAMETER_BASE_DN, "" );
         }
-        
-//        this.browserConnectionParameter = new BrowserConnectionParameter();
-//        this.browserConnectionParameter.setCountLimit( 0 );
-//        this.browserConnectionParameter.setTimeLimit( 0 );
-//        this.browserConnectionParameter.setAliasesDereferencingMethod( IConnection.DEREFERENCE_ALIASES_NEVER );
-//        this.browserConnectionParameter.setReferralsHandlingMethod( IConnection.HANDLE_REFERRALS_IGNORE );
-//        this.browserConnectionParameter.setFetchBaseDNs( true );
-//        this.browserConnectionParameter.setBaseDN( new DN() );
-        
-
 
         this.searchManager = new SearchManager( this );
         this.bookmarkManager = new BookmarkManager( this );
@@ -238,18 +230,21 @@
     /**
      * @see org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection#getAliasesDereferencingMethod()
      */
-    public int getAliasesDereferencingMethod()
+    public AliasDereferencingMethod getAliasesDereferencingMethod()
     {
-        return connection.getConnectionParameter().getExtendedIntProperty( CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD );
+        int ordinal = connection.getConnectionParameter().getExtendedIntProperty(
+            CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD );
+        return AliasDereferencingMethod.getByOrdinal( ordinal );
     }
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection#setAliasesDereferencingMethod(int)
+     * @see org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection#setAliasesDereferencingMethod(AliasDereferencingMethod)
      */
-    public void setAliasesDereferencingMethod( int aliasesDereferencingMethod )
+    public void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod )
     {
-        connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD, aliasesDereferencingMethod );
+        connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD,
+            aliasesDereferencingMethod.getOrdinal() );
         ConnectionEventRegistry.fireConnectionUpdated( connection, this );
     }
 
@@ -257,18 +252,21 @@
     /**
      * @see org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection#getReferralsHandlingMethod()
      */
-    public int getReferralsHandlingMethod()
+    public ReferralHandlingMethod getReferralsHandlingMethod()
     {
-        return connection.getConnectionParameter().getExtendedIntProperty( CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD );
+        int ordinal = connection.getConnectionParameter().getExtendedIntProperty(
+            CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD );
+        return ReferralHandlingMethod.getByOrdinal( ordinal );
     }
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection#setReferralsHandlingMethod(int)
+     * @see org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection#setReferralsHandlingMethod(ReferralHandlingMethod)
      */
-    public void setReferralsHandlingMethod( int referralsHandlingMethod )
+    public void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod )
     {
-        connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD, referralsHandlingMethod );
+        connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD,
+            referralsHandlingMethod.getOrdinal() );
         ConnectionEventRegistry.fireConnectionUpdated( connection, this );
     }
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyConnection.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/DummyConnection.java Mon Oct 22 14:20:01 2007
@@ -64,9 +64,9 @@
     }
 
 
-    public int getAliasesDereferencingMethod()
+    public AliasDereferencingMethod getAliasesDereferencingMethod()
     {
-        return DEREFERENCE_ALIASES_NEVER;
+        return AliasDereferencingMethod.NEVER;
     }
 
 
@@ -116,7 +116,7 @@
     }
 
 
-    public void setAliasesDereferencingMethod( int aliasesDereferencingMethod )
+    public void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod )
     {
     }
 
@@ -156,13 +156,13 @@
     }
 
 
-    public int getReferralsHandlingMethod()
+    public ReferralHandlingMethod getReferralsHandlingMethod()
     {
-        return HANDLE_REFERRALS_IGNORE;
+        return ReferralHandlingMethod.IGNORE;
     }
 
 
-    public void setReferralsHandlingMethod( int referralsHandlingMethod )
+    public void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod )
     {
     }
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/OpenBrowserConnectionsJob.java Mon Oct 22 14:20:01 2007
@@ -35,6 +35,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 
 
@@ -146,7 +147,7 @@
                     sp.setSearchBase( new DN( rootDSE.getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY )
                         .getStringValue() ) );
                     sp.setFilter( Schema.SCHEMA_FILTER );
-                    sp.setScope( ISearch.SCOPE_OBJECT );
+                    sp.setScope( SearchScope.OBJECT );
                     sp.setReturningAttributes( new String[]
                         { IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP,
                             IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP, } );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Search.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Search.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Search.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/internal/model/Search.java Mon Oct 22 14:20:01 2007
@@ -35,6 +35,8 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
 import org.apache.directory.studio.ldapbrowser.core.model.URL;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 
@@ -86,8 +88,8 @@
     {
         this(
             new SimpleDateFormat( "yyyy-MM-dd HH-mm-ss" ).format( new Date() ), //$NON-NLS-1$
-            null, EMPTY_SEARCH_BASE, FILTER_TRUE, NO_ATTRIBUTES, ISearch.SCOPE_ONELEVEL, 0, 0,
-            IBrowserConnection.DEREFERENCE_ALIASES_NEVER, IBrowserConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
+            null, EMPTY_SEARCH_BASE, FILTER_TRUE, NO_ATTRIBUTES, SearchScope.ONELEVEL, 0, 0,
+            AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, false, false, null );
     }
 
 
@@ -123,26 +125,25 @@
      *                the attributes to return, an empty array indicates none,
      *                null will be transformed to '*' (all user attributes)
      * @param scope
-     *                the search scope, one of SCOPE_OBJECT, SCOPE_ONELEVEL,
-     *                SCOPE_SUBTREE
+     *                the search scope
      * @param countLimit
      *                the count limit, 0 indicates no limit
      * @param timeLimit
      *                the time limit in ms, 0 indicates no limit
      * @param aliasesDereferencingMethod
-     *                the aliases dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER,
-     *                IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING
-     *                or IConnection.DEREFERENCE_ALIASES_SEARCH
+     *                the aliases dereferencing method
      * @param referralsHandlingMethod
-     *                the referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE
-     *                or IConnection.HANDLE_REFERRALS_FOLLOW
+     *                the referrals handling method
      * @param initHasChildrenFlag
      *                the init hasChildren flag
      * @param initAliasAndReferralsFlag
      *                the init isAlias and isReferral flag
+     * @param controls
+     *                the controls
      */
-    public Search( String searchName, IBrowserConnection conn, DN searchBase, String filter, String[] returningAttributes,
-        int scope, int countLimit, int timeLimit, int aliasesDereferencingMethod, int referralsHandlingMethod,
+    public Search( String searchName, IBrowserConnection conn, DN searchBase, String filter,
+        String[] returningAttributes, SearchScope scope, int countLimit, int timeLimit,
+        AliasDereferencingMethod aliasesDereferencingMethod, ReferralHandlingMethod referralsHandlingMethod,
         boolean initHasChildrenFlag, boolean initAliasAndReferralsFlag, Control[] controls )
     {
         this.connection = conn;
@@ -274,7 +275,7 @@
     /**
      * {@inheritDoc}
      */
-    public int getScope()
+    public SearchScope getScope()
     {
         return this.searchParameter.getScope();
     }
@@ -283,7 +284,7 @@
     /**
      * {@inheritDoc}
      */
-    public void setScope( int scope )
+    public void setScope( SearchScope scope )
     {
         this.searchParameter.setScope( scope );
         this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED );
@@ -293,7 +294,7 @@
     /**
      * {@inheritDoc}
      */
-    public int getAliasesDereferencingMethod()
+    public AliasDereferencingMethod getAliasesDereferencingMethod()
     {
         return this.searchParameter.getAliasesDereferencingMethod();
     }
@@ -302,7 +303,7 @@
     /**
      * {@inheritDoc}
      */
-    public void setAliasesDereferencingMethod( int aliasesDereferencingMethod )
+    public void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod )
     {
         this.searchParameter.setAliasesDereferencingMethod( aliasesDereferencingMethod );
         this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED );
@@ -312,7 +313,7 @@
     /**
      * {@inheritDoc}
      */
-    public int getReferralsHandlingMethod()
+    public ReferralHandlingMethod getReferralsHandlingMethod()
     {
         return this.searchParameter.getReferralsHandlingMethod();
     }
@@ -321,7 +322,7 @@
     /**
      * {@inheritDoc}
      */
-    public void setReferralsHandlingMethod( int referralsHandlingMethod )
+    public void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod )
     {
         this.searchParameter.setReferralsHandlingMethod( referralsHandlingMethod );
         this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java Mon Oct 22 14:20:01 2007
@@ -35,7 +35,6 @@
 import org.apache.directory.studio.ldapbrowser.core.internal.model.Search;
 import org.apache.directory.studio.ldapbrowser.core.internal.model.Value;
 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.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
@@ -44,6 +43,9 @@
 import org.apache.directory.studio.ldapbrowser.core.model.RDN;
 import org.apache.directory.studio.ldapbrowser.core.model.RDNPart;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 
 
@@ -63,7 +65,7 @@
     private IEntry[] entriesToCopy;
 
     /** The copy scope */
-    private int scope;
+    private SearchScope scope;
 
 
     /**
@@ -73,7 +75,7 @@
      * @param entriesToCopy the entries to copy
      * @param scope the copy scope
      */
-    public CopyEntriesJob( final IEntry parent, final IEntry[] entriesToCopy, int scope )
+    public CopyEntriesJob( final IEntry parent, final IEntry[] entriesToCopy, SearchScope scope )
     {
         this.parent = parent;
         this.entriesToCopy = entriesToCopy;
@@ -119,17 +121,17 @@
         monitor.reportProgress( " " ); //$NON-NLS-1$
         monitor.worked( 1 );
 
-        if ( scope == ISearch.SCOPE_OBJECT || scope == ISearch.SCOPE_ONELEVEL || scope == ISearch.SCOPE_SUBTREE )
+        if ( scope == SearchScope.OBJECT || scope == SearchScope.ONELEVEL || scope == SearchScope.SUBTREE )
         {
             int num = 0;
             for ( int i = 0; !monitor.isCanceled() && i < entriesToCopy.length; i++ )
             {
                 IEntry entryToCopy = entriesToCopy[i];
 
-                if ( scope == ISearch.SCOPE_OBJECT
+                if ( scope == SearchScope.OBJECT
                     || !parent.getDn().toString().endsWith( entryToCopy.getDn().toString() ) )
                 {
-                    num = this.copyEntryRecursive( entryToCopy, parent, scope, num, monitor );
+                    num = copyEntryRecursive( entryToCopy, parent, scope, num, monitor );
                 }
                 else
                 {
@@ -172,7 +174,7 @@
      * 
      * @return the number of copied entries
      */
-    private int copyEntryRecursive( IEntry entryToCopy, IEntry parent, int scope, int num, StudioProgressMonitor monitor )
+    private int copyEntryRecursive( IEntry entryToCopy, IEntry parent, SearchScope scope, int num, StudioProgressMonitor monitor )
     {
         try
         {
@@ -180,9 +182,9 @@
             SearchParameter param = new SearchParameter();
             param.setSearchBase( entryToCopy.getDn() );
             param.setFilter( ISearch.FILTER_TRUE );
-            param.setScope( ISearch.SCOPE_OBJECT );
-            param.setAliasesDereferencingMethod( IBrowserConnection.DEREFERENCE_ALIASES_NEVER );
-            param.setReferralsHandlingMethod( IBrowserConnection.HANDLE_REFERRALS_IGNORE );
+            param.setScope( SearchScope.OBJECT );
+            param.setAliasesDereferencingMethod( AliasDereferencingMethod.NEVER );
+            param.setReferralsHandlingMethod( ReferralHandlingMethod.IGNORE );
             param.setReturningAttributes( new String[]
                 { ISearch.ALL_USER_ATTRIBUTES, IAttribute.REFERRAL_ATTRIBUTE } );
             ISearch search = new Search( entryToCopy.getBrowserConnection(), param );
@@ -300,13 +302,13 @@
                         { Integer.toString( num ) } ) );
 
                 // check for children
-                if ( !monitor.isCanceled() && ( scope == ISearch.SCOPE_ONELEVEL || scope == ISearch.SCOPE_SUBTREE ) )
+                if ( !monitor.isCanceled() && ( scope == SearchScope.ONELEVEL || scope == SearchScope.SUBTREE ) )
                 {
                     // TODO: use JNDI here!!!
                     SearchParameter subParam = new SearchParameter();
                     subParam.setSearchBase( entryToCopy.getDn() );
                     subParam.setFilter( ISearch.FILTER_TRUE );
-                    subParam.setScope( ISearch.SCOPE_ONELEVEL );
+                    subParam.setScope( SearchScope.ONELEVEL );
                     subParam.setReturningAttributes( ISearch.NO_ATTRIBUTES );
                     ISearch subSearch = new Search( entryToCopy.getBrowserConnection(), subParam );
                     SearchJob.searchAndUpdateModel( entryToCopy.getBrowserConnection(), subSearch, monitor );
@@ -319,14 +321,14 @@
                             ISearchResult subSearchResult = subSrs[i];
                             IEntry childEntry = subSearchResult.getEntry();
 
-                            if ( scope == ISearch.SCOPE_ONELEVEL )
+                            if ( scope == SearchScope.ONELEVEL )
                             {
                                 num = this
-                                    .copyEntryRecursive( childEntry, newEntry, ISearch.SCOPE_OBJECT, num, monitor );
+                                    .copyEntryRecursive( childEntry, newEntry,SearchScope.OBJECT, num, monitor );
                             }
-                            else if ( scope == ISearch.SCOPE_SUBTREE )
+                            else if ( scope == SearchScope.SUBTREE )
                             {
-                                num = this.copyEntryRecursive( childEntry, newEntry, ISearch.SCOPE_SUBTREE, num,
+                                num = this.copyEntryRecursive( childEntry, newEntry, SearchScope.SUBTREE, num,
                                     monitor );
                             }
                         }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java Mon Oct 22 14:20:01 2007
@@ -45,6 +45,9 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 
 
 /*
@@ -192,9 +195,9 @@
                 SearchParameter subParam = new SearchParameter();
                 subParam.setSearchBase( entry.getDn() );
                 subParam.setFilter( ISearch.FILTER_TRUE );
-                subParam.setScope( ISearch.SCOPE_ONELEVEL );
-                subParam.setAliasesDereferencingMethod( IBrowserConnection.DEREFERENCE_ALIASES_NEVER );
-                subParam.setReferralsHandlingMethod( IBrowserConnection.HANDLE_REFERRALS_IGNORE );
+                subParam.setScope( SearchScope.ONELEVEL );
+                subParam.setAliasesDereferencingMethod( AliasDereferencingMethod.NEVER );
+                subParam.setReferralsHandlingMethod( ReferralHandlingMethod.IGNORE );
                 subParam.setReturningAttributes( new String[]
                     { IAttribute.OBJECTCLASS_ATTRIBUTE, IAttribute.REFERRAL_ATTRIBUTE } );
                 subParam.setCountLimit( 1000 );
@@ -221,9 +224,9 @@
                     SearchParameter param = new SearchParameter();
                     param.setSearchBase( entry.getDn() );
                     param.setFilter( ISearch.FILTER_TRUE );
-                    param.setScope( ISearch.SCOPE_OBJECT );
-                    param.setAliasesDereferencingMethod( IBrowserConnection.DEREFERENCE_ALIASES_NEVER );
-                    param.setReferralsHandlingMethod( IBrowserConnection.HANDLE_REFERRALS_IGNORE );
+                    param.setScope( SearchScope.OBJECT );
+                    param.setAliasesDereferencingMethod( AliasDereferencingMethod.NEVER );
+                    param.setReferralsHandlingMethod( ReferralHandlingMethod.IGNORE );
                     param.setReturningAttributes( new String[]
                         { IAttribute.OBJECTCLASS_ATTRIBUTE, IAttribute.REFERRAL_ATTRIBUTE } );
                     ISearch search = new Search( entry.getBrowserConnection(), param );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportCsvJob.java Mon Oct 22 14:20:01 2007
@@ -41,6 +41,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifEnumeration;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContainer;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
@@ -226,9 +227,8 @@
             else if ( ce instanceof ReferralException )
             {
 
-                if ( searchParameter.getReferralsHandlingMethod() == IBrowserConnection.HANDLE_REFERRALS_FOLLOW )
+                if ( searchParameter.getReferralsHandlingMethod() == ReferralHandlingMethod.FOLLOW )
                 {
-
                     ReferralException re = ( ReferralException ) ce;
                     ISearch[] referralSearches = re.getReferralSearches();
                     for ( int i = 0; i < referralSearches.length; i++ )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java Mon Oct 22 14:20:01 2007
@@ -58,8 +58,9 @@
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.model.Control;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.dom4j.Document;
 import org.dom4j.DocumentHelper;
 import org.dom4j.Element;
@@ -142,37 +143,38 @@
             searchRequest.setBaseObject( new LdapDN( searchParameter.getSearchBase().toString() ) );
 
             // Scope
-            int scope = searchParameter.getScope();
-            if ( scope == ISearch.SCOPE_OBJECT )
+            SearchScope scope = searchParameter.getScope();
+            if ( scope == SearchScope.OBJECT )
             {
                 searchRequest.setScope( ScopeEnum.BASE_OBJECT );
             }
-            else if ( scope == ISearch.SCOPE_ONELEVEL )
+            else if ( scope == SearchScope.ONELEVEL )
             {
                 searchRequest.setScope( ScopeEnum.SINGLE_LEVEL );
             }
-            else if ( scope == ISearch.SCOPE_SUBTREE )
+            else if ( scope == SearchScope.SUBTREE )
             {
                 searchRequest.setScope( ScopeEnum.WHOLE_SUBTREE );
             }
 
             // DerefAliases
-            int derefAliases = searchParameter.getAliasesDereferencingMethod();
-            if ( derefAliases == IBrowserConnection.DEREFERENCE_ALIASES_ALWAYS )
+            AliasDereferencingMethod derefAliases = searchParameter.getAliasesDereferencingMethod();
+            switch ( derefAliases )
             {
-                searchRequest.setDerefAliases( LdapConstants.DEREF_ALWAYS );
-            }
-            else if ( derefAliases == IBrowserConnection.DEREFERENCE_ALIASES_FINDING )
-            {
-                searchRequest.setDerefAliases( LdapConstants.DEREF_FINDING_BASE_OBJ );
-            }
-            else if ( derefAliases == IBrowserConnection.DEREFERENCE_ALIASES_NEVER )
-            {
-                searchRequest.setDerefAliases( LdapConstants.NEVER_DEREF_ALIASES );
-            }
-            else if ( derefAliases == IBrowserConnection.DEREFERENCE_ALIASES_SEARCH )
-            {
-                searchRequest.setDerefAliases( LdapConstants.DEREF_IN_SEARCHING );
+                case ALWAYS:
+                    searchRequest.setDerefAliases( LdapConstants.DEREF_ALWAYS );
+                    break;
+                case FINDING:
+                    searchRequest.setDerefAliases( LdapConstants.DEREF_FINDING_BASE_OBJ );
+                    break;
+                case NEVER:
+                    searchRequest.setDerefAliases( LdapConstants.NEVER_DEREF_ALIASES );
+                    break;
+                case SEARCH:
+                    searchRequest.setDerefAliases( LdapConstants.DEREF_IN_SEARCHING );
+                    break;
+                default:
+                    break;
             }
 
             // Time Limit
@@ -439,7 +441,7 @@
     {
         List<org.apache.directory.shared.ldap.codec.Control> returnList = new ArrayList<org.apache.directory.shared.ldap.codec.Control>();
 
-        if ( controls != null)
+        if ( controls != null )
         {
             for ( int i = 0; i < controls.length; i++ )
             {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java Mon Oct 22 14:20:01 2007
@@ -46,6 +46,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.NameException;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifEnumeration;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContainer;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
@@ -192,7 +193,7 @@
             }
             else if ( ce instanceof ReferralException )
             {
-                if ( searchParameter.getReferralsHandlingMethod() == IBrowserConnection.HANDLE_REFERRALS_FOLLOW )
+                if ( searchParameter.getReferralsHandlingMethod() == ReferralHandlingMethod.FOLLOW )
                 {
                     ReferralException re = ( ReferralException ) ce;
                     ISearch[] referralSearches = re.getReferralSearches();

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java Mon Oct 22 14:20:01 2007
@@ -37,6 +37,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifEnumeration;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContainer;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
@@ -250,7 +251,7 @@
             }
             else if ( ce instanceof ReferralException )
             {
-                if ( searchParameter.getReferralsHandlingMethod() == IBrowserConnection.HANDLE_REFERRALS_FOLLOW )
+                if ( searchParameter.getReferralsHandlingMethod() == ReferralHandlingMethod.FOLLOW )
                 {
                     ReferralException re = ( ReferralException ) ce;
                     ISearch[] referralSearches = re.getReferralSearches();

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java Mon Oct 22 14:20:01 2007
@@ -44,6 +44,9 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.NameException;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 
@@ -244,7 +247,7 @@
         {
 	        // search
 	        ISearch search = new Search( null, entry.getBrowserConnection(), entry.getDn(), entry.isSubentry()?ISearch.FILTER_SUBENTRY:ISearch.FILTER_TRUE, attributes,
-	            ISearch.SCOPE_OBJECT, 0, 0, IBrowserConnection.DEREFERENCE_ALIASES_NEVER, IBrowserConnection.HANDLE_REFERRALS_IGNORE,
+	            SearchScope.OBJECT, 0, 0, AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE,
 	            false, false, null );
 	        SearchJob.searchAndUpdateModel( entry.getBrowserConnection(), search, monitor );
 	
@@ -283,8 +286,8 @@
 
         // get well-known root DSE attributes, includes + and *
         ISearch search = new Search( null, browserConnection, new DN(), ISearch.FILTER_TRUE,
-            IBrowserConnection.ROOT_DSE_ATTRIBUTES, ISearch.SCOPE_OBJECT, 0, 0,
-            IBrowserConnection.DEREFERENCE_ALIASES_NEVER, IBrowserConnection.HANDLE_REFERRALS_IGNORE, false, false,
+            IBrowserConnection.ROOT_DSE_ATTRIBUTES, SearchScope.OBJECT, 0, 0,
+            AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, false, false,
             null );
         SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
 
@@ -299,8 +302,8 @@
             
             // check if entry exists
             // TODO: use browserConnection.getEntry( dn, monitor ) ??
-            search = new Search( null, browserConnection, dn, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, ISearch.SCOPE_OBJECT, 1, 0,
-                IBrowserConnection.DEREFERENCE_ALIASES_NEVER, IBrowserConnection.HANDLE_REFERRALS_IGNORE, true, true, null );
+            search = new Search( null, browserConnection, dn, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, SearchScope.OBJECT, 1, 0,
+                AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, true, true, null );
             SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
         }
         else
@@ -333,8 +336,8 @@
                 else
                 {
                     // special handling of empty namingContext: perform a one-level search and add all result DNs to the set
-                    search = new Search( null, browserConnection, new DN(), ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, ISearch.SCOPE_ONELEVEL, 0,
-                        0, IBrowserConnection.DEREFERENCE_ALIASES_NEVER, IBrowserConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
+                    search = new Search( null, browserConnection, new DN(), ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, SearchScope.ONELEVEL, 0,
+                        0, AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, false, false, null );
                     SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
                     ISearchResult[] results = search.getSearchResults();
                     for ( int k = 0; results != null && k < results.length; k++ )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java Mon Oct 22 14:20:01 2007
@@ -36,11 +36,13 @@
 import org.apache.directory.studio.ldapbrowser.core.internal.model.ReferralBaseEntry;
 import org.apache.directory.studio.ldapbrowser.core.internal.model.Search;
 import org.apache.directory.studio.ldapbrowser.core.model.Control;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 
 
 /**
@@ -173,17 +175,17 @@
             parent.setChildrenInitialized( false );
             
             // determine alias and referral handling
-            int scope = ISearch.SCOPE_ONELEVEL;
-            int derefAliasMethod = parent.getBrowserConnection().getAliasesDereferencingMethod();
-            int handleReferralsMethod = parent.getBrowserConnection().getReferralsHandlingMethod();
+            SearchScope scope = SearchScope.ONELEVEL;
+            AliasDereferencingMethod derefAliasMethod = parent.getBrowserConnection().getAliasesDereferencingMethod();
+            ReferralHandlingMethod handleReferralsMethod = parent.getBrowserConnection().getReferralsHandlingMethod();
             if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
                 BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS ) )
             {
-                scope = ( parent.isAlias() || parent.isReferral() ) ? ISearch.SCOPE_OBJECT : ISearch.SCOPE_ONELEVEL;
-                derefAliasMethod = parent.isAlias() ? IBrowserConnection.DEREFERENCE_ALIASES_FINDING
-                    : IBrowserConnection.DEREFERENCE_ALIASES_NEVER;
-                handleReferralsMethod = parent.isReferral() ? IBrowserConnection.HANDLE_REFERRALS_FOLLOW
-                    : IBrowserConnection.HANDLE_REFERRALS_IGNORE;
+                scope = ( parent.isAlias() || parent.isReferral() ) ? SearchScope.OBJECT : SearchScope.ONELEVEL;
+                derefAliasMethod = parent.isAlias() ? AliasDereferencingMethod.FINDING
+                    : AliasDereferencingMethod.NEVER;
+                handleReferralsMethod = parent.isReferral() ? ReferralHandlingMethod.FOLLOW
+                    : ReferralHandlingMethod.IGNORE;
             }
 
             // get children,

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java Mon Oct 22 14:20:01 2007
@@ -31,6 +31,9 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 
 
 /**
@@ -157,8 +160,8 @@
 
             // search in directory
             ISearch search = new Search( null, browserConnection, dn, null, ISearch.NO_ATTRIBUTES,
-                ISearch.SCOPE_OBJECT, 1, 0, IBrowserConnection.DEREFERENCE_ALIASES_NEVER,
-                IBrowserConnection.HANDLE_REFERRALS_IGNORE, true, true, null );
+                SearchScope.OBJECT, 1, 0, AliasDereferencingMethod.NEVER,
+                ReferralHandlingMethod.IGNORE, true, true, null );
             SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
             ISearchResult[] srs = search.getSearchResults();
             if ( srs.length > 0 )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java Mon Oct 22 14:20:01 2007
@@ -30,8 +30,8 @@
 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.IRootDSE;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifEnumeration;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
@@ -144,7 +144,7 @@
                 sp.setSearchBase( new DN( browserConnection.getRootDSE().getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY )
                     .getStringValue() ) );
                 sp.setFilter( Schema.SCHEMA_FILTER );
-                sp.setScope( ISearch.SCOPE_OBJECT );
+                sp.setScope( SearchScope.OBJECT );
                 sp.setReturningAttributes( new String[]
                     { Schema.SCHEMA_ATTRIBUTE_OBJECTCLASSES, Schema.SCHEMA_ATTRIBUTE_ATTRIBUTETYPES,
                         Schema.SCHEMA_ATTRIBUTE_LDAPSYNTAXES, Schema.SCHEMA_ATTRIBUTE_MATCHINGRULES,

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java?rev=587265&r1=587264&r2=587265&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java Mon Oct 22 14:20:01 2007
@@ -58,6 +58,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassDescription;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 
@@ -222,7 +223,7 @@
                     }
                     else if ( ce instanceof ReferralException )
                     {
-                        if ( search.getReferralsHandlingMethod() == IBrowserConnection.HANDLE_REFERRALS_FOLLOW )
+                        if ( search.getReferralsHandlingMethod() == ReferralHandlingMethod.FOLLOW )
                         {
                             ReferralException re = ( ReferralException ) ce;
                             ISearch[] referralSearches = re.getReferralSearches();
@@ -275,13 +276,13 @@
         SearchControls controls = new SearchControls();
         switch ( parameter.getScope() )
         {
-            case ISearch.SCOPE_OBJECT:
+            case OBJECT:
                 controls.setSearchScope( SearchControls.OBJECT_SCOPE );
                 break;
-            case ISearch.SCOPE_ONELEVEL:
+            case ONELEVEL:
                 controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
                 break;
-            case ISearch.SCOPE_SUBTREE:
+            case SUBTREE:
                 controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
                 break;
             default:
@@ -292,7 +293,7 @@
         controls.setTimeLimit( parameter.getTimeLimit() );
         String filter = parameter.getFilter();
         String derefAliasMethod = getDerefAliasMethod( parameter );
-        String handleReferralsMethod = getReferralsHandlingMethod( parameter.getReferralsHandlingMethod() );
+        String handleReferralsMethod = getReferralsHandlingMethod( parameter );
 
         Control[] ldapControls = null;
         if ( parameter.getControls() != null )
@@ -317,16 +318,16 @@
 
         switch ( parameter.getAliasesDereferencingMethod() )
         {
-            case IBrowserConnection.DEREFERENCE_ALIASES_NEVER:
+            case NEVER:
                 m = "never"; //$NON-NLS-1$
                 break;
-            case IBrowserConnection.DEREFERENCE_ALIASES_ALWAYS:
+            case ALWAYS:
                 m = "always"; //$NON-NLS-1$
                 break;
-            case IBrowserConnection.DEREFERENCE_ALIASES_FINDING:
+            case FINDING:
                 m = "finding"; //$NON-NLS-1$
                 break;
-            case IBrowserConnection.DEREFERENCE_ALIASES_SEARCH:
+            case SEARCH:
                 m = "searching"; //$NON-NLS-1$
                 break;
         }
@@ -335,16 +336,16 @@
     }
 
 
-    private static String getReferralsHandlingMethod( int referralHandlingMethod )
+    private static String getReferralsHandlingMethod( SearchParameter parameter )
     {
         String m = "follow"; //$NON-NLS-1$
 
-        switch ( referralHandlingMethod )
+        switch ( parameter.getReferralsHandlingMethod() )
         {
-            case IBrowserConnection.HANDLE_REFERRALS_IGNORE:
+            case IGNORE:
                 m = "ignore"; //$NON-NLS-1$
                 break;
-            case IBrowserConnection.HANDLE_REFERRALS_FOLLOW:
+            case FOLLOW:
                 // m = "follow"; //$NON-NLS-1$
                 m = "throw"; //$NON-NLS-1$
                 break;



Mime
View raw message