[[Image:images/LTTng2SelectConnection.png]]
-To enter the host information manually select first the button '''Edit connection information'''. Then the text fields '''Connection Name''' and '''Host Name''' will enabled. Enter the relevant information and then select '''Ok'''.
+To enter the host information manually select first the button '''Edit connection information'''. Then the text fields '''Connection Name''', '''Host Name''' and '''Port Number''' will be enabled. The '''Host Name''' holds the IP address or DNS name of the remote system. The '''Connection Name''' is the alias name to be displayed in the Control View. The '''Port Number''' is the port number to be used for the IP connection. This parameter is optional and if it is omitted the default port will be used. Enter the relevant information and then select '''Ok'''.
[[Image:images/LTTng2EditConnection.png]]
A new display will show for providing the user name and password. This display only opens if no password had been saved before. Enter user name and password in the '''Enter Password''' dialog box and select '''Ok'''.
-The '''Host Name''' holds the IP address or DNS name of the remote system.
-The '''Connection Name''' is the alias name to be displayed in the Control View.
-
[[Image:images/LTTng2EnterPassword.png]]
After pressing '''Ok''' the SSH connection will be established and after successful login the Control View implementation retrieves the LTTng Tracer Control information. This information will be displayed in the Control View in form of a tree structure.
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
fShell.setScenario(fScenario);
}
}
+
+ @Override
+ public int getPort() {
+ return IRemoteSystemProxy.INVALID_PORT_NUMBER;
+ }
+
+ @Override
+ public void setPort(int port) {
+ }
}
/**********************************************************************
- * Copyright (c) 2012 Ericsson
- *
+ * Copyright (c) 2012, 2013 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:
+ *
+ * Contributors:
* Bernd Hufmann - Initial API and implementation
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
* <p>
* Interface for connection information dialog.
* </p>
- *
+ *
* @author Bernd Hufmann
*/
public interface INewConnectionDialog {
-
+
// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
* @return the host name (IP address or DNS name)
*/
public String getHostName();
-
+
+ /**
+ * @return port of IP connection to be used
+ */
+ public int getPort();
+
/**
* Sets the trace control root
* @param parent - the trace control parent
*/
public void setTraceControlParent(ITraceControlComponent parent);
-
+
/**
* Sets the available hosts to select.
* @param hosts - the available hosts
*/
public void setHosts(IHost[] hosts);
+ /**
+ * Set the port of the IP connection to be used.
+ * @param port - the IP port to set
+ */
+ public void setPort(int port);
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.IRemoteSystemProxy;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
* The text widget for the node address (IP or DNS name)
*/
private Text fHostNameText = null;
+ /**
+ * The text widget for the IP port
+ */
+ private Text fPortText = null;
/**
* The parent where the new node should be added.
*/
* The node address (IP or DNS name) string.
*/
private String fHostName = null;
-
+ /**
+ * The IP port of the connection.
+ */
+ private int fPort = IRemoteSystemProxy.INVALID_PORT_NUMBER;
/**
* Input list of existing RSE hosts available for selection.
*/
return fHostName;
}
+ @Override
+ public int getPort() {
+ return fPort;
+ }
+
/*
* (non-Javadoc)
* @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.INewConnectionDialog#setTraceControlParent(org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent)
}
}
+ @Override
+ public void setPort(int port) {
+ fPort = port;
+ }
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
fHostNameText.setToolTipText(Messages.TraceControl_NewNodeHostNameTooltip);
fHostNameText.setEnabled(fExistingHosts.length == 0);
+ Label portLabel = new Label(fTextGroup, SWT.RIGHT);
+ portLabel.setText(Messages.TraceControl_NewNodePortLabel);
+ fPortText = new Text(fTextGroup, SWT.NONE);
+ fPortText.setToolTipText(Messages.TraceControl_NewNodePortTooltip);
+ fPortText.setEnabled(fExistingHosts.length == 0);
+ fPortText.addVerifyListener(new VerifyListener() {
+ @Override
+ public void verifyText(VerifyEvent e) {
+ // only numbers are allowed.
+ e.doit = e.text.matches("[0-9]*"); //$NON-NLS-1$
+ }
+ });
+
fButton.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
fExistingHostsCombo.setEnabled(false);
fConnectionNameText.setEnabled(true);
fHostNameText.setEnabled(true);
+ fPortText.setEnabled(true);
} else {
fExistingHostsCombo.setEnabled(true);
fConnectionNameText.setEnabled(false);
fHostNameText.setEnabled(false);
+ fPortText.setEnabled(false);
}
}
int index = fExistingHostsCombo.getSelectionIndex();
fConnectionNameText.setText(fExistingHosts[index].getAliasName());
fHostNameText.setText(fExistingHosts[index].getHostName());
+ fPortText.setText(""); //$NON-NLS-1$
}
@Override
data = new GridData(GridData.FILL_HORIZONTAL);
fHostNameText.setText("666.666.666.666"); //$NON-NLS-1$
Point minSize = fHostNameText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- data.widthHint = minSize.x + 5;
+ int widthHint = minSize.x + 5;
+ data.widthHint = widthHint;
data.horizontalSpan = 2;
-
fConnectionNameText.setLayoutData(data);
+
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.widthHint = widthHint;
+ data.horizontalSpan = 2;
fHostNameText.setLayoutData(data);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.widthHint = widthHint;
+ data.horizontalSpan = 2;
+ fPortText.setLayoutData(data);
+
fHostNameText.setText(""); //$NON-NLS-1$
return fDialogComposite;
// Validate input data
fConnectionName = fConnectionNameText.getText();
fHostName = fHostNameText.getText();
+ fPort = (fPortText.getText().length() > 0) ? Integer.parseInt(fPortText.getText()) : IRemoteSystemProxy.INVALID_PORT_NUMBER;
if (!"".equals(fHostName)) { //$NON-NLS-1$
// If no node name is specified use the node address as name
/**********************************************************************
- * Copyright (c) 2012 Ericsson and others
+ * Copyright (c) 2012, 2013 Ericsson and others
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.IRemoteSystemProxy;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.IHost;
final INewConnectionDialog dialog = TraceControlDialogFactory.getInstance().getNewConnectionDialog();
dialog.setTraceControlParent(fRoot);
dialog.setHosts(hosts);
+ dialog.setPort(IRemoteSystemProxy.INVALID_PORT_NUMBER);
if (dialog.open() != Window.OK) {
return null;
String hostName = dialog.getConnectionName();
String hostAddress = dialog.getHostName();
+ int port = dialog.getPort();
// get the singleton RSE registry
IHost host = null;
TargetNodeComponent node = null;
if (!fRoot.containsChild(hostName)) {
node = new TargetNodeComponent(hostName, fRoot, host);
+ node.setPort(port);
fRoot.addChild(node);
}
else {
public static String TraceControl_NewNodeConnectionNameTooltip;
public static String TraceControl_NewNodeHostNameLabel;
public static String TraceControl_NewNodeHostNameTooltip;
+ public static String TraceControl_NewNodePortLabel;
+ public static String TraceControl_NewNodePortTooltip;
public static String TraceControl_AlreadyExistsError;
public static String TraceControl_CreateSessionDialogTitle;
TraceControl_NewNodeConnectionNameTooltip=Alias to be displayed for node to connect to.
TraceControl_NewNodeHostNameLabel=Host Name
TraceControl_NewNodeHostNameTooltip=IP Address or DNS name of node to connect to.
+TraceControl_NewNodePortLabel=Port Number
+TraceControl_NewNodePortTooltip=IP Port Number to be used for the connection. Leave empty for default port.
TraceControl_AlreadyExistsError=Node name already exists in Control View
TraceControl_CreateSessionDialogTitle=Create Session
return fRemoteProxy;
}
+ /**
+ * @return port of IP connection (shell) to be used
+ */
+ public int getPort() {
+ return fRemoteProxy.getPort();
+ }
+
+ /**
+ * Sets the port of the IP connections of the shell
+ * @param port - the IP port to set
+ */
+ public void setPort(int port) {
+ fRemoteProxy.setPort(port);
+ }
+
/**
* @return all available sessions.
*/
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*/
public interface IRemoteSystemProxy {
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ /**
+ * Invalid port number for IP based connections.
+ */
+ public final static int INVALID_PORT_NUMBER = -1;
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
*/
public IFileServiceSubSystem getFileServiceSubSystem();
+ /**
+ * @return port of IP connection to be used
+ */
+ public int getPort();
+
+ /**
+ * Sets the port of the IP connection.
+ * @param port - the IP port to set
+ */
+ public void setPort(int port);
+
/**
* Connects the shell service sub system.
*
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.util.IRemoteSystemProxy#connect(org.eclipse.rse.core.model.IRSECallback)
+ @Override
+ public int getPort() {
+ if (getShellServiceSubSystem() != null) {
+ return getShellServiceSubSystem().getConnectorService().getPort();
+ }
+ return IRemoteSystemProxy.INVALID_PORT_NUMBER;
+ }
+
+ @Override
+ public void setPort(int port) {
+ if ((getShellServiceSubSystem() != null) && (port > 0)) {
+ getShellServiceSubSystem().getConnectorService().setPort(port);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.IRemoteSystemProxy#connect(org.eclipse.rse.core.model.IRSECallback)
*/
@Override
public void connect(IRSECallback callback) throws ExecutionException {