directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r588323 - in /directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core: internal/model/ jobs/ model/
Date Thu, 25 Oct 2007 19:53:53 GMT
Author: seelmann
Date: Thu Oct 25 12:53:52 2007
New Revision: 588323

URL: http://svn.apache.org/viewvc?rev=588323&view=rev
Log:
DIRSTUDIO-123: Some Javadoc and code cleaning

Modified:
    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/jobs/InitializeAttributesJob.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/ModelModificationException.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/NameException.java

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=588323&r1=588322&r2=588323&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
Thu Oct 25 12:53:52 2007
@@ -25,6 +25,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.ConnectionFolder;
 import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
@@ -44,15 +45,20 @@
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 
+/**
+ * The default implementation of {@link IBrowserConnection}.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class BrowserConnection implements ConnectionUpdateListener, IBrowserConnection, Serializable
 {
 
     private static final long serialVersionUID = 2987596234755856270L;
 
-    private org.apache.directory.studio.connection.core.Connection connection;
+    /** The connection. */
+    private Connection connection;
     
-//    private BrowserConnectionParameter browserConnectionParameter;
-
     private IRootDSE rootDSE;
 
     private Schema schema;
@@ -454,7 +460,7 @@
     }
 
 
-    public org.apache.directory.studio.connection.core.Connection getConnection()
+    public Connection getConnection()
     {
         return connection;
     }

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=588323&r1=588322&r2=588323&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
Thu Oct 25 12:53:52 2007
@@ -32,156 +32,246 @@
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 
 
+/**
+ * Connection without any operation. It could be used to make model modifications
+ * without committing these modifications to the directory.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class DummyConnection implements IBrowserConnection
 {
 
     private static final long serialVersionUID = 3671686808330691741L;
 
+    /** The schema. */
     private Schema schema;
 
 
+    /**
+     * Creates a new instance of DummyConnection.
+     * 
+     * @param schema the schema
+     */
     public DummyConnection( Schema schema )
     {
         this.schema = schema;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public DN getBaseDN()
     {
         return new DN();
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public BookmarkManager getBookmarkManager()
     {
         return null;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public int getCountLimit()
     {
         return 0;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public AliasDereferencingMethod getAliasesDereferencingMethod()
     {
         return AliasDereferencingMethod.NEVER;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public IEntry getEntryFromCache( DN dn )
     {
         return null;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public IRootDSE getRootDSE()
     {
         return null;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public Schema getSchema()
     {
         return schema;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public SearchManager getSearchManager()
     {
         return null;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public int getTimeLimit()
     {
         return 0;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public boolean isFetchBaseDNs()
     {
         return false;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public void setBaseDN( DN baseDN )
     {
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public void setCountLimit( int countLimit )
     {
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod
)
     {
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public void setFetchBaseDNs( boolean fetchBaseDNs )
     {
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public void setSchema( Schema schema )
     {
         this.schema = schema;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public void setTimeLimit( int timeLimit )
     {
-
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
     public Object getAdapter( Class adapter )
     {
         return null;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public Object clone()
     {
         return this;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public ModificationLogger getModificationLogger()
     {
         return null;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public ReferralHandlingMethod getReferralsHandlingMethod()
     {
         return ReferralHandlingMethod.IGNORE;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod
)
     {
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public URL getUrl()
     {
         return null;
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
     public Connection getConnection()
     {
         return null;
     }
 
+
+    /** 
+     * {@inheritDoc}
+     */
     public void cacheEntry( IEntry entry )
     {
     }
-    
+
+
+    /** 
+     * {@inheritDoc}
+     */
     public void uncacheEntryRecursive( IEntry entry )
     {
     }

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=588323&r1=588322&r2=588323&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
Thu Oct 25 12:53:52 2007
@@ -66,6 +66,15 @@
     /** The flag if operational attributes should be initialized. */
     private boolean initOperationalAttributes;
 
+    /** The requested attributes when reading the Root DSE. */
+    public static final String[] ROOT_DSE_ATTRIBUTES =
+        { IRootDSE.ROOTDSE_ATTRIBUTE_MONITORCONTEXT, IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS,
+            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDLDAPVERSION, IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY,
+            IRootDSE.ROOTDSE_ATTRIBUTE_ALTSERVER, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION,
+            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES,
+            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDSASLMECHANISM, ISearch.ALL_OPERATIONAL_ATTRIBUTES,
+            ISearch.ALL_USER_ATTRIBUTES };
+
 
     /**
      * Creates a new instance of InitializeAttributesJob.
@@ -285,7 +294,7 @@
 
         // get well-known root DSE attributes, includes + and *
         ISearch search = new Search( null, browserConnection, new DN(), ISearch.FILTER_TRUE,
-            IBrowserConnection.ROOT_DSE_ATTRIBUTES, SearchScope.OBJECT, 0, 0,
+            InitializeAttributesJob.ROOT_DSE_ATTRIBUTES, SearchScope.OBJECT, 0, 0,
             AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, false, false,
             null );
         SearchJob.searchAndUpdateModel( browserConnection, search, monitor );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java?rev=588323&r1=588322&r2=588323&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
Thu Oct 25 12:53:52 2007
@@ -32,28 +32,38 @@
 import org.eclipse.core.runtime.IAdaptable;
 
 
+/**
+ * An IBrowserConnection represents a connection for the LDAP browser.
+ * It holds an instance to the underlying connection of the connection plugin,
+ * additional it includes advanced connection parameters for the LDAP browser. 
+ * It also provides an entry cache.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public interface IBrowserConnection extends Serializable, IAdaptable, ConnectionPropertyPageProvider
 {
 
+    /** The key for the connection parameter "Get Base DNs from Root DSE". */
     public static String CONNECTION_PARAMETER_FETCH_BASE_DNS = "ldapbrowser.fetchBaseDns";
+
+    /** The key for the connection parameter "Base DN". */
     public static String CONNECTION_PARAMETER_BASE_DN = "ldapbrowser.baseDn";
+
+    /** The key for the connection parameter "Count Limit". */
     public static String CONNECTION_PARAMETER_COUNT_LIMIT = "ldapbrowser.countLimit";
+
+    /** The key for the connection parameter "Time Limit". */
     public static String CONNECTION_PARAMETER_TIME_LIMIT = "ldapbrowser.timeLimit";
+
+    /** The key for the connection parameter "Alias Dereferencing". */
     public static String CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD = "ldapbrowser.aliasesDereferencingMethod";
+
+    /** The key for the connection parameter "Referrals Handling". */
     public static String CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD = "ldapbrowser.referralsHandlingMethod";
-    
-    
-    public static final String[] ROOT_DSE_ATTRIBUTES =
-        { IRootDSE.ROOTDSE_ATTRIBUTE_MONITORCONTEXT, IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS,
-            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDLDAPVERSION, IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY,
-            IRootDSE.ROOTDSE_ATTRIBUTE_ALTSERVER, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION,
-            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES,
-            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDSASLMECHANISM, ISearch.ALL_OPERATIONAL_ATTRIBUTES,
-            ISearch.ALL_USER_ATTRIBUTES };
 
-    
     /**
-     * Enum for the used alias dereferencing method.
+     * Enum for alias dereferencing method.
      * 
      * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
      * @version $Rev$, $Date$
@@ -119,7 +129,7 @@
     }
 
     /**
-     * Enum for the used referral handling method.
+     * Enum for referral handling method.
      * 
      * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
      * @version $Rev$, $Date$
@@ -178,58 +188,116 @@
             }
         }
     }
-    
-//    public static final int DEREFERENCE_ALIASES_NEVER = 0;
-//
-//    public static final int DEREFERENCE_ALIASES_ALWAYS = 1;
-//
-//    public static final int DEREFERENCE_ALIASES_FINDING = 2;
-//
-//    public static final int DEREFERENCE_ALIASES_SEARCH = 3;
-//
-//    public static final int HANDLE_REFERRALS_IGNORE = 0;
-//
-//    public static final int HANDLE_REFERRALS_FOLLOW = 1;
 
+    /** The MangageDsaIT control OID. */
     public static final String CONTROL_MANAGEDSAIT = "2.16.840.1.113730.3.4.2"; //$NON-NLS-1$
 
 
+    /**
+     * Gets the URL of this connection.
+     * 
+     * @return the URL of this connection
+     */
     public abstract URL getUrl();
 
 
+    /**
+     * Gets the flag whether the base DNs is retrieved
+     * from Root DSE or whether the base DN is defined manually.
+     * 
+     * @return true, if the base DNs are fetched from Root DSE, 
+     *         false, if the base DN is defined manually
+     */
     public abstract boolean isFetchBaseDNs();
 
 
+    /**
+     * Sets the flag whether the base DNs should be retrieved
+     * from Root DSE or whether the base DN is defined manually.
+     * 
+     * @param fetchBaseDNs true to get the base DNs from Root DSE,
+     *                     false to define one manually
+     */
     public abstract void setFetchBaseDNs( boolean fetchBaseDNs );
 
 
+    /**
+     * Gets the manually defined base DN.
+     * 
+     * @return the manually defined base ND
+     */
     public abstract DN getBaseDN();
 
 
+    /**
+     * Sets the manually defined base DN.
+     * 
+     * @param baseDN the new base DN
+     */
     public abstract void setBaseDN( DN baseDN );
 
 
+    /**
+     * Gets the count limit.
+     * 
+     * @return the count limit
+     */
     public abstract int getCountLimit();
 
 
+    /**
+     * Sets the count limit.
+     * 
+     * @param countLimit the new count limit
+     */
     public abstract void setCountLimit( int countLimit );
 
 
+    /**
+     * Gets the aliases dereferencing method.
+     * 
+     * @return the aliases dereferencing method
+     */
     public abstract AliasDereferencingMethod getAliasesDereferencingMethod();
 
 
+    /**
+     * Sets the aliases dereferencing method.
+     * 
+     * @param aliasesDereferencingMethod the new aliases dereferencing method
+     */
     public abstract void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod
);
 
 
+    /**
+     * Gets the referrals handling method.
+     * 
+     * @return the referrals handling method
+     */
     public abstract ReferralHandlingMethod getReferralsHandlingMethod();
 
 
+    /**
+     * Sets the referrals handling method.
+     * 
+     * @param referralsHandlingMethod the new referrals handling method
+     */
     public abstract void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod
);
 
 
+    /**
+     * Gets the time limit.
+     * 
+     * @return the time limit
+     */
     public abstract int getTimeLimit();
 
 
+    /**
+     * Sets the time limit.
+     * 
+     * @param timeLimit the new time limit
+     */
     public abstract void setTimeLimit( int timeLimit );
 
 
@@ -241,30 +309,76 @@
     public abstract IRootDSE getRootDSE();
 
 
+    /**
+     * Gets the schema.
+     * 
+     * @return the schema, never null
+     */
     public abstract Schema getSchema();
 
 
+    /**
+     * Sets the schema.
+     * 
+     * @param schema the new schema
+     */
     public abstract void setSchema( Schema schema );
 
 
+    /**
+     * Gets the search manager.
+     * 
+     * @return the search manager
+     */
     public abstract SearchManager getSearchManager();
 
 
+    /**
+     * Gets the bookmark manager.
+     * 
+     * @return the bookmark manager
+     */
     public abstract BookmarkManager getBookmarkManager();
 
 
+    /**
+     * Gets the modification logger.
+     * 
+     * @return the modification logger
+     */
     public abstract ModificationLogger getModificationLogger();
 
 
+    /**
+     * Gets the entry from cache.
+     * 
+     * @param dn the DN of the entry
+     * 
+     * @return the entry from cache or null if the entry isn't cached
+     */
     public abstract IEntry getEntryFromCache( DN dn );
 
 
+    /**
+     * Gets the connection.
+     * 
+     * @return the connection
+     */
     public abstract Connection getConnection();
-    
-    public abstract int hashCode();
 
-    public abstract boolean equals( Object obj );
-    
+
+    /**
+     * Puts the entry to the cache.
+     * 
+     * @param entry the entry to cache
+     */
     public void cacheEntry( IEntry entry );
+
+
+    /**
+     * Removes the entry and all children recursively from the cache.
+     * 
+     * @param entry the entry to remove from cache
+     */
     public abstract void uncacheEntryRecursive( IEntry entry );
 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ModelModificationException.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ModelModificationException.java?rev=588323&r1=588322&r2=588323&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ModelModificationException.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ModelModificationException.java
Thu Oct 25 12:53:52 2007
@@ -20,7 +20,7 @@
 
 package org.apache.directory.studio.ldapbrowser.core.model;
 
-
+// TODO: remove ModelModificationException
 public class ModelModificationException extends Exception
 {
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/NameException.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/NameException.java?rev=588323&r1=588322&r2=588323&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/NameException.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/NameException.java
Thu Oct 25 12:53:52 2007
@@ -20,7 +20,7 @@
 
 package org.apache.directory.studio.ldapbrowser.core.model;
 
-
+// TODO: replace by NamingException or InvalidNameException
 public class NameException extends Exception
 {
 



Mime
View raw message