Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Fasani2016-05-24 08:25:43 +0000
committerEike Stepper2016-05-24 09:23:12 +0000
commit192a73ba2a787f9361d49826b87c76af85b14ac6 (patch)
treee8e98b4a48a44d7dce89f2308593b696a6eec47d
parentea68cbd330ca4e56b611aed0872f98777e3b02cf (diff)
downloadcdo-192a73ba2a787f9361d49826b87c76af85b14ac6.tar.gz
cdo-192a73ba2a787f9361d49826b87c76af85b14ac6.tar.xz
cdo-192a73ba2a787f9361d49826b87c76af85b14ac6.zip
[494314] Add user information to Signal traces when possible
https://bugs.eclipse.org/bugs/show_bug.cgi?id=494314 Change-Id: Icdb5c76ed610a38a6075e2487177c7b404af3828 Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr> Signed-off-by: Eike Stepper <stepper@esc-net.de>
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java14
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java12
3 files changed, 38 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java
index c686ad631f..59525f5e1b 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java
@@ -88,6 +88,20 @@ public abstract class CDOServerIndication extends IndicationWithResponse
}
@Override
+ protected String getAdditionalInfo()
+ {
+ String additionalInfo = super.getAdditionalInfo();
+
+ String userID = getSession().getUserID();
+ if (userID != null)
+ {
+ additionalInfo += ", user=" + userID;
+ }
+
+ return additionalInfo;
+ }
+
+ @Override
protected void indicating(ExtendedDataInputStream in) throws Exception
{
indicating(new CDODataInputImpl(in)
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java
index 3ce4dcdd5e..83a6e433a0 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerRequest.java
@@ -45,6 +45,20 @@ public abstract class CDOServerRequest extends Request
}
@Override
+ protected String getAdditionalInfo()
+ {
+ String additionalInfo = super.getAdditionalInfo();
+
+ String userID = getSession().getUserID();
+ if (userID != null)
+ {
+ additionalInfo += ", user=" + userID;
+ }
+
+ return additionalInfo;
+ }
+
+ @Override
protected final void requesting(ExtendedDataOutputStream out) throws Exception
{
requesting(new CDODataOutputImpl(out)
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
index d1b1c8c2da..87dcce03f0 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
@@ -135,8 +135,16 @@ public abstract class Signal implements Runnable
@Override
public String toString()
{
- return MessageFormat.format("Signal[protocol={0}, id={1}, name={2}, correlation={3}]", getProtocol().getType(), //$NON-NLS-1$
- getID(), getName(), getCorrelationID());
+ return MessageFormat.format("Signal[protocol={0}, id={1}, name={2}, correlation={3}{4}]", getProtocol().getType(), //$NON-NLS-1$
+ getID(), getName(), getCorrelationID(), getAdditionalInfo());
+ }
+
+ /**
+ * @since 4.5
+ */
+ protected String getAdditionalInfo()
+ {
+ return "";
}
public final void run()

Back to the top