directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r584576 - /directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/
Date Sun, 14 Oct 2007 18:47:39 GMT
Author: seelmann
Date: Sun Oct 14 11:47:38 2007
New Revision: 584576

URL: http://svn.apache.org/viewvc?rev=584576&view=rev
Log:
Renamed AbstractModificationJob to AbstractAttributeModificationJob.

Added:
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java
      - copied, changed from r584575, directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractModificationJob.java
Removed:
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractModificationJob.java
Modified:
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java

Copied: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java
(from r584575, directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractModificationJob.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java?p2=directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java&p1=directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractModificationJob.java&r1=584575&r2=584576&rev=584576&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractModificationJob.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java
Sun Oct 14 11:47:38 2007
@@ -27,24 +27,37 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 
 
-public abstract class AbstractModificationJob extends AbstractNotificationJob
+/**
+ * Base class for jobs that modify attributes of a single entry.
+ * Reloads the modified attributes after modification.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class AbstractAttributeModificationJob extends AbstractNotificationJob
 {
 
-    protected void executeNotificationJob( StudioProgressMonitor pm ) throws ModelModificationException
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob#executeNotificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
+     */
+    protected void executeNotificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
     {
         try
         {
-            this.executeAsyncModificationJob( pm );
+            executeAttributeModificationJob( monitor );
         }
         finally
         {
             // reload affected attributes
-            String[] affectedAttributeNames = getAffectedAttributeNames();
-            InitializeAttributesJob.initializeAttributes( getModifiedEntry(), affectedAttributeNames,
pm );
+            String[] attributeDescriptions = getAffectedAttributeDescriptions();
+            InitializeAttributesJob.initializeAttributes( getModifiedEntry(), attributeDescriptions,
monitor );
         }
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getConnections()
+     */
     protected Connection[] getConnections()
     {
         return new Connection[]
@@ -52,6 +65,9 @@
     }
 
 
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getLockedObjects()
+     */
     protected Object[] getLockedObjects()
     {
         return new Object[]
@@ -59,12 +75,32 @@
     }
 
 
-    protected abstract void executeAsyncModificationJob( StudioProgressMonitor pm ) throws
ModelModificationException;
-
-
+    /**
+     * Execute the attribute modification job.
+     * 
+     * @param monitor the progress monitor
+     * 
+     * @throws ModelModificationException the model modification exception
+     */
+    protected abstract void executeAttributeModificationJob( StudioProgressMonitor monitor
)
+        throws ModelModificationException;
+
+
+    /**
+     * Gets the modified entry.
+     * 
+     * @return the modified entry
+     */
     protected abstract IEntry getModifiedEntry();
 
 
-    protected abstract String[] getAffectedAttributeNames();
+    /**
+     * Gets the affected attribute descriptions.
+     * Implementations must return all attribute descriptions of
+     * added, modified or removed attributes.
+     * 
+     * @return the affected attribute descriptions
+     */
+    protected abstract String[] getAffectedAttributeDescriptions();
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java?rev=584576&r1=584575&r2=584576&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java
Sun Oct 14 11:47:38 2007
@@ -51,7 +51,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class CreateValuesJob extends AbstractModificationJob
+public class CreateValuesJob extends AbstractAttributeModificationJob
 {
 
     /** The entry to modify. */
@@ -94,9 +94,9 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractModificationJob#executeAsyncModificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
+     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#executeAttributeModificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
      */
-    protected void executeAsyncModificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeAttributeModificationJob( StudioProgressMonitor monitor ) throws
ModelModificationException
     {
         monitor.beginTask( valuesToCreate.length == 1 ? BrowserCoreMessages.jobs__create_values_task_1
             : BrowserCoreMessages.jobs__create_values_task_n, 2 );
@@ -124,7 +124,7 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractModificationJob#getModifiedEntry()
+     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#getModifiedEntry()
      */
     protected IEntry getModifiedEntry()
     {
@@ -133,16 +133,16 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractModificationJob#getAffectedAttributeNames()
+     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#getAffectedAttributeDescriptions()
      */
-    protected String[] getAffectedAttributeNames()
+    protected String[] getAffectedAttributeDescriptions()
     {
-        Set<String> affectedAttributeNameSet = new HashSet<String>();
+        Set<String> attributeDescriptionSet = new HashSet<String>();
         for ( IValue value : valuesToCreate )
         {
-            affectedAttributeNameSet.add( value.getAttribute().getDescription() );
+            attributeDescriptionSet.add( value.getAttribute().getDescription() );
         }
-        return affectedAttributeNameSet.toArray( new String[affectedAttributeNameSet.size()]
);
+        return attributeDescriptionSet.toArray( new String[attributeDescriptionSet.size()]
);
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java?rev=584576&r1=584575&r2=584576&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java
Sun Oct 14 11:47:38 2007
@@ -37,7 +37,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 
 
-public class DeleteAttributesValueJob extends AbstractModificationJob
+public class DeleteAttributesValueJob extends AbstractAttributeModificationJob
 {
 
     private IEntry entry;
@@ -86,7 +86,7 @@
     }
 
 
-    protected void executeAsyncModificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeAttributeModificationJob( StudioProgressMonitor monitor ) throws
ModelModificationException
     {
 
         monitor.beginTask( attributes.length + values.length == 1 ? BrowserCoreMessages.jobs__delete_attributes_task_1
@@ -123,7 +123,7 @@
     }
 
 
-    protected String[] getAffectedAttributeNames()
+    protected String[] getAffectedAttributeDescriptions()
     {
         Set affectedAttributeNameSet = new HashSet();
         for ( int i = 0; i < attributes.length; i++ )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java?rev=584576&r1=584575&r2=584576&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java
Sun Oct 14 11:47:38 2007
@@ -32,7 +32,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 
 
-public class ModifyValueJob extends AbstractModificationJob
+public class ModifyValueJob extends AbstractAttributeModificationJob
 {
 
     private IAttribute attribute;
@@ -53,7 +53,7 @@
     }
 
 
-    protected void executeAsyncModificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeAttributeModificationJob( StudioProgressMonitor monitor ) throws
ModelModificationException
     {
 
         monitor.beginTask( BrowserCoreMessages.jobs__modify_value_task, 2 );
@@ -75,7 +75,7 @@
     }
 
 
-    protected String[] getAffectedAttributeNames()
+    protected String[] getAffectedAttributeDescriptions()
     {
         return new String[]
             { this.attribute.getDescription() };

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java?rev=584576&r1=584575&r2=584576&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java
Sun Oct 14 11:47:38 2007
@@ -44,7 +44,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class RenameValuesJob extends AbstractModificationJob
+public class RenameValuesJob extends AbstractAttributeModificationJob
 {
 
     /** The entry to modify. */
@@ -79,9 +79,9 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractModificationJob#executeAsyncModificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
+     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#executeAttributeModificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
      */
-    protected void executeAsyncModificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeAttributeModificationJob( StudioProgressMonitor monitor ) throws
ModelModificationException
     {
         monitor.beginTask( oldValues.length == 1 ? BrowserCoreMessages.jobs__rename_value_task_1
             : BrowserCoreMessages.jobs__rename_value_task_n, 2 );
@@ -121,7 +121,7 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractModificationJob#getModifiedEntry()
+     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#getModifiedEntry()
      */
     protected IEntry getModifiedEntry()
     {
@@ -130,17 +130,17 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractModificationJob#getAffectedAttributeNames()
+     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#getAffectedAttributeDescriptions()
      */
-    protected String[] getAffectedAttributeNames()
+    protected String[] getAffectedAttributeDescriptions()
     {
-        Set<String> affectedAttributeNameSet = new HashSet<String>();
-        affectedAttributeNameSet.add( newAttributeDescription );
+        Set<String> attributeDescriptionSet = new HashSet<String>();
+        attributeDescriptionSet.add( newAttributeDescription );
         for ( IValue oldValue : oldValues )
         {
-            affectedAttributeNameSet.add( oldValue.getAttribute().getDescription() );
+            attributeDescriptionSet.add( oldValue.getAttribute().getDescription() );
         }
-        return affectedAttributeNameSet.toArray( new String[affectedAttributeNameSet.size()]
);
+        return attributeDescriptionSet.toArray( new String[attributeDescriptionSet.size()]
);
     }
 
 



Mime
View raw message