java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/client/LandscapeManagementPanel.java
... ...
@@ -326,8 +326,8 @@ public class LandscapeManagementPanel extends SimplePanel {
326 326
applicationReplicaSetsActionColumn.addAction(ApplicationReplicaSetsImagesBarCell.ACTION_UPGRADE,
327 327
applicationReplicaSetToUpgrade -> {
328 328
if (applicationReplicaSetToUpgrade.isArchive()) {
329
- upgradeArchiveReplicaSet(stringMessages,
330
- regionsTable.getSelectionModel().getSelectedObject(), Collections.singleton(applicationReplicaSetToUpgrade));
329
+ upgradeArchiveServer(stringMessages,
330
+ regionsTable.getSelectionModel().getSelectedObject(), applicationReplicaSetToUpgrade);
331 331
} else {
332 332
upgradeApplicationReplicaSet(stringMessages,
333 333
regionsTable.getSelectionModel().getSelectedObject(), Collections.singleton(applicationReplicaSetToUpgrade));
... ...
@@ -1457,8 +1457,8 @@ public class LandscapeManagementPanel extends SimplePanel {
1457 1457
});
1458 1458
}
1459 1459
1460
- private void upgradeArchiveReplicaSet(StringMessages stringMessages, String regionId,
1461
- Iterable<SailingApplicationReplicaSetDTO<String>> replicaSets) {
1460
+ private void upgradeArchiveServer(StringMessages stringMessages, String regionId,
1461
+ SailingApplicationReplicaSetDTO<String> replicaSet) {
1462 1462
landscapeManagementService.getReleases(new AsyncCallback<ArrayList<ReleaseDTO>>() {
1463 1463
@Override
1464 1464
public void onFailure(Throwable caught) {
... ...
@@ -1471,36 +1471,31 @@ public class LandscapeManagementPanel extends SimplePanel {
1471 1471
stringMessages, errorReporter, new DialogCallback<UpgradeArchiveServerDialog.UpgradeArchiveServerInstructions>() {
1472 1472
@Override
1473 1473
public void ok(UpgradeArchiveServerInstructions upgradeInstructions) {
1474
- final int[] howManyMoreToGo = new int[] { Util.size(replicaSets) };
1475
- for (final SailingApplicationReplicaSetDTO<String> replicaSet : replicaSets) {
1476
- landscapeManagementService.startArchiveServer(regionId, replicaSet,
1477
- upgradeInstructions.getReleaseNameOrNullForLatestMaster(),
1478
- sshKeyManagementPanel.getSelectedKeyPair()==null?null:sshKeyManagementPanel.getSelectedKeyPair().getName(),
1479
- sshKeyManagementPanel.getPassphraseForPrivateKeyDecryption() != null
1480
- ? sshKeyManagementPanel.getPassphraseForPrivateKeyDecryption().getBytes() : null,
1481
- upgradeInstructions.getReplicaReplicationBearerToken(),
1482
- new AsyncCallback<SailingApplicationReplicaSetDTO<String>>() {
1483
- @Override
1484
- public void onFailure(Throwable caught) {
1485
- decrementHowManyMoreToGoAndSetNonBusyIfDone(howManyMoreToGo);
1486
- errorReporter.reportError(caught.getMessage());
1487
- }
1474
+ landscapeManagementService.startArchiveServer(regionId, replicaSet,
1475
+ upgradeInstructions.getReleaseNameOrNullForLatestMaster(),
1476
+ sshKeyManagementPanel.getSelectedKeyPair()==null?null:sshKeyManagementPanel.getSelectedKeyPair().getName(),
1477
+ sshKeyManagementPanel.getPassphraseForPrivateKeyDecryption() != null
1478
+ ? sshKeyManagementPanel.getPassphraseForPrivateKeyDecryption().getBytes() : null,
1479
+ upgradeInstructions.getReplicaReplicationBearerToken(),
1480
+ new AsyncCallback<SailingApplicationReplicaSetDTO<String>>() {
1481
+ @Override
1482
+ public void onFailure(Throwable caught) {
1483
+ errorReporter.reportError(caught.getMessage());
1484
+ }
1488 1485
1489
- @Override
1490
- public void onSuccess(SailingApplicationReplicaSetDTO<String> result) {
1491
- decrementHowManyMoreToGoAndSetNonBusyIfDone(howManyMoreToGo);
1492
- if (result != null) {
1493
- Notification.notify(stringMessages.successfullyUpgradedApplicationReplicaSet(
1494
- result.getName(), result.getVersion()), NotificationType.SUCCESS);
1495
- applicationReplicaSetsTable.replaceBasedOnEntityIdentityComparator(result);
1496
- applicationReplicaSetsTable.refresh();
1497
- } else {
1498
- Notification.notify(stringMessages.upgradingApplicationReplicaSetFailed(replicaSet.getName()),
1499
- NotificationType.ERROR);
1500
- }
1486
+ @Override
1487
+ public void onSuccess(SailingApplicationReplicaSetDTO<String> result) {
1488
+ if (result != null) {
1489
+ Notification.notify(stringMessages.successfullyUpgradedApplicationReplicaSet(
1490
+ result.getName(), result.getVersion()), NotificationType.SUCCESS);
1491
+ applicationReplicaSetsTable.replaceBasedOnEntityIdentityComparator(result);
1492
+ applicationReplicaSetsTable.refresh();
1493
+ } else {
1494
+ Notification.notify(stringMessages.upgradingApplicationReplicaSetFailed(replicaSet.getName()),
1495
+ NotificationType.ERROR);
1501 1496
}
1502
- });
1503
- }
1497
+ }
1498
+ });
1504 1499
}
1505 1500
1506 1501
@Override