java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/client/LandscapeManagementPanel.java
... ...
@@ -39,6 +39,7 @@ import com.sap.sailing.landscape.ui.client.CreateApplicationReplicaSetDialog.Cre
39 39
import com.sap.sailing.landscape.ui.client.MoveMasterProcessDialog.MoveMasterToOtherInstanceInstructions;
40 40
import com.sap.sailing.landscape.ui.client.SwitchToReplicaOnSharedInstanceDialog.SwitchToReplicaOnSharedInstanceDialogInstructions;
41 41
import com.sap.sailing.landscape.ui.client.UpgradeApplicationReplicaSetDialog.UpgradeApplicationReplicaSetInstructions;
42
+import com.sap.sailing.landscape.ui.client.UpgradeArchiveServerDialog.UpgradeArchiveServerInstructions;
42 43
import com.sap.sailing.landscape.ui.client.i18n.StringMessages;
43 44
import com.sap.sailing.landscape.ui.shared.AmazonMachineImageDTO;
44 45
import com.sap.sailing.landscape.ui.shared.AvailabilityZoneDTO;
... ...
@@ -1466,13 +1467,18 @@ public class LandscapeManagementPanel extends SimplePanel {
1466 1467
1467 1468
@Override
1468 1469
public void onSuccess(ArrayList<ReleaseDTO> result) {
1469
- new UpgradeApplicationReplicaSetDialog(landscapeManagementService, result.stream().map(r->r.getName())::iterator,
1470
- stringMessages, errorReporter, new DialogCallback<UpgradeApplicationReplicaSetDialog.UpgradeApplicationReplicaSetInstructions>() {
1470
+ new UpgradeArchiveServerDialog(landscapeManagementService, result.stream().map(r->r.getName())::iterator,
1471
+ stringMessages, errorReporter, new DialogCallback<UpgradeArchiveServerDialog.UpgradeArchiveServerInstructions>() {
1471 1472
@Override
1472
- public void ok(UpgradeApplicationReplicaSetInstructions upgradeInstructions) {
1473
+ public void ok(UpgradeArchiveServerInstructions upgradeInstructions) {
1473 1474
final int[] howManyMoreToGo = new int[] { Util.size(replicaSets) };
1474 1475
for (final SailingApplicationReplicaSetDTO<String> replicaSet : replicaSets) {
1475
- landscapeManagementService.startArchiveServer(replicaSet, replicaSet.getName(),
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(),
1476 1482
new AsyncCallback<SailingApplicationReplicaSetDTO<String>>() {
1477 1483
@Override
1478 1484
public void onFailure(Throwable caught) {
java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/client/LandscapeManagementWriteService.java
... ...
@@ -167,7 +167,9 @@ public interface LandscapeManagementWriteService extends RemoteService {
167 167
String optionalKeyName, byte[] privateKeyEncryptionPassphrase) throws Exception;
168 168
169 169
SailingApplicationReplicaSetDTO<String> startArchiveServer(
170
- SailingApplicationReplicaSetDTO<String> replicaSet, String replicaSetName) throws Exception;
170
+ String regionId,
171
+ SailingApplicationReplicaSetDTO<String> applicationReplicaSetToUpgrade, String releaseOrNullForLatestMaster,
172
+ String optionalKeyName, byte[] privateKeyEncryptionPassphrase, String replicationBearerToken) throws Exception;
171 173
172 174
ArrayList<LeaderboardNameDTO> getLeaderboardNames(SailingApplicationReplicaSetDTO<String> replicaSet, String bearerToken) throws Exception;
173 175
java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/client/LandscapeManagementWriteServiceAsync.java
... ...
@@ -190,7 +190,10 @@ public interface LandscapeManagementWriteServiceAsync {
190 190
AwsInstanceDTO optionalPreferredInstanceToDeployUnmanagedReplicaTo,
191 191
AsyncCallback<SailingApplicationReplicaSetDTO<String>> callback);
192 192
193
- void startArchiveServer(SailingApplicationReplicaSetDTO<String> replicaSet, String replicaSetName, AsyncCallback<SailingApplicationReplicaSetDTO<String>> callback);
193
+ void startArchiveServer(String regionId,
194
+ SailingApplicationReplicaSetDTO<String> applicationReplicaSetToUpgrade, String releaseOrNullForLatestMaster,
195
+ String optionalKeyName, byte[] privateKeyEncryptionPassphrase, String replicationBearerToken,
196
+ AsyncCallback<SailingApplicationReplicaSetDTO<String>> callback);
194 197
195 198
/**
196 199
* For the given replica set ensures there is at least one healthy replica, then stops replicating on all replicas and
java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/client/UpgradeArchiveServerDialog.java
... ...
@@ -0,0 +1,59 @@
1
+package com.sap.sailing.landscape.ui.client;
2
+
3
+import com.google.gwt.user.client.ui.FocusWidget;
4
+import com.google.gwt.user.client.ui.Grid;
5
+import com.google.gwt.user.client.ui.Label;
6
+import com.google.gwt.user.client.ui.ListBox;
7
+import com.google.gwt.user.client.ui.Widget;
8
+import com.sap.sailing.landscape.common.SharedLandscapeConstants;
9
+import com.sap.sailing.landscape.ui.client.i18n.StringMessages;
10
+import com.sap.sse.gwt.client.ErrorReporter;
11
+
12
+public class UpgradeArchiveServerDialog extends AbstractApplicationReplicaSetDialog<UpgradeArchiveServerDialog.UpgradeArchiveServerInstructions> {
13
+
14
+ public static class UpgradeArchiveServerInstructions extends AbstractApplicationReplicaSetDialog.AbstractApplicationReplicaSetInstructions {
15
+ public UpgradeArchiveServerInstructions(String releaseNameOrNullForLatestMaster, String masterReplicationBearerToken, String replicaReplicationBearerToken, String optionalSharedInstanceType) {
16
+ super(releaseNameOrNullForLatestMaster, masterReplicationBearerToken, replicaReplicationBearerToken);
17
+ }
18
+ }
19
+
20
+ private final StringMessages stringMessages;
21
+ private final ListBox sharedInstanceTypeListBox;
22
+
23
+ public UpgradeArchiveServerDialog(LandscapeManagementWriteServiceAsync landscapeManagementService, Iterable<String> releaseNames,
24
+ StringMessages stringMessages, ErrorReporter errorReporter, DialogCallback<UpgradeArchiveServerInstructions> callback) {
25
+ super(stringMessages.upgradeApplicationReplicaSet(), landscapeManagementService, releaseNames, stringMessages, errorReporter, /* validator */ null, callback);
26
+ this.stringMessages = stringMessages;
27
+ sharedInstanceTypeListBox = LandscapeDialogUtil.createInstanceTypeListBox(this, landscapeManagementService,
28
+ stringMessages, SharedLandscapeConstants.DEFAULT_SHARED_INSTANCE_TYPE_NAME, errorReporter, /* canBeDeployedInNlbInstanceBasedTargetGroup */ false);
29
+
30
+ }
31
+
32
+ protected ListBox getSharedInstanceTypeListBox() {
33
+ return sharedInstanceTypeListBox;
34
+ }
35
+
36
+ @Override
37
+ protected Widget getAdditionalWidget() {
38
+ final Grid result = new Grid(3, 2);
39
+ int row=0;
40
+ result.setWidget(row, 0, new Label(stringMessages.release()));
41
+ result.setWidget(row++, 1, getReleaseNameBox());
42
+ result.setWidget(row, 0, new Label(stringMessages.instanceType()));
43
+ result.setWidget(row++, 1, getSharedInstanceTypeListBox());
44
+ result.setWidget(row, 0, new Label(stringMessages.replicaReplicationBearerToken()));
45
+ result.setWidget(row++, 1, getReplicaReplicationBearerTokenBox());
46
+ return result;
47
+ }
48
+
49
+ @Override
50
+ public FocusWidget getInitialFocusWidget() {
51
+ return getReleaseNameBox().getValueBox();
52
+ }
53
+
54
+ @Override
55
+ protected UpgradeArchiveServerInstructions getResult() {
56
+ return new UpgradeArchiveServerInstructions(getReleaseNameBoxValue(), getMasterReplicationBearerTokenBox().getValue(),
57
+ getReplicaReplicationBearerTokenBox().getValue(), getSharedInstanceTypeListBox().getSelectedValue());
58
+ }
59
+}
java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/server/LandscapeManagementWriteServiceImpl.java
... ...
@@ -677,8 +677,15 @@ public class LandscapeManagementWriteServiceImpl extends ResultCachingProxiedRem
677 677
}
678 678
679 679
@Override
680
- public SailingApplicationReplicaSetDTO<String> startArchiveServer(SailingApplicationReplicaSetDTO<String> replicaSet, String replicaSetName) throws Exception {
681
- logger.info(replicaSet.getName());
680
+ public SailingApplicationReplicaSetDTO<String> startArchiveServer(String regionId,
681
+ SailingApplicationReplicaSetDTO<String> applicationReplicaSetToUpgrade, String releaseOrNullForLatestMaster,
682
+ String optionalKeyName, byte[] privateKeyEncryptionPassphrase, String replicationBearerToken) throws Exception {
683
+ checkLandscapeManageAwsPermission();
684
+ logger.info(applicationReplicaSetToUpgrade.getName());
685
+ getLandscapeService().createApplicationReplicaSet(
686
+ regionId, optionalKeyName, true, replicationBearerToken, regionId, false, releaseOrNullForLatestMaster,
687
+ optionalKeyName, privateKeyEncryptionPassphrase, replicationBearerToken, replicationBearerToken, replicationBearerToken,
688
+ null, null, null, null, null);
682 689
return null;
683 690
}
684 691