Lior Vernia has uploaded a new change for review.

Change subject: webadmin: Aggregate errors by default in runMultipleActions()
......................................................................

webadmin: Aggregate errors by default in runMultipleActions()

Changed the default calls to aggregate errors. Although this
potentially affects several existing invocations, most of them provide
a failure callback of their own and so render this argument
irrelevant.

The ones that are affected are SanStorageModelBase.connectTargets()
and NewDiskModel.onAttachDisks(), where it seemed to me that the
desireable behavior would indeed be to aggregate multiple errors if
they are returned.

Also corrected the Javadoc for some overloads in Frontend.

Change-Id: I423a737888a3b3ec6bb492d8eaf825d9cce9872c
Signed-off-by: Lior Vernia <lver...@redhat.com>
---
M 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java
2 files changed, 12 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/16/28216/1

diff --git 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
index ce71f8e..37f64ad 100644
--- 
a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
+++ 
b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
@@ -603,7 +603,7 @@
 
     /**
      * A convenience method that calls {@link 
#runMultipleActions(VdcActionType, List, List, Object, boolean)} with just a 
single
-     * callback to be called when all actions have succeeded and no error 
aggregation.
+     * callback to be called when all actions have succeeded and error 
aggregation.
      *
      * @param actionType The action to be repeated.
      * @param parameters The parameters of each action.
@@ -629,11 +629,11 @@
         runMultipleActions(actionType, parameters,
                 new 
LinkedList<IFrontendActionAsyncCallback>(Arrays.asList(callbacks)),
                 state,
-                false);
+                true);
     }
 
     /**
-     * A convenience method that calls {@link 
#runMultipleActions(VdcActionType, List, List, Object)} with
+     * A convenience method that calls {@link 
#runMultipleActions(VdcActionType, List, IFrontendActionAsyncCallback, Object, 
boolean)}
      * running callbacks even on empty run.
      *
      * @param actionType The action to be repeated.
@@ -650,7 +650,7 @@
 
     /**
      * Overloaded method for {@link #runMultipleActions(VdcActionType, List, 
IFrontendActionAsyncCallback, Object, boolean)} with
-     * state = null.
+     * state = null and running callbacks even on empty run.
      * @param actionType The action type of the actions.
      * @param parameters A list of parameters, once for each action.
      * @param successCallback The callback to call on success.
@@ -692,21 +692,22 @@
     }
 
     /**
-     * Overloaded method for {@link #runMultipleActions(VdcActionType, List, 
List, Object, boolean)} with state = null.
+     * Overloaded method for {@link #runMultipleActions(VdcActionType, List, 
List, Object, boolean)} with state = null
+     * and error aggregation.
+     *
      * @param actionType The action to be repeated.
      * @param parameters The parameters of each action.
      * @param callbacks A list of callbacks.
      */
     public void runMultipleActions(final VdcActionType actionType,
             final List<VdcActionParametersBase> parameters,
-            final List<IFrontendActionAsyncCallback> callbacks,
-            final boolean aggregateErrors) {
-        runMultipleActions(actionType, parameters, callbacks, null, 
aggregateErrors);
+            final List<IFrontendActionAsyncCallback> callbacks) {
+        runMultipleActions(actionType, parameters, callbacks, null, true);
     }
 
     /**
      * Overloaded method for
-     * {@link #runMultipleActions(List, List, List, 
IFrontendActionAsyncCallback, Object, boolean, List)} without error
+     * {@link #runMultipleActions(List, List, List, 
IFrontendActionAsyncCallback, Object, boolean)} with error
      * message aggregation.
      */
     public void runMultipleActions(final List<VdcActionType> actionTypes,
@@ -714,7 +715,7 @@
             final List<IFrontendActionAsyncCallback> callbacks,
             final IFrontendActionAsyncCallback failureCallback,
             final Object state) {
-        runMultipleActions(actionTypes, parameters, callbacks, 
failureCallback, state, false);
+        runMultipleActions(actionTypes, parameters, callbacks, 
failureCallback, state, true);
     }
 
     /**
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java
index 4d25e3c..b1cc8f4 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/networks/ImportNetworksModel.java
@@ -225,7 +225,7 @@
             });
         }
 
-        Frontend.getInstance().runMultipleActions(VdcActionType.AddNetwork, 
multipleActionParameters, callbacks, true);
+        Frontend.getInstance().runMultipleActions(VdcActionType.AddNetwork, 
multipleActionParameters, callbacks);
         cancel();
     }
 


-- 
To view, visit http://gerrit.ovirt.org/28216
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I423a737888a3b3ec6bb492d8eaf825d9cce9872c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <lver...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to