From 540becdb357cb647920ac72914d701f5933f4fd2 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Fri, 12 May 2017 16:57:29 +0200 Subject: [PATCH] only CR/LF changes Change-Id: I77ca9b927b7bb875e831d0b3203791650f0edb8c --- java/com.sap.sailing.xmlexport.test/pom.xml | 24 +- java/com.sap.sailing.xmlexport/pom.xml | 24 +- .../pom.xml | 24 +- java/com.sap.sailing.xrr.resultimport/pom.xml | 24 +- .../pom.xml | 24 +- .../pom.xml | 24 +- java/com.sap.sse.feature.runtime/pom.xml | 30 +- java/com.sap.sse.feature/pom.xml | 30 +- java/com.sap.sse.gwt.adminconsole/pom.xml | 72 +- .../gwt/adminconsole/ReplicationPanel.java | 818 +++++++++--------- java/com.sap.sse.gwt/pom.xml | 64 +- .../gwt/shared/replication/ReplicaDTO.java | 116 +-- .../replication/ReplicationMasterDTO.java | 102 +-- .../replication/ReplicationStateDTO.java | 80 +- java/com.sap.sse.mongodb/pom.xml | 24 +- .../pom.xml | 24 +- .../pom.xml | 24 +- java/com.sap.sse.replication/pom.xml | 24 +- java/com.sap.sse.threadmanager/pom.xml | 24 +- java/org.moxieapps.gwt.highcharts/pom.xml | 66 +- 20 files changed, 821 insertions(+), 821 deletions(-) diff --git a/java/com.sap.sailing.xmlexport.test/pom.xml b/java/com.sap.sailing.xmlexport.test/pom.xml index db243b10b74..b01df11e24d 100644 --- a/java/com.sap.sailing.xmlexport.test/pom.xml +++ b/java/com.sap.sailing.xmlexport.test/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sailing.xmlexport.test - eclipse-test-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sailing.xmlexport.test + eclipse-test-plugin + diff --git a/java/com.sap.sailing.xmlexport/pom.xml b/java/com.sap.sailing.xmlexport/pom.xml index 3ab1bc72570..360669dbc89 100644 --- a/java/com.sap.sailing.xmlexport/pom.xml +++ b/java/com.sap.sailing.xmlexport/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sailing.xmlexport - eclipse-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sailing.xmlexport + eclipse-plugin + diff --git a/java/com.sap.sailing.xrr.resultimport.test/pom.xml b/java/com.sap.sailing.xrr.resultimport.test/pom.xml index 7b8f8e80938..ba6cbc402ca 100644 --- a/java/com.sap.sailing.xrr.resultimport.test/pom.xml +++ b/java/com.sap.sailing.xrr.resultimport.test/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sailing.xrr.resultimport.test - eclipse-test-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sailing.xrr.resultimport.test + eclipse-test-plugin + diff --git a/java/com.sap.sailing.xrr.resultimport/pom.xml b/java/com.sap.sailing.xrr.resultimport/pom.xml index 662e02dbfce..f472c04d334 100644 --- a/java/com.sap.sailing.xrr.resultimport/pom.xml +++ b/java/com.sap.sailing.xrr.resultimport/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sailing.xrr.resultimport - eclipse-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sailing.xrr.resultimport + eclipse-plugin + diff --git a/java/com.sap.sailing.yachtscoring.resultimport.test/pom.xml b/java/com.sap.sailing.yachtscoring.resultimport.test/pom.xml index 2a494762480..89082a85bb4 100644 --- a/java/com.sap.sailing.yachtscoring.resultimport.test/pom.xml +++ b/java/com.sap.sailing.yachtscoring.resultimport.test/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sailing.yachtscoring.resultimport.test - eclipse-test-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sailing.yachtscoring.resultimport.test + eclipse-test-plugin + diff --git a/java/com.sap.sailing.yachtscoring.resultimport/pom.xml b/java/com.sap.sailing.yachtscoring.resultimport/pom.xml index 8fd6652067b..79c156d6ad6 100644 --- a/java/com.sap.sailing.yachtscoring.resultimport/pom.xml +++ b/java/com.sap.sailing.yachtscoring.resultimport/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sailing.yachtscoring.resultimport - eclipse-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sailing.yachtscoring.resultimport + eclipse-plugin + diff --git a/java/com.sap.sse.feature.runtime/pom.xml b/java/com.sap.sse.feature.runtime/pom.xml index 27cb27a002c..1c5470b6ae1 100644 --- a/java/com.sap.sse.feature.runtime/pom.xml +++ b/java/com.sap.sse.feature.runtime/pom.xml @@ -1,15 +1,15 @@ - - - - 4.0.0 - - - com.sap.sailing - root - 1.0.0-SNAPSHOT - - - com.sap.sse.feature.runtime - eclipse-feature - + + + + 4.0.0 + + + com.sap.sailing + root + 1.0.0-SNAPSHOT + + + com.sap.sse.feature.runtime + eclipse-feature + diff --git a/java/com.sap.sse.feature/pom.xml b/java/com.sap.sse.feature/pom.xml index 54a33e86098..15418d66f91 100644 --- a/java/com.sap.sse.feature/pom.xml +++ b/java/com.sap.sse.feature/pom.xml @@ -1,15 +1,15 @@ - - - - 4.0.0 - - - com.sap.sailing - root - 1.0.0-SNAPSHOT - - - com.sap.sse.feature - eclipse-feature - + + + + 4.0.0 + + + com.sap.sailing + root + 1.0.0-SNAPSHOT + + + com.sap.sse.feature + eclipse-feature + diff --git a/java/com.sap.sse.gwt.adminconsole/pom.xml b/java/com.sap.sse.gwt.adminconsole/pom.xml index 85234082b61..68427df7a45 100755 --- a/java/com.sap.sse.gwt.adminconsole/pom.xml +++ b/java/com.sap.sse.gwt.adminconsole/pom.xml @@ -1,36 +1,36 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sse.gwt.adminconsole - eclipse-plugin - - - - - org.eclipse.tycho - tycho-compiler-plugin - ${tycho-version} - - - org.eclipse.tycho - tycho-source-plugin - ${tycho-version} - - - plugin-source - generate-sources - - plugin-source - - - - - - - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sse.gwt.adminconsole + eclipse-plugin + + + + + org.eclipse.tycho + tycho-compiler-plugin + ${tycho-version} + + + org.eclipse.tycho + tycho-source-plugin + ${tycho-version} + + + plugin-source + generate-sources + + plugin-source + + + + + + + diff --git a/java/com.sap.sse.gwt.adminconsole/src/com/sap/sse/gwt/adminconsole/ReplicationPanel.java b/java/com.sap.sse.gwt.adminconsole/src/com/sap/sse/gwt/adminconsole/ReplicationPanel.java index 6bf51cef680..8a708584aa9 100755 --- a/java/com.sap.sse.gwt.adminconsole/src/com/sap/sse/gwt/adminconsole/ReplicationPanel.java +++ b/java/com.sap.sse.gwt.adminconsole/src/com/sap/sse/gwt/adminconsole/ReplicationPanel.java @@ -1,409 +1,409 @@ -package com.sap.sse.gwt.adminconsole; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.google.gwt.user.client.ui.Button; -import com.google.gwt.user.client.ui.CaptionPanel; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.FocusWidget; -import com.google.gwt.user.client.ui.Grid; -import com.google.gwt.user.client.ui.HTML; -import com.google.gwt.user.client.ui.HorizontalPanel; -import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.TextBox; -import com.google.gwt.user.client.ui.VerticalPanel; -import com.google.gwt.user.client.ui.Widget; -import com.sap.sse.common.Util; -import com.sap.sse.gwt.client.ErrorReporter; -import com.sap.sse.gwt.client.async.MarkedAsyncCallback; -import com.sap.sse.gwt.client.controls.IntegerBox; -import com.sap.sse.gwt.client.dialog.DataEntryDialog; -import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback; -import com.sap.sse.gwt.client.replication.RemoteReplicationServiceAsync; -import com.sap.sse.gwt.shared.replication.ReplicaDTO; -import com.sap.sse.gwt.shared.replication.ReplicationMasterDTO; -import com.sap.sse.gwt.shared.replication.ReplicationStateDTO; - -/** - * Allows administrators to manage all aspects of server instance replication such as showing whether the instance - * is a master or a replica and for a master showing the replicas to which the master is currently replicating. - * - * @author Axel Uhl (D043530) - * - */ -public class ReplicationPanel extends FlowPanel { - private final Grid registeredReplicas; - private final Grid registeredMasters; - - private final RemoteReplicationServiceAsync replicationServiceAsync; - private final ErrorReporter errorReporter; - private final StringMessages stringMessages; - - private final Button addButton; - private final Button stopReplicationButton; - private final Button removeAllReplicas; - - /** - * For administrators it is important to understand whether an instance is a replica. A - * {@link ErrorReporter#reportPersistentInformation(String) persistent error message} shall be shown - * in this case; however, some replicables may not be considered part of the "domain-based" replication. - * For example, if only a security service for user management is replicated in order to implement - * central user and session management then this shall not lead to the warning being displayed. - * This set contains the stringified IDs of those replicables for which being a replica shall - * lead to a warnings. - */ - private final Set replicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica; - - public ReplicationPanel(RemoteReplicationServiceAsync replicationService, ErrorReporter errorReporter, final StringMessages stringMessages) { - this.replicationServiceAsync = replicationService; - this.stringMessages = stringMessages; - this.errorReporter = errorReporter; - this.replicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica = new HashSet<>(); - replicationService.getReplicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica(new MarkedAsyncCallback<>(new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - GWT.log(stringMessages.errorFetchingReplicaData(caught.getMessage())); - } - - @Override - public void onSuccess(String[] result) { - for (final String replicableIdAsStringThatShallLeadToWarningAboutInstanceBeingReplica : result) { - replicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica.add(replicableIdAsStringThatShallLeadToWarningAboutInstanceBeingReplica); - } - } - })); - - Button refreshButton = new Button(stringMessages.refresh()); - refreshButton.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - updateReplicaList(); - } - }); - add(refreshButton); - - final CaptionPanel mastergroup = new CaptionPanel(stringMessages.explainReplicasRegistered()); - final VerticalPanel masterpanel = new VerticalPanel(); - - registeredReplicas = new Grid(); - registeredReplicas.resizeColumns(3); - masterpanel.add(registeredReplicas); - - removeAllReplicas = new Button(stringMessages.stopAllReplicas()); - removeAllReplicas.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - stopAllReplicas(); - }; - }); - removeAllReplicas.setEnabled(false); - masterpanel.add(removeAllReplicas); - - mastergroup.add(masterpanel); - add(mastergroup); - - final CaptionPanel replicagroup = new CaptionPanel(stringMessages.explainConnectionsToMaster()); - final VerticalPanel replicapanel = new VerticalPanel(); - final HorizontalPanel replicapanelbuttons = new HorizontalPanel(); - - registeredMasters = new Grid(); - registeredMasters.resizeColumns(3); - replicapanel.add(registeredMasters); - - addButton = new Button(stringMessages.connectToMaster()); - addButton.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - addReplication(); - } - }); - replicapanelbuttons.add(addButton); - stopReplicationButton = new Button(stringMessages.stopConnectionToMaster()); - stopReplicationButton.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - stopReplication(); - }; - }); - stopReplicationButton.setEnabled(false); - replicapanelbuttons.add(stopReplicationButton); - - replicapanel.add(replicapanelbuttons); - replicagroup.add(replicapanel); - add(replicagroup); - - updateReplicaList(); - } - - protected void stopAllReplicas() { - replicationServiceAsync.stopAllReplicas(new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - errorReporter.reportError(caught.getMessage()); - updateReplicaList(); - } - @Override - public void onSuccess(Void result) { - removeAllReplicas.setEnabled(false); - updateReplicaList(); - } - }); - } - - private void stopReplication() { - stopReplicationButton.setEnabled(false); - replicationServiceAsync.stopReplicatingFromMaster(new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - errorReporter.reportError(caught.getMessage()); - stopReplicationButton.setEnabled(true); - } - @Override - public void onSuccess(Void result) { - addButton.setEnabled(true); - stopReplicationButton.setEnabled(false); - updateReplicaList(); - } - }); - } - - private void addReplication() { - AddReplicationDialog dialog = new AddReplicationDialog(null, - new DialogCallback, Integer, Integer>>() { - @Override - /** - * @param masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber a triple containing the RabbitMQ exchange hostname, the servlet hostname and the RabbitMQ exchange name, - * followed by the RabbitMQ messaging port and the servlet port - */ - public void ok(final Util.Triple, Integer, Integer> masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber) { - registeredMasters.removeRow(0); - registeredMasters.insertRow(0); - registeredMasters.setWidget(0, 0, new Label(stringMessages.loading())); - addButton.setEnabled(false); - stopReplicationButton.setEnabled(false); - replicationServiceAsync.startReplicatingFromMaster(masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getA(), - masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getB(), - masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getC(), - masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getC(), - masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getB(), new AsyncCallback() { - @Override - public void onFailure(Throwable e) { - addButton.setEnabled(true); - errorReporter.reportError(stringMessages.errorStartingReplication( - masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getB(), - masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getC(), e.getMessage())); - updateReplicaList(); - } - - @Override - public void onSuccess(Void arg0) { - addButton.setEnabled(false); - stopReplicationButton.setEnabled(true); - updateReplicaList(); - } - }); - } - - @Override - public void cancel() { - // simply don't add replication - } - }); - dialog.show(); - } - - public void updateReplicaList() { - replicationServiceAsync.getReplicaInfo(new AsyncCallback() { - @Override - public void onSuccess(ReplicationStateDTO replicas) { - int i=0; - while (registeredReplicas.getRowCount() > 0) { - registeredReplicas.removeRow(0); - } - boolean replicaRegistered = false; - for (final ReplicaDTO replica : replicas.getReplicas()) { - registeredReplicas.insertRow(i); - registeredReplicas.setWidget(i, 0, new Label((i+1) + ". " + replica.getHostname() + " (" + replica.getIdentifier() + ")")); - registeredReplicas.setWidget(i, 1, new Label(stringMessages.registeredAt(replica.getRegistrationTime().toString()))); - final Button removeReplicaButton = new Button(stringMessages.dropReplicaConnection()); - removeReplicaButton.addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - replicationServiceAsync.stopSingleReplicaInstance(replica.getIdentifier(), new AsyncCallback() { - @Override - public void onFailure(Throwable caught) { - errorReporter.reportError(caught.getMessage()); - updateReplicaList(); - } - @Override - public void onSuccess(Void result) { - updateReplicaList(); - } - }); - } - }); - registeredReplicas.setWidget(i, 2, removeReplicaButton); - i++; - registeredReplicas.insertRow(i); - registeredReplicas.setWidget(i, 1, new Label(stringMessages.replicables())); - HTML replicablesLabel = new HTML(new SafeHtmlBuilder().appendEscapedLines(Arrays.toString(replica.getReplicableIdsAsStrings()).replaceAll(",", "\n")).toSafeHtml()); - registeredReplicas.setWidget(i, 2, replicablesLabel); - i++; - registeredReplicas.insertRow(i); - registeredReplicas.setWidget(i, 1, new Label(stringMessages.averageNumberOfOperationsPerMessage())); - registeredReplicas.setWidget(i, 2, new Label(""+replica.getAverageNumberOfOperationsPerMessage())); - i++; - registeredReplicas.insertRow(i); - registeredReplicas.setWidget(i, 1, new Label(stringMessages.numberOfQueueMessagesSent())); - registeredReplicas.setWidget(i, 2, new Label(""+replica.getNumberOfMessagesSent())); - i++; - registeredReplicas.insertRow(i); - registeredReplicas.setWidget(i, 1, new Label(stringMessages.averageMessageSize())); - registeredReplicas.setWidget(i, 2, new Label(""+replica.getAverageMessageSizeInBytes())); - i++; - registeredReplicas.insertRow(i); - registeredReplicas.setWidget(i, 1, new Label(stringMessages.totalSize())); - registeredReplicas.setWidget(i, 2, new Label(""+replica.getNumberOfBytesSent()+"B ("+replica.getNumberOfBytesSent()/1024.0/1024.0+"MB)")); - i++; - long totalNumberOfOperations = 0; - for (Map.Entry e : replica.getOperationCountByOperationClassName().entrySet()) { - registeredReplicas.insertRow(i); - registeredReplicas.setWidget(i, 1, new Label(e.getKey())); - registeredReplicas.setWidget(i, 2, new Label(e.getValue().toString())); - totalNumberOfOperations += e.getValue(); - i++; - } - registeredReplicas.insertRow(i); - registeredReplicas.setWidget(i, 1, new Label(stringMessages.totalNumberOfOperations())); - registeredReplicas.setWidget(i, 2, new Label(""+totalNumberOfOperations)); - i++; - replicaRegistered = true; - } - - if (!replicaRegistered) { - registeredReplicas.insertRow(i); - registeredReplicas.setWidget(i, 0, new Label(stringMessages.explainNoConnectionsFromReplicas())); - removeAllReplicas.setEnabled(false); - } else { - removeAllReplicas.setEnabled(true); - } - - while (registeredMasters.getRowCount() > 0) { - registeredMasters.removeRow(0); - } - i = 0; - - registeredMasters.insertRow(i); - registeredMasters.setWidget(i, 0, new Label("Client UUID: " + replicas.getServerIdentifier())); - i++; - final ReplicationMasterDTO replicatingFromMaster = replicas.getReplicatingFromMaster(); - if (replicatingFromMaster != null) { // TODO bug 2465: replicating only the user service from a "domain controller master" shouldn't lead to a warning here... - for (final String replicableIdAsStringOfReplicableThatWeAreReplicatingCurrently : replicatingFromMaster.getReplicableIdsAsString()) { - if (Util.contains(replicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica, replicableIdAsStringOfReplicableThatWeAreReplicatingCurrently)) { - errorReporter.reportPersistentInformation(stringMessages.warningServerIsReplica()); - break; - } - } - registeredMasters.insertRow(i); - registeredMasters.setWidget(i, 0, new Label(stringMessages.replicatingFromMaster(replicatingFromMaster.getHostname(), - replicatingFromMaster.getMessagingPort(), replicatingFromMaster.getServletPort(), - replicatingFromMaster.getMessagingHostname(), replicatingFromMaster.getExchangeName(), - Arrays.toString(replicatingFromMaster.getReplicableIdsAsString())))); - i++; - addButton.setEnabled(false); - stopReplicationButton.setEnabled(true); - } else { - errorReporter.reportPersistentInformation(""); - registeredMasters.insertRow(i); - registeredMasters.setWidget(i, 0, new Label(stringMessages.explainNoConnectionsToMaster())); - addButton.setEnabled(true); - stopReplicationButton.setEnabled(false); - } - - } - - @Override - public void onFailure(Throwable e) { - errorReporter.reportError(stringMessages.errorFetchingReplicaData(e.getMessage())); - } - }); - } - - /** - * A text entry dialog with ok/cancel button and configurable validation rule. Subclasses may provide a redefinition for - * {@link #getAdditionalWidget()} to add a widget below the text field, e.g., for capturing additional data. The result of - * this dialog is a triple containing the RabbitMQ exchange hostname, the servlet hostname and the RabbitMQ exchange name, - * followed by the RabbitMQ messaging port and the servlet port. - * - * @author Axel Uhl (d043530) - * - */ - private class AddReplicationDialog extends DataEntryDialog, Integer, Integer>> { - private final TextBox hostnameEntryField; - private final TextBox exchangeHostnameEntryField; - private final TextBox exchangenameEntryField; - private final IntegerBox messagingPortField; - private final IntegerBox servletPortField; - - public AddReplicationDialog(final Validator, Integer, Integer>> validator, - final DialogCallback, Integer, Integer>> callback) { - super(stringMessages.connect(), stringMessages.enterMaster(), - stringMessages.ok(), stringMessages.cancel(), validator, callback); - hostnameEntryField = createTextBox("localhost"); - exchangeHostnameEntryField = createTextBox("localhost"); - exchangenameEntryField = createTextBox("sapsailinganalytics"); - messagingPortField = createIntegerBox(0, /* visible length */ 5); - servletPortField = createIntegerBox(8888, /* visibleLength */ 5); - } - - /** - * Can contribute an additional widget to be displayed underneath the text entry field. If null is - * returned, no additional widget will be displayed. This is the default behavior of this default implementation. - */ - @Override - protected Widget getAdditionalWidget() { - Grid grid = new Grid(10, 2); - grid.setWidget(0, 0, new Label(stringMessages.hostname())); - grid.setWidget(0, 1, hostnameEntryField); - grid.setWidget(1, 0, new Label(stringMessages.explainReplicationHostname())); - - grid.setWidget(2, 0, new Label(stringMessages.exchangeHost())); - grid.setWidget(2, 1, exchangeHostnameEntryField); - grid.setWidget(3, 0, new Label(stringMessages.explainExchangeHostName())); - - grid.setWidget(4, 0, new Label(stringMessages.exchangeName())); - grid.setWidget(4, 1, exchangenameEntryField); - grid.setWidget(5, 0, new Label(stringMessages.explainReplicationExchangeName())); - - grid.setWidget(6, 0, new Label(stringMessages.messagingPortNumber())); - grid.setWidget(6, 1, messagingPortField); - grid.setWidget(7, 0, new Label(stringMessages.explainReplicationExchangePort())); - - grid.setWidget(8, 0, new Label(stringMessages.servletPortNumber())); - grid.setWidget(8, 1, servletPortField); - grid.setWidget(9, 0, new Label(stringMessages.explainReplicationServletPort())); - return grid; - } - - @Override - protected FocusWidget getInitialFocusWidget() { - return hostnameEntryField; - } - - @Override - protected Util.Triple, Integer, Integer> getResult() { - return new Util.Triple, Integer, Integer>( - new Util.Triple(exchangeHostnameEntryField.getText(), hostnameEntryField.getText(), exchangenameEntryField.getText()), - messagingPortField.getValue(), servletPortField.getValue()); - } - } - -} +package com.sap.sse.gwt.adminconsole; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.Button; +import com.google.gwt.user.client.ui.CaptionPanel; +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.FocusWidget; +import com.google.gwt.user.client.ui.Grid; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.TextBox; +import com.google.gwt.user.client.ui.VerticalPanel; +import com.google.gwt.user.client.ui.Widget; +import com.sap.sse.common.Util; +import com.sap.sse.gwt.client.ErrorReporter; +import com.sap.sse.gwt.client.async.MarkedAsyncCallback; +import com.sap.sse.gwt.client.controls.IntegerBox; +import com.sap.sse.gwt.client.dialog.DataEntryDialog; +import com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback; +import com.sap.sse.gwt.client.replication.RemoteReplicationServiceAsync; +import com.sap.sse.gwt.shared.replication.ReplicaDTO; +import com.sap.sse.gwt.shared.replication.ReplicationMasterDTO; +import com.sap.sse.gwt.shared.replication.ReplicationStateDTO; + +/** + * Allows administrators to manage all aspects of server instance replication such as showing whether the instance + * is a master or a replica and for a master showing the replicas to which the master is currently replicating. + * + * @author Axel Uhl (D043530) + * + */ +public class ReplicationPanel extends FlowPanel { + private final Grid registeredReplicas; + private final Grid registeredMasters; + + private final RemoteReplicationServiceAsync replicationServiceAsync; + private final ErrorReporter errorReporter; + private final StringMessages stringMessages; + + private final Button addButton; + private final Button stopReplicationButton; + private final Button removeAllReplicas; + + /** + * For administrators it is important to understand whether an instance is a replica. A + * {@link ErrorReporter#reportPersistentInformation(String) persistent error message} shall be shown + * in this case; however, some replicables may not be considered part of the "domain-based" replication. + * For example, if only a security service for user management is replicated in order to implement + * central user and session management then this shall not lead to the warning being displayed. + * This set contains the stringified IDs of those replicables for which being a replica shall + * lead to a warnings. + */ + private final Set replicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica; + + public ReplicationPanel(RemoteReplicationServiceAsync replicationService, ErrorReporter errorReporter, final StringMessages stringMessages) { + this.replicationServiceAsync = replicationService; + this.stringMessages = stringMessages; + this.errorReporter = errorReporter; + this.replicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica = new HashSet<>(); + replicationService.getReplicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica(new MarkedAsyncCallback<>(new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + GWT.log(stringMessages.errorFetchingReplicaData(caught.getMessage())); + } + + @Override + public void onSuccess(String[] result) { + for (final String replicableIdAsStringThatShallLeadToWarningAboutInstanceBeingReplica : result) { + replicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica.add(replicableIdAsStringThatShallLeadToWarningAboutInstanceBeingReplica); + } + } + })); + + Button refreshButton = new Button(stringMessages.refresh()); + refreshButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + updateReplicaList(); + } + }); + add(refreshButton); + + final CaptionPanel mastergroup = new CaptionPanel(stringMessages.explainReplicasRegistered()); + final VerticalPanel masterpanel = new VerticalPanel(); + + registeredReplicas = new Grid(); + registeredReplicas.resizeColumns(3); + masterpanel.add(registeredReplicas); + + removeAllReplicas = new Button(stringMessages.stopAllReplicas()); + removeAllReplicas.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + stopAllReplicas(); + }; + }); + removeAllReplicas.setEnabled(false); + masterpanel.add(removeAllReplicas); + + mastergroup.add(masterpanel); + add(mastergroup); + + final CaptionPanel replicagroup = new CaptionPanel(stringMessages.explainConnectionsToMaster()); + final VerticalPanel replicapanel = new VerticalPanel(); + final HorizontalPanel replicapanelbuttons = new HorizontalPanel(); + + registeredMasters = new Grid(); + registeredMasters.resizeColumns(3); + replicapanel.add(registeredMasters); + + addButton = new Button(stringMessages.connectToMaster()); + addButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + addReplication(); + } + }); + replicapanelbuttons.add(addButton); + stopReplicationButton = new Button(stringMessages.stopConnectionToMaster()); + stopReplicationButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + stopReplication(); + }; + }); + stopReplicationButton.setEnabled(false); + replicapanelbuttons.add(stopReplicationButton); + + replicapanel.add(replicapanelbuttons); + replicagroup.add(replicapanel); + add(replicagroup); + + updateReplicaList(); + } + + protected void stopAllReplicas() { + replicationServiceAsync.stopAllReplicas(new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + errorReporter.reportError(caught.getMessage()); + updateReplicaList(); + } + @Override + public void onSuccess(Void result) { + removeAllReplicas.setEnabled(false); + updateReplicaList(); + } + }); + } + + private void stopReplication() { + stopReplicationButton.setEnabled(false); + replicationServiceAsync.stopReplicatingFromMaster(new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + errorReporter.reportError(caught.getMessage()); + stopReplicationButton.setEnabled(true); + } + @Override + public void onSuccess(Void result) { + addButton.setEnabled(true); + stopReplicationButton.setEnabled(false); + updateReplicaList(); + } + }); + } + + private void addReplication() { + AddReplicationDialog dialog = new AddReplicationDialog(null, + new DialogCallback, Integer, Integer>>() { + @Override + /** + * @param masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber a triple containing the RabbitMQ exchange hostname, the servlet hostname and the RabbitMQ exchange name, + * followed by the RabbitMQ messaging port and the servlet port + */ + public void ok(final Util.Triple, Integer, Integer> masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber) { + registeredMasters.removeRow(0); + registeredMasters.insertRow(0); + registeredMasters.setWidget(0, 0, new Label(stringMessages.loading())); + addButton.setEnabled(false); + stopReplicationButton.setEnabled(false); + replicationServiceAsync.startReplicatingFromMaster(masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getA(), + masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getB(), + masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getC(), + masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getC(), + masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getB(), new AsyncCallback() { + @Override + public void onFailure(Throwable e) { + addButton.setEnabled(true); + errorReporter.reportError(stringMessages.errorStartingReplication( + masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getB(), + masterNameAndExchangeNameAndMessagingPortNumberAndServletPortNumber.getA().getC(), e.getMessage())); + updateReplicaList(); + } + + @Override + public void onSuccess(Void arg0) { + addButton.setEnabled(false); + stopReplicationButton.setEnabled(true); + updateReplicaList(); + } + }); + } + + @Override + public void cancel() { + // simply don't add replication + } + }); + dialog.show(); + } + + public void updateReplicaList() { + replicationServiceAsync.getReplicaInfo(new AsyncCallback() { + @Override + public void onSuccess(ReplicationStateDTO replicas) { + int i=0; + while (registeredReplicas.getRowCount() > 0) { + registeredReplicas.removeRow(0); + } + boolean replicaRegistered = false; + for (final ReplicaDTO replica : replicas.getReplicas()) { + registeredReplicas.insertRow(i); + registeredReplicas.setWidget(i, 0, new Label((i+1) + ". " + replica.getHostname() + " (" + replica.getIdentifier() + ")")); + registeredReplicas.setWidget(i, 1, new Label(stringMessages.registeredAt(replica.getRegistrationTime().toString()))); + final Button removeReplicaButton = new Button(stringMessages.dropReplicaConnection()); + removeReplicaButton.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + replicationServiceAsync.stopSingleReplicaInstance(replica.getIdentifier(), new AsyncCallback() { + @Override + public void onFailure(Throwable caught) { + errorReporter.reportError(caught.getMessage()); + updateReplicaList(); + } + @Override + public void onSuccess(Void result) { + updateReplicaList(); + } + }); + } + }); + registeredReplicas.setWidget(i, 2, removeReplicaButton); + i++; + registeredReplicas.insertRow(i); + registeredReplicas.setWidget(i, 1, new Label(stringMessages.replicables())); + HTML replicablesLabel = new HTML(new SafeHtmlBuilder().appendEscapedLines(Arrays.toString(replica.getReplicableIdsAsStrings()).replaceAll(",", "\n")).toSafeHtml()); + registeredReplicas.setWidget(i, 2, replicablesLabel); + i++; + registeredReplicas.insertRow(i); + registeredReplicas.setWidget(i, 1, new Label(stringMessages.averageNumberOfOperationsPerMessage())); + registeredReplicas.setWidget(i, 2, new Label(""+replica.getAverageNumberOfOperationsPerMessage())); + i++; + registeredReplicas.insertRow(i); + registeredReplicas.setWidget(i, 1, new Label(stringMessages.numberOfQueueMessagesSent())); + registeredReplicas.setWidget(i, 2, new Label(""+replica.getNumberOfMessagesSent())); + i++; + registeredReplicas.insertRow(i); + registeredReplicas.setWidget(i, 1, new Label(stringMessages.averageMessageSize())); + registeredReplicas.setWidget(i, 2, new Label(""+replica.getAverageMessageSizeInBytes())); + i++; + registeredReplicas.insertRow(i); + registeredReplicas.setWidget(i, 1, new Label(stringMessages.totalSize())); + registeredReplicas.setWidget(i, 2, new Label(""+replica.getNumberOfBytesSent()+"B ("+replica.getNumberOfBytesSent()/1024.0/1024.0+"MB)")); + i++; + long totalNumberOfOperations = 0; + for (Map.Entry e : replica.getOperationCountByOperationClassName().entrySet()) { + registeredReplicas.insertRow(i); + registeredReplicas.setWidget(i, 1, new Label(e.getKey())); + registeredReplicas.setWidget(i, 2, new Label(e.getValue().toString())); + totalNumberOfOperations += e.getValue(); + i++; + } + registeredReplicas.insertRow(i); + registeredReplicas.setWidget(i, 1, new Label(stringMessages.totalNumberOfOperations())); + registeredReplicas.setWidget(i, 2, new Label(""+totalNumberOfOperations)); + i++; + replicaRegistered = true; + } + + if (!replicaRegistered) { + registeredReplicas.insertRow(i); + registeredReplicas.setWidget(i, 0, new Label(stringMessages.explainNoConnectionsFromReplicas())); + removeAllReplicas.setEnabled(false); + } else { + removeAllReplicas.setEnabled(true); + } + + while (registeredMasters.getRowCount() > 0) { + registeredMasters.removeRow(0); + } + i = 0; + + registeredMasters.insertRow(i); + registeredMasters.setWidget(i, 0, new Label("Client UUID: " + replicas.getServerIdentifier())); + i++; + final ReplicationMasterDTO replicatingFromMaster = replicas.getReplicatingFromMaster(); + if (replicatingFromMaster != null) { // TODO bug 2465: replicating only the user service from a "domain controller master" shouldn't lead to a warning here... + for (final String replicableIdAsStringOfReplicableThatWeAreReplicatingCurrently : replicatingFromMaster.getReplicableIdsAsString()) { + if (Util.contains(replicableIdsAsStringThatShallLeadToWarningAboutInstanceBeingReplica, replicableIdAsStringOfReplicableThatWeAreReplicatingCurrently)) { + errorReporter.reportPersistentInformation(stringMessages.warningServerIsReplica()); + break; + } + } + registeredMasters.insertRow(i); + registeredMasters.setWidget(i, 0, new Label(stringMessages.replicatingFromMaster(replicatingFromMaster.getHostname(), + replicatingFromMaster.getMessagingPort(), replicatingFromMaster.getServletPort(), + replicatingFromMaster.getMessagingHostname(), replicatingFromMaster.getExchangeName(), + Arrays.toString(replicatingFromMaster.getReplicableIdsAsString())))); + i++; + addButton.setEnabled(false); + stopReplicationButton.setEnabled(true); + } else { + errorReporter.reportPersistentInformation(""); + registeredMasters.insertRow(i); + registeredMasters.setWidget(i, 0, new Label(stringMessages.explainNoConnectionsToMaster())); + addButton.setEnabled(true); + stopReplicationButton.setEnabled(false); + } + + } + + @Override + public void onFailure(Throwable e) { + errorReporter.reportError(stringMessages.errorFetchingReplicaData(e.getMessage())); + } + }); + } + + /** + * A text entry dialog with ok/cancel button and configurable validation rule. Subclasses may provide a redefinition for + * {@link #getAdditionalWidget()} to add a widget below the text field, e.g., for capturing additional data. The result of + * this dialog is a triple containing the RabbitMQ exchange hostname, the servlet hostname and the RabbitMQ exchange name, + * followed by the RabbitMQ messaging port and the servlet port. + * + * @author Axel Uhl (d043530) + * + */ + private class AddReplicationDialog extends DataEntryDialog, Integer, Integer>> { + private final TextBox hostnameEntryField; + private final TextBox exchangeHostnameEntryField; + private final TextBox exchangenameEntryField; + private final IntegerBox messagingPortField; + private final IntegerBox servletPortField; + + public AddReplicationDialog(final Validator, Integer, Integer>> validator, + final DialogCallback, Integer, Integer>> callback) { + super(stringMessages.connect(), stringMessages.enterMaster(), + stringMessages.ok(), stringMessages.cancel(), validator, callback); + hostnameEntryField = createTextBox("localhost"); + exchangeHostnameEntryField = createTextBox("localhost"); + exchangenameEntryField = createTextBox("sapsailinganalytics"); + messagingPortField = createIntegerBox(0, /* visible length */ 5); + servletPortField = createIntegerBox(8888, /* visibleLength */ 5); + } + + /** + * Can contribute an additional widget to be displayed underneath the text entry field. If null is + * returned, no additional widget will be displayed. This is the default behavior of this default implementation. + */ + @Override + protected Widget getAdditionalWidget() { + Grid grid = new Grid(10, 2); + grid.setWidget(0, 0, new Label(stringMessages.hostname())); + grid.setWidget(0, 1, hostnameEntryField); + grid.setWidget(1, 0, new Label(stringMessages.explainReplicationHostname())); + + grid.setWidget(2, 0, new Label(stringMessages.exchangeHost())); + grid.setWidget(2, 1, exchangeHostnameEntryField); + grid.setWidget(3, 0, new Label(stringMessages.explainExchangeHostName())); + + grid.setWidget(4, 0, new Label(stringMessages.exchangeName())); + grid.setWidget(4, 1, exchangenameEntryField); + grid.setWidget(5, 0, new Label(stringMessages.explainReplicationExchangeName())); + + grid.setWidget(6, 0, new Label(stringMessages.messagingPortNumber())); + grid.setWidget(6, 1, messagingPortField); + grid.setWidget(7, 0, new Label(stringMessages.explainReplicationExchangePort())); + + grid.setWidget(8, 0, new Label(stringMessages.servletPortNumber())); + grid.setWidget(8, 1, servletPortField); + grid.setWidget(9, 0, new Label(stringMessages.explainReplicationServletPort())); + return grid; + } + + @Override + protected FocusWidget getInitialFocusWidget() { + return hostnameEntryField; + } + + @Override + protected Util.Triple, Integer, Integer> getResult() { + return new Util.Triple, Integer, Integer>( + new Util.Triple(exchangeHostnameEntryField.getText(), hostnameEntryField.getText(), exchangenameEntryField.getText()), + messagingPortField.getValue(), servletPortField.getValue()); + } + } + +} diff --git a/java/com.sap.sse.gwt/pom.xml b/java/com.sap.sse.gwt/pom.xml index b1f7fbd93fb..a0e69479afd 100644 --- a/java/com.sap.sse.gwt/pom.xml +++ b/java/com.sap.sse.gwt/pom.xml @@ -1,32 +1,32 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sse.gwt - eclipse-plugin - - - - - org.eclipse.tycho - tycho-source-plugin - ${tycho-version} - - - plugin-source - generate-sources - - plugin-source - - - - - - - - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sse.gwt + eclipse-plugin + + + + + org.eclipse.tycho + tycho-source-plugin + ${tycho-version} + + + plugin-source + generate-sources + + plugin-source + + + + + + + + diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicaDTO.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicaDTO.java index 6476d9fdcf2..166b5371d91 100755 --- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicaDTO.java +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicaDTO.java @@ -1,59 +1,59 @@ -package com.sap.sse.gwt.shared.replication; - -import java.util.Date; -import java.util.Map; - -import com.google.gwt.user.client.rpc.IsSerializable; - -public class ReplicaDTO implements IsSerializable { - private String hostname; - private String identifier; - private Date registrationTime; - private Map operationCountByOperationClassName; - private double averageNumberOfOperationsPerMessage; - private long numberOfMessagesSent; - private double averageMessageSizeInBytes; - private long totalNumberOfBytesSent; - private String[] replicableIdsAsStrings; - ReplicaDTO() {} - public ReplicaDTO(String hostname, Date registrationTime, - String identifier, String[] replicableIdsAsStrings, Map operationCountByOperationClassName, - double averageNumberOfOperationsPerMessage, long numberOfMessagesSent, long totalNumberOfBytesSent, double averageMessageSizeInBytes) { - this.hostname = hostname; - this.identifier = identifier; - this.replicableIdsAsStrings = replicableIdsAsStrings; - this.registrationTime = registrationTime; - this.operationCountByOperationClassName = operationCountByOperationClassName; - this.averageNumberOfOperationsPerMessage = averageNumberOfOperationsPerMessage; - this.numberOfMessagesSent = numberOfMessagesSent; - this.averageMessageSizeInBytes = averageMessageSizeInBytes; - this.totalNumberOfBytesSent = totalNumberOfBytesSent; - } - public String getHostname() { - return hostname; - } - public Date getRegistrationTime() { - return registrationTime; - } - public Map getOperationCountByOperationClassName() { - return operationCountByOperationClassName; - } - public double getAverageNumberOfOperationsPerMessage() { - return averageNumberOfOperationsPerMessage; - } - public long getNumberOfMessagesSent() { - return numberOfMessagesSent; - } - public long getNumberOfBytesSent() { - return totalNumberOfBytesSent; - } - public double getAverageMessageSizeInBytes() { - return averageMessageSizeInBytes; - } - public String getIdentifier() { - return identifier; - } - public String[] getReplicableIdsAsStrings() { - return replicableIdsAsStrings; - } +package com.sap.sse.gwt.shared.replication; + +import java.util.Date; +import java.util.Map; + +import com.google.gwt.user.client.rpc.IsSerializable; + +public class ReplicaDTO implements IsSerializable { + private String hostname; + private String identifier; + private Date registrationTime; + private Map operationCountByOperationClassName; + private double averageNumberOfOperationsPerMessage; + private long numberOfMessagesSent; + private double averageMessageSizeInBytes; + private long totalNumberOfBytesSent; + private String[] replicableIdsAsStrings; + ReplicaDTO() {} + public ReplicaDTO(String hostname, Date registrationTime, + String identifier, String[] replicableIdsAsStrings, Map operationCountByOperationClassName, + double averageNumberOfOperationsPerMessage, long numberOfMessagesSent, long totalNumberOfBytesSent, double averageMessageSizeInBytes) { + this.hostname = hostname; + this.identifier = identifier; + this.replicableIdsAsStrings = replicableIdsAsStrings; + this.registrationTime = registrationTime; + this.operationCountByOperationClassName = operationCountByOperationClassName; + this.averageNumberOfOperationsPerMessage = averageNumberOfOperationsPerMessage; + this.numberOfMessagesSent = numberOfMessagesSent; + this.averageMessageSizeInBytes = averageMessageSizeInBytes; + this.totalNumberOfBytesSent = totalNumberOfBytesSent; + } + public String getHostname() { + return hostname; + } + public Date getRegistrationTime() { + return registrationTime; + } + public Map getOperationCountByOperationClassName() { + return operationCountByOperationClassName; + } + public double getAverageNumberOfOperationsPerMessage() { + return averageNumberOfOperationsPerMessage; + } + public long getNumberOfMessagesSent() { + return numberOfMessagesSent; + } + public long getNumberOfBytesSent() { + return totalNumberOfBytesSent; + } + public double getAverageMessageSizeInBytes() { + return averageMessageSizeInBytes; + } + public String getIdentifier() { + return identifier; + } + public String[] getReplicableIdsAsStrings() { + return replicableIdsAsStrings; + } } \ No newline at end of file diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicationMasterDTO.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicationMasterDTO.java index f10bf04b713..45c01f6f5f8 100755 --- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicationMasterDTO.java +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicationMasterDTO.java @@ -1,52 +1,52 @@ -package com.sap.sse.gwt.shared.replication; - -import com.google.gwt.user.client.rpc.IsSerializable; - -public class ReplicationMasterDTO implements IsSerializable { - private String hostname; - private int messagingPort; - private int servletPort; - private String messagingHostname; - private String exchangeName; - private String[] replicableIdsAsString; - - // TODO bug 2465: capture the set of replicables that are replicated from this master; this may be a subset of the - // replica's / master's Replicables - - ReplicationMasterDTO() { - } - - public ReplicationMasterDTO(String hostname, int servletPort, String messagingHostname, int messagingPort, String exchangeName, String[] replicableIdsAsString) { - super(); - this.hostname = hostname; - this.servletPort = servletPort; - this.messagingHostname = messagingHostname; - this.messagingPort = messagingPort; - this.exchangeName = exchangeName; - this.replicableIdsAsString = replicableIdsAsString; - } - - public String getHostname() { - return hostname; - } - - public int getMessagingPort() { - return messagingPort; - } - - public int getServletPort() { - return servletPort; - } - - public String getMessagingHostname() { - return messagingHostname; - } - - public String getExchangeName() { - return exchangeName; - } - - public String[] getReplicableIdsAsString() { - return replicableIdsAsString; - } +package com.sap.sse.gwt.shared.replication; + +import com.google.gwt.user.client.rpc.IsSerializable; + +public class ReplicationMasterDTO implements IsSerializable { + private String hostname; + private int messagingPort; + private int servletPort; + private String messagingHostname; + private String exchangeName; + private String[] replicableIdsAsString; + + // TODO bug 2465: capture the set of replicables that are replicated from this master; this may be a subset of the + // replica's / master's Replicables + + ReplicationMasterDTO() { + } + + public ReplicationMasterDTO(String hostname, int servletPort, String messagingHostname, int messagingPort, String exchangeName, String[] replicableIdsAsString) { + super(); + this.hostname = hostname; + this.servletPort = servletPort; + this.messagingHostname = messagingHostname; + this.messagingPort = messagingPort; + this.exchangeName = exchangeName; + this.replicableIdsAsString = replicableIdsAsString; + } + + public String getHostname() { + return hostname; + } + + public int getMessagingPort() { + return messagingPort; + } + + public int getServletPort() { + return servletPort; + } + + public String getMessagingHostname() { + return messagingHostname; + } + + public String getExchangeName() { + return exchangeName; + } + + public String[] getReplicableIdsAsString() { + return replicableIdsAsString; + } } \ No newline at end of file diff --git a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicationStateDTO.java b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicationStateDTO.java index 04004a5a175..6205e1b109c 100755 --- a/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicationStateDTO.java +++ b/java/com.sap.sse.gwt/src/com/sap/sse/gwt/shared/replication/ReplicationStateDTO.java @@ -1,41 +1,41 @@ -package com.sap.sse.gwt.shared.replication; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gwt.user.client.rpc.IsSerializable; - -/** - * Holds information about a replica. - * - * @author Axel Uhl (d043530) - * - */ -public class ReplicationStateDTO implements IsSerializable { - private Map replicaInfoByHostname; - private ReplicationMasterDTO replicatingFromMaster; - private String serverIdentifier; - - ReplicationStateDTO() { } // for de-serialization - - public ReplicationStateDTO(ReplicationMasterDTO replicatingFromMaster, Iterable replicas, String serverIdentifier) { - this.replicatingFromMaster = replicatingFromMaster; - this.serverIdentifier = serverIdentifier; - this.replicaInfoByHostname = new HashMap(); - for (ReplicaDTO replica : replicas) { - replicaInfoByHostname.put(replica.getIdentifier(), replica); - } - } - - public ReplicationMasterDTO getReplicatingFromMaster() { - return replicatingFromMaster; - } - - public Iterable getReplicas() { - return replicaInfoByHostname.values(); - } - - public String getServerIdentifier() { - return serverIdentifier; - } +package com.sap.sse.gwt.shared.replication; + +import java.util.HashMap; +import java.util.Map; + +import com.google.gwt.user.client.rpc.IsSerializable; + +/** + * Holds information about a replica. + * + * @author Axel Uhl (d043530) + * + */ +public class ReplicationStateDTO implements IsSerializable { + private Map replicaInfoByHostname; + private ReplicationMasterDTO replicatingFromMaster; + private String serverIdentifier; + + ReplicationStateDTO() { } // for de-serialization + + public ReplicationStateDTO(ReplicationMasterDTO replicatingFromMaster, Iterable replicas, String serverIdentifier) { + this.replicatingFromMaster = replicatingFromMaster; + this.serverIdentifier = serverIdentifier; + this.replicaInfoByHostname = new HashMap(); + for (ReplicaDTO replica : replicas) { + replicaInfoByHostname.put(replica.getIdentifier(), replica); + } + } + + public ReplicationMasterDTO getReplicatingFromMaster() { + return replicatingFromMaster; + } + + public Iterable getReplicas() { + return replicaInfoByHostname.values(); + } + + public String getServerIdentifier() { + return serverIdentifier; + } } \ No newline at end of file diff --git a/java/com.sap.sse.mongodb/pom.xml b/java/com.sap.sse.mongodb/pom.xml index 5641ba7c0b2..266830f8bd2 100644 --- a/java/com.sap.sse.mongodb/pom.xml +++ b/java/com.sap.sse.mongodb/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sse.mongodb - eclipse-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sse.mongodb + eclipse-plugin + diff --git a/java/com.sap.sse.operationaltransformation.test/pom.xml b/java/com.sap.sse.operationaltransformation.test/pom.xml index b1e63c6b624..c4d5a9d06de 100644 --- a/java/com.sap.sse.operationaltransformation.test/pom.xml +++ b/java/com.sap.sse.operationaltransformation.test/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sse.operationaltransformation.test - eclipse-test-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sse.operationaltransformation.test + eclipse-test-plugin + diff --git a/java/com.sap.sse.operationaltransformation/pom.xml b/java/com.sap.sse.operationaltransformation/pom.xml index eca4c1390b6..2656f85dad0 100644 --- a/java/com.sap.sse.operationaltransformation/pom.xml +++ b/java/com.sap.sse.operationaltransformation/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sse.operationaltransformation - eclipse-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sse.operationaltransformation + eclipse-plugin + diff --git a/java/com.sap.sse.replication/pom.xml b/java/com.sap.sse.replication/pom.xml index 1f17de470ba..9f75fefd6de 100644 --- a/java/com.sap.sse.replication/pom.xml +++ b/java/com.sap.sse.replication/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sse.replication - eclipse-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sse.replication + eclipse-plugin + diff --git a/java/com.sap.sse.threadmanager/pom.xml b/java/com.sap.sse.threadmanager/pom.xml index cbfd6c1939a..ca8e0c591d5 100644 --- a/java/com.sap.sse.threadmanager/pom.xml +++ b/java/com.sap.sse.threadmanager/pom.xml @@ -1,12 +1,12 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - com.sap.sse.threadmanager - eclipse-plugin - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + com.sap.sse.threadmanager + eclipse-plugin + diff --git a/java/org.moxieapps.gwt.highcharts/pom.xml b/java/org.moxieapps.gwt.highcharts/pom.xml index b9ace723e97..690790946e2 100755 --- a/java/org.moxieapps.gwt.highcharts/pom.xml +++ b/java/org.moxieapps.gwt.highcharts/pom.xml @@ -1,33 +1,33 @@ - - - 4.0.0 - - root - com.sap.sailing - 1.0.0-SNAPSHOT - - org.moxieapps.gwt.highcharts - org.moxieapps.gwt - 1.6.0-SNAPSHOT - eclipse-plugin - - - - - org.eclipse.tycho - tycho-source-plugin - ${tycho-version} - - - plugin-source - generate-sources - - plugin-source - - - - - - - + + + 4.0.0 + + root + com.sap.sailing + 1.0.0-SNAPSHOT + + org.moxieapps.gwt.highcharts + org.moxieapps.gwt + 1.6.0-SNAPSHOT + eclipse-plugin + + + + + org.eclipse.tycho + tycho-source-plugin + ${tycho-version} + + + plugin-source + generate-sources + + plugin-source + + + + + + +