import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlService;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceConstants;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceMI;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.junit.Test;
*/
public class TraceControlComponentTest {
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
/**
* Run the TraceControlComponent(String) constructor test.
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
// Test data
// ------------------------------------------------------------------------
private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
private String fTestFile;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceProviderGroup;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
// ------------------------------------------------------------------------
private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
private String fTestFile;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceProbeEventComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
// ------------------------------------------------------------------------
private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
private String fTestFile;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceProbeEventPropertySource;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceSessionPropertySource;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.UstProviderPropertySource;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.eclipse.ui.views.properties.IPropertySource;
import org.junit.After;
import org.junit.Test;
*/
@Test
public void testComponentProperties() throws Exception {
- IRemoteConnection host = RemoteSystemProxy.getLocalConnection();
+ IRemoteConnection host = TmfRemoteConnectionFactory.getLocalConnection();
TestRemoteSystemProxy proxy = new TestRemoteSystemProxy(host);
URL location = FileLocator.find(FrameworkUtil.getBundle(this.getClass()), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.property.TraceSessionPropertySource;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.junit.After;
// ------------------------------------------------------------------------
private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
private String fTestFile;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.UstProviderComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlService;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
// Test data
// ------------------------------------------------------------------------
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
private String fTestFile;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.UstProviderComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.ILttngControlService;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlService;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
// Test data
// ------------------------------------------------------------------------
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
private String fTestFile;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.UstProviderComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
private TraceControlTestFacility fFacility;
private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
private String fTestFile;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceEventComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
// ------------------------------------------------------------------------
// Test data
// ------------------------------------------------------------------------
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
private TraceControlTestFacility fFacility;
private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
private String fTestFile;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceChannelComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceDomainComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
// ------------------------------------------------------------------------
private TraceControlTestFacility fFacility;
- private IRemoteConnection fHost = RemoteSystemProxy.getLocalConnection();
+ private IRemoteConnection fHost = TmfRemoteConnectionFactory.getLocalConnection();
private @NonNull TestRemoteSystemProxy fProxy = new TestRemoteSystemProxy(fHost);
private String fTestFile;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceControlContentProvider;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceControlLabelProvider;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceControlRoot;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.PartInitException;
if ((id == null) || (name == null)) {
break;
}
- IRemoteConnection conn = RemoteSystemProxy.getRemoteConnection(id, name);
+ IRemoteConnection conn = TmfRemoteConnectionFactory.getRemoteConnection(id, name);
if (conn != null) {
fInitialConnections.add(conn);
}
import org.eclipse.swt.widgets.Shell;
import org.eclipse.tracecompass.internal.lttng2.control.ui.Activator;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.messages.Messages;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
/**
* <p>
@Override
public Object[] getElements(Object inputElement) {
List<Object> children = new ArrayList<>();
- IRemoteServicesManager manager = RemoteSystemProxy.getService(IRemoteServicesManager.class);
+ IRemoteServicesManager manager = TmfRemoteConnectionFactory.getService(IRemoteServicesManager.class);
if (manager != null) {
children.addAll(manager.getAllConnectionTypes());
}
fConnectionTree.setAutoExpandLevel(2);
fConnectionTree.setInput(this);
- IRemoteServicesManager manager = RemoteSystemProxy.getService(IRemoteServicesManager.class);
+ IRemoteServicesManager manager = TmfRemoteConnectionFactory.getService(IRemoteServicesManager.class);
if (manager == null) {
return result;
}
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.TraceControlDialogFactory;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
Object remoteServicesId = parameters.get(PARAMETER_REMOTE_SERVICES_ID);
Object connectionName = parameters.get(PARAMETER_CONNECTION_NAME);
if ((remoteServicesId != null) && (connectionName != null)) {
- return RemoteSystemProxy.getRemoteConnection(
+ return TmfRemoteConnectionFactory.getRemoteConnection(
checkNotNull(remoteServicesId.toString()),
checkNotNull(connectionName.toString()));
}
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.tracecompass.internal.tmf.remote.core.shell.CommandShell;
import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.eclipse.tracecompass.tmf.remote.core.shell.ICommandInput;
import org.eclipse.tracecompass.tmf.remote.core.shell.ICommandResult;
import org.eclipse.tracecompass.tmf.remote.core.shell.ICommandShell;
private static final @NonNull String[] CMD_ERROR_INPUT_LINUX = { "ls", "blablablabla" };
private static final @NonNull String[] CMD_UNKNOWN_COMMAND_LINUX = { "blablablabla" };
- private static final IRemoteConnection LOCAL_CONNECTION = RemoteSystemProxy.getLocalConnection();
+ private static final IRemoteConnection LOCAL_CONNECTION = TmfRemoteConnectionFactory.getLocalConnection();
private static final RemoteSystemProxy LOCAL_PROXY = new RemoteSystemProxy(checkNotNull(LOCAL_CONNECTION));
/**
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.remote.core.IRemoteConnectionType;
import org.eclipse.remote.core.exception.RemoteConnectionException;
/**
public interface IConnectionFactory {
/**
* Creates an {@link IRemoteConnection} for the given URI.
- * @param remoteConnectionType
- * the remote connection type
* @param hostUri
* the host URI to connect to
* @param hostName
*
* @throws RemoteConnectionException in case of an error
*/
- IRemoteConnection createConnection(IRemoteConnectionType remoteConnectionType, URI hostUri, String hostName) throws RemoteConnectionException;
+ IRemoteConnection createConnection(URI hostUri, String hostName) throws RemoteConnectionException;
}
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnectionChangeListener;
-import org.eclipse.remote.core.IRemoteConnectionType;
-import org.eclipse.remote.core.IRemoteServicesManager;
import org.eclipse.remote.core.RemoteConnectionChangeEvent;
import org.eclipse.remote.core.exception.RemoteConnectionException;
-import org.eclipse.tracecompass.internal.tmf.remote.core.Activator;
import org.eclipse.tracecompass.internal.tmf.remote.core.shell.CommandShell;
import org.eclipse.tracecompass.tmf.remote.core.shell.ICommandShell;
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.collect.FluentIterable;
-
/**
* <p>
* RemoteSystemProxy implementation.
@NonNullByDefault
public class RemoteSystemProxy implements IRemoteConnectionChangeListener {
- /** Name of a local connection */
- public static final String LOCAL_CONNECTION_NAME = "Local"; //$NON-NLS-1$
-
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
}
}
- /**
- * Return the OSGi service with the given service interface.
- *
- * @param service
- * service interface
- * @return the specified service or null if it's not registered
- */
- public static @Nullable <T> T getService(Class<T> service) {
- return Activator.getService(service);
- }
-
- /**
- * Return a remote connection using OSGI service.
- *
- * @param remoteServicesId
- * ID of remote service
- * @param name
- * name of connection
- * @return the corresponding remote connection or null
- */
- public static @Nullable IRemoteConnection getRemoteConnection(final String remoteServicesId, final String name) {
- IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class);
- if (manager == null) {
- return null;
- }
- FluentIterable<IRemoteConnection> connections = FluentIterable.from(manager.getAllRemoteConnections());
- Optional<IRemoteConnection> ret = connections.firstMatch(new Predicate<IRemoteConnection>() {
- @Override
- public boolean apply(@Nullable IRemoteConnection input) {
- return ((input != null) && input.getConnectionType().getId().equals(remoteServicesId.toString()) && input.getName().equals(name.toString()));
- }
- });
- return ret.orNull();
- }
-
- /**
- * Return a Local connection.
- *
- * @return the local connection
- */
- public static @Nullable IRemoteConnection getLocalConnection() {
- IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class);
- if (manager != null) {
- IRemoteConnectionType type = manager.getLocalConnectionType();
- return type.getConnection(LOCAL_CONNECTION_NAME);
- }
- return null;
- }
}
import java.util.Map;
import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnectionHostService;
import org.eclipse.remote.core.IRemoteConnectionType;
import org.eclipse.remote.core.IRemoteServicesManager;
import org.eclipse.remote.core.exception.RemoteConnectionException;
import org.eclipse.remote.internal.jsch.core.JSchConnection;
+import org.eclipse.tracecompass.internal.tmf.remote.core.Activator;
import org.eclipse.tracecompass.internal.tmf.remote.core.messages.Messages;
+import com.google.common.base.Optional;
+import com.google.common.base.Predicate;
+import com.google.common.collect.FluentIterable;
+
/**
* Factory for creation of remote connections programmatically.
*
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
+ /** Name of a local connection */
+ public static final String LOCAL_CONNECTION_NAME = "Local"; //$NON-NLS-1$
+
private static final Map<String, IConnectionFactory> CONNECTION_FACTORIES = new HashMap<>();
private static final DefaultConnectionFactory DEFAULT_CONNECTION_FACTORY = new DefaultConnectionFactory();
static {
// Add local services
- IRemoteServicesManager manager = RemoteSystemProxy.getService(IRemoteServicesManager.class);
+ IRemoteServicesManager manager = getService(IRemoteServicesManager.class);
if (manager != null) {
CONNECTION_FACTORIES.put(manager.getLocalConnectionType().getId(), new LocalConnectionFactory());
}
*/
public static IRemoteConnection createConnection(URI hostUri, String hostName) throws RemoteConnectionException {
- IRemoteConnection connection = null;
- IRemoteServicesManager manager = RemoteSystemProxy.getService(IRemoteServicesManager.class);
- if (manager == null) {
- throw new RemoteConnectionException(MessageFormat.format(Messages.RemoteConnection_ConnectionError, hostUri));
- }
- IRemoteConnectionType connectionType = manager.getConnectionType(hostUri);
- if (connectionType == null) {
- throw new RemoteConnectionException(MessageFormat.format(Messages.RemoteConnection_ConnectionError, hostUri));
- }
-
+ IRemoteConnectionType connectionType = getConnectionType(hostUri);
IConnectionFactory connectionFactory = CONNECTION_FACTORIES.get(connectionType.getId());
- // Create a new connection
- if (connectionFactory != null) {
- connection = connectionFactory.createConnection(connectionType, hostUri, hostName);
- } else {
- connection = DEFAULT_CONNECTION_FACTORY.createConnection(connectionType, hostUri, hostName);
+ if (connectionFactory == null) {
+ connectionFactory = DEFAULT_CONNECTION_FACTORY;
}
-
- return connection;
+ // Create and return a new connection
+ return connectionFactory.createConnection(hostUri, hostName);
}
// ------------------------------------------------------------------------
public static class DefaultConnectionFactory implements IConnectionFactory {
@Override
- public IRemoteConnection createConnection(IRemoteConnectionType connectionType, URI hostUri, String hostName) throws RemoteConnectionException {
+ public IRemoteConnection createConnection(URI hostUri, String hostName) throws RemoteConnectionException {
+
+ IRemoteConnectionType connectionType = getConnectionType(hostUri);
+
IRemoteConnection connection = null;
+
// Look for existing connections
for (IRemoteConnection conn : connectionType.getConnections()) {
if (conn.getName().equals(hostName)) {
*/
public static class LocalConnectionFactory implements IConnectionFactory {
@Override
- public IRemoteConnection createConnection(IRemoteConnectionType connectionType, URI hostUri, String hostName) throws RemoteConnectionException {
- IRemoteConnection connection = RemoteSystemProxy.getLocalConnection();
+ public IRemoteConnection createConnection(URI hostUri, String hostName) throws RemoteConnectionException {
+ IRemoteConnection connection = getLocalConnection();
if (connection == null) {
throw new RemoteConnectionException(MessageFormat.format(Messages.RemoteConnection_ConnectionError, hostUri));
}
}
}
+ // ------------------------------------------------------------------------
+ // Helper method(s)
+ // ------------------------------------------------------------------------
+ private static IRemoteConnectionType getConnectionType(URI hostUri) throws RemoteConnectionException {
+ IRemoteServicesManager manager = getService(IRemoteServicesManager.class);
+ if (manager == null) {
+ throw new RemoteConnectionException(MessageFormat.format(Messages.RemoteConnection_ConnectionError, hostUri));
+ }
+ IRemoteConnectionType connectionType = manager.getConnectionType(hostUri);
+ if (connectionType == null) {
+ throw new RemoteConnectionException(MessageFormat.format(Messages.RemoteConnection_ConnectionError, hostUri));
+ }
+ return connectionType;
+ }
+
+ // ------------------------------------------------------------------------
+ // Helper methods using OSGI service
+ // ------------------------------------------------------------------------
+ /**
+ * Return the OSGi service with the given service interface.
+ *
+ * @param service
+ * service interface
+ * @return the specified service or null if it's not registered
+ */
+ public static @Nullable <T> T getService(Class<T> service) {
+ return Activator.getService(service);
+ }
+
+ /**
+ * Return a remote connection using OSGI service.
+ *
+ * @param remoteServicesId
+ * ID of remote service
+ * @param name
+ * name of connection
+ * @return the corresponding remote connection or null
+ */
+ public static @Nullable IRemoteConnection getRemoteConnection(final String remoteServicesId, final String name) {
+ IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class);
+ if (manager == null) {
+ return null;
+ }
+ FluentIterable<IRemoteConnection> connections = FluentIterable.from(manager.getAllRemoteConnections());
+ Optional<IRemoteConnection> ret = connections.firstMatch(new Predicate<IRemoteConnection>() {
+ @Override
+ public boolean apply(@Nullable IRemoteConnection input) {
+ return ((input != null) && input.getConnectionType().getId().equals(remoteServicesId.toString()) && input.getName().equals(name.toString()));
+ }
+ });
+ return ret.orNull();
+ }
+
+ /**
+ * Return a Local connection.
+ *
+ * @return the local connection
+ */
+ public static @Nullable IRemoteConnection getLocalConnection() {
+ IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class);
+ if (manager != null) {
+ IRemoteConnectionType type = manager.getLocalConnectionType();
+ return type.getConnection(LOCAL_CONNECTION_NAME);
+ }
+ return null;
+ }
+
}
import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.tracepkg.TracePackageFilesElement;
import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.tracepkg.TracePackageTraceElement;
import org.eclipse.tracecompass.tmf.core.project.model.TmfTraceType;
-import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
+import org.eclipse.tracecompass.tmf.remote.core.proxy.TmfRemoteConnectionFactory;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchCommandConstants;
}
try {
URI uri = URIUtil.fromString(node.getURI());
- IRemoteServicesManager manager = RemoteSystemProxy.getService(IRemoteServicesManager.class);
+ IRemoteServicesManager manager = TmfRemoteConnectionFactory.getService(IRemoteServicesManager.class);
if (manager == null || manager.getConnectionType(uri) == null) {
setErrorMessage(prefix + RemoteMessages.RemoteProfilesPreferencePage_UnsupportedURISchemeError);
return;