mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-16 10:48:47 +00:00
bug6242: integrate 6239 to count Drop connections
This commit is contained in:
+4
-9
@@ -58,7 +58,6 @@ public class ReplicationPanel extends FlowPanel {
|
||||
private final StringMessages stringMessages;
|
||||
private final Button addButton;
|
||||
private final Button stopReplicationButton;
|
||||
private final Button dropReplicasButton;
|
||||
|
||||
private static class ReplicationData {
|
||||
private final String messagingHost;
|
||||
@@ -154,14 +153,9 @@ public class ReplicationPanel extends FlowPanel {
|
||||
replicasTable = new ReplicaTableWrapper(tableResources, userService, stringMessages, errorReporter);
|
||||
replicaSelectionModel = replicasTable.getSelectionModel();
|
||||
final AccessControlledButtonPanel masterPanelButtons = new AccessControlledButtonPanel(userService, SecuredSecurityTypes.SERVER);
|
||||
dropReplicasButton = masterPanelButtons.addAction(stringMessages.dropReplicas(),
|
||||
() -> userService.hasServerPermission(ServerActions.REPLICATE), this::dropSelectedReplicas);
|
||||
dropReplicasButton.setEnabled(false);
|
||||
replicaSelectionModel.addSelectionChangeHandler(event -> {
|
||||
final int count = replicaSelectionModel.getSelectedSet().size();
|
||||
dropReplicasButton.setText(count > 0 ? stringMessages.dropReplicas() + " (" + count + ")" : stringMessages.dropReplicas());
|
||||
dropReplicasButton.setEnabled(count > 0 && userService.hasServerPermission(ServerActions.REPLICATE));
|
||||
});
|
||||
masterPanelButtons.addCountingAction(stringMessages.dropReplicas(),
|
||||
replicaSelectionModel, () -> userService.hasServerPermission(ServerActions.REPLICATE),
|
||||
this::dropSelectedReplicas);
|
||||
masterpanel.add(replicasTable.asWidget());
|
||||
masterpanel.add(masterPanelButtons);
|
||||
mastergroup.add(masterpanel);
|
||||
@@ -285,6 +279,7 @@ public class ReplicationPanel extends FlowPanel {
|
||||
*/
|
||||
private void dropSelectedReplicas() {
|
||||
final Set<ReplicaDTO> selected = new HashSet<>(replicaSelectionModel.getSelectedSet());
|
||||
replicaSelectionModel.clear();
|
||||
for (final ReplicaDTO replica : selected) {
|
||||
dropSingleReplica(replica);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@ import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
import com.sap.sse.common.Named;
|
||||
|
||||
public class ReplicaDTO implements IsSerializable {
|
||||
public class ReplicaDTO implements IsSerializable, Named {
|
||||
private String hostname;
|
||||
private String identifier;
|
||||
private Date registrationTime;
|
||||
@@ -33,6 +34,10 @@ public class ReplicaDTO implements IsSerializable {
|
||||
this.averageMessageSizeInBytes = averageMessageSizeInBytes;
|
||||
this.totalNumberOfBytesSent = totalNumberOfBytesSent;
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return hostname;
|
||||
}
|
||||
public String getHostname() {
|
||||
return hostname;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user