lttng: Fix a package dependency in control.core
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 21 Oct 2015 22:09:34 +0000 (18:09 -0400)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Thu, 22 Oct 2015 17:37:52 +0000 (13:37 -0400)
Change-Id: Ieab9d01b146073d16ff92c35cb9f303eac196142
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/58675
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/relayd/LttngRelayd24Test.java
lttng/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/relayd/LttngRelaydConnectorFactory.java [deleted file]
lttng/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/relayd/impl/LttngRelaydConnectorFactory.java [new file with mode: 0644]
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/relayd/LttngRelaydConsumer.java

index 85334590b497cf6ad19150435f051e11528605f4..f6a6a38aadda5328c8cf886395eae9f648037e6e 100644 (file)
@@ -24,7 +24,6 @@ import java.net.Socket;
 import java.util.List;
 
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.ILttngRelaydConnector;
-import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.LttngRelaydConnectorFactory;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.AttachSessionResponse;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.Command;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.ConnectResponse;
@@ -36,6 +35,7 @@ import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.Nex
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.SessionResponse;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.StreamResponse;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.ViewerCommand;
+import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.impl.LttngRelaydConnectorFactory;
 import org.junit.Test;
 
 /**
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/relayd/LttngRelaydConnectorFactory.java b/lttng/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/relayd/LttngRelaydConnectorFactory.java
deleted file mode 100644 (file)
index faac481..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2014 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *   Matthew Khouzam - Initial implementation
- **********************************************************************/
-
-package org.eclipse.tracecompass.internal.lttng2.control.core.relayd;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.net.Socket;
-
-import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.Command;
-import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.ConnectResponse;
-import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.ConnectionType;
-import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.ViewerCommand;
-import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.impl.LttngRelaydConnector_2_4;
-import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.impl.LttngRelaydConnector_Unsupported;
-
-/**
- * LTTng RelayD connector factory
- *
- * @author Matthew Khouzam
- */
-public final class LttngRelaydConnectorFactory {
-
-    private LttngRelaydConnectorFactory() {
-    }
-
-    /**
-     * Create a connection to a relayd
-     *
-     * @param myConnection
-     *            a connection to the relayd
-     *
-     * @return A relayd connector
-     * @throws IOException
-     *             caused by invalid sockets
-     */
-    public static ILttngRelaydConnector getNewConnector(Socket myConnection) throws IOException {
-        DataOutputStream outNet = new DataOutputStream(myConnection.getOutputStream());
-        DataInputStream inNet = new DataInputStream(myConnection.getInputStream());
-
-        ViewerCommand connectCommand = new ViewerCommand(Command.VIEWER_CONNECT, ConnectResponse.SIZE, 0);
-
-        outNet.write(connectCommand.serialize());
-        outNet.flush();
-
-        ConnectResponse payload = new ConnectResponse(0, 2, 4, ConnectionType.VIEWER_CLIENT_COMMAND);
-        outNet.write(payload.serialize());
-        outNet.flush();
-
-        ConnectResponse connectReply = new ConnectResponse(inNet);
-        switch (connectReply.getMajor()) {
-        case 2:
-            switch (connectReply.getMinor()) {
-            case 0:
-            case 1:
-            case 2:
-            case 3:
-                return new LttngRelaydConnector_Unsupported();
-            case 4:
-            default:
-                return new LttngRelaydConnector_2_4(inNet, outNet);
-            }
-        default:
-            return new LttngRelaydConnector_Unsupported();
-        }
-    }
-}
diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/relayd/impl/LttngRelaydConnectorFactory.java b/lttng/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/relayd/impl/LttngRelaydConnectorFactory.java
new file mode 100644 (file)
index 0000000..abc7d09
--- /dev/null
@@ -0,0 +1,76 @@
+/**********************************************************************
+ * Copyright (c) 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial implementation
+ **********************************************************************/
+
+package org.eclipse.tracecompass.internal.lttng2.control.core.relayd.impl;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.net.Socket;
+
+import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.ILttngRelaydConnector;
+import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.Command;
+import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.ConnectResponse;
+import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.ConnectionType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.ViewerCommand;
+
+/**
+ * LTTng RelayD connector factory
+ *
+ * @author Matthew Khouzam
+ */
+public final class LttngRelaydConnectorFactory {
+
+    private LttngRelaydConnectorFactory() {
+    }
+
+    /**
+     * Create a connection to a relayd
+     *
+     * @param myConnection
+     *            a connection to the relayd
+     *
+     * @return A relayd connector
+     * @throws IOException
+     *             caused by invalid sockets
+     */
+    public static ILttngRelaydConnector getNewConnector(Socket myConnection) throws IOException {
+        DataOutputStream outNet = new DataOutputStream(myConnection.getOutputStream());
+        DataInputStream inNet = new DataInputStream(myConnection.getInputStream());
+
+        ViewerCommand connectCommand = new ViewerCommand(Command.VIEWER_CONNECT, ConnectResponse.SIZE, 0);
+
+        outNet.write(connectCommand.serialize());
+        outNet.flush();
+
+        ConnectResponse payload = new ConnectResponse(0, 2, 4, ConnectionType.VIEWER_CLIENT_COMMAND);
+        outNet.write(payload.serialize());
+        outNet.flush();
+
+        ConnectResponse connectReply = new ConnectResponse(inNet);
+        switch (connectReply.getMajor()) {
+        case 2:
+            switch (connectReply.getMinor()) {
+            case 0:
+            case 1:
+            case 2:
+            case 3:
+                return new LttngRelaydConnector_Unsupported();
+            case 4:
+            default:
+                return new LttngRelaydConnector_2_4(inNet, outNet);
+            }
+        default:
+            return new LttngRelaydConnector_Unsupported();
+        }
+    }
+}
index 2cc064b846ff2fd731b8ec51ddd6a641b8cd70f6..de65c38fddc72ee2262306db92c7e7cc4da9f5a7 100644 (file)
@@ -25,7 +25,6 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.ILttngRelaydConnector;
-import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.LttngRelaydConnectorFactory;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.AttachReturnCode;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.AttachSessionResponse;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.CreateSessionResponse;
@@ -34,6 +33,7 @@ import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.Ind
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.NextIndexReturnCode;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.SessionResponse;
 import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.commands.StreamResponse;
+import org.eclipse.tracecompass.internal.lttng2.control.core.relayd.impl.LttngRelaydConnectorFactory;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
 import org.eclipse.tracecompass.tmf.core.signal.TmfTraceRangeUpdatedSignal;
 import org.eclipse.tracecompass.tmf.core.timestamp.TmfNanoTimestamp;
This page took 0.034911 seconds and 5 git commands to generate.