This section describes the main concepts and services implemented by the Eclipse remote framework.
Some few concepts are needed to understand the framework's services overall. They are described in the next sections.
An connection type (IRemoteConnectionType
) abstracts a remote protocol to host access. As of version 2.0.1, the framework provides the ssh (implemented through JSch framework), Telnet and Local types.
The connection type is obtained from the remote services manager either by passing its scheme ID (Identification) or an URI.
It has the newConnection
method where a new connection of this type is created. It also holds the list of all connections already created that belongs to it.
The remote connection (IRemoteConnection
) interface is used to manage a connection to a single remote host. A connection must be established (open) before any other operations are permitted. All operations carried out on remote host should be evoked from its associated services, which are get with getService
method.
Connections are read-only objects. In order to change the attributes of a connection, a working copy (IRemoteConnectionWorkingCopy
) must be created. The host attributes getters and setters can also be managed with connection host service (IRemoteConnectionHostService
).
Every remote connection belongs to a connection type.
The remote resource interface (IRemoteResource
) provides an adapter to a remote resource.
As of version 2.0.1, there are two types of remote resources: fully remote and synchronized. This interface provides a common mechanism for accessing resource information from either types.
The process builder (IRemoteProcessBuilder
) provides process operations on the remote host. This interface is intended to be a drop-in replacement for the Java SE ProcessBuilder
class. See the java.lang.ProcessBuilder
documentation for a description of the methods.
It is obtained from the process service (see IRemoteProcessService
below) associated with a connection object that holds access information to the remote host.
The remote process (IRemoteProcess
) represents a process running on the remote host. Use it to manage the process (destroy), get exit status, and input/output/error streams.
Remote process are created using the IRemoteProcessBuilder
interface.
The remote services are implemented as OSGi services. There are available non-UI (core) and UI services.
Any given service can be associated with objects of the model (concepts) or nested to another one. In either case, an service instance is obtained by calling the getService
method of its object's provider.
The main remote services are detailed in the next sections.
The services manager (IRemoteServicesManager
) interface provides the main entry point for accessing remote services. It can be obtained by calling RemoteServicesUtils.getService(IRemoteServicesManager.class)
or using the Plugin's bundle context to access a OSGi service.
It provides access to connection types implemented by the framework and any connection already created.
The file service (IRemoteFileService
) provides remote file manipulation operations on a given connection. It is obtained from a remote connection object by calling its getService(IRemoteFileService.class)
method.
Using this interface, a path can be translated into an IFileStore
object, and then manipulated using any of the normal EFS operations.
Its UI counterpart service (IRemoteUIFileService
) comes with dialog widgets to browse files and directories on remote filesystem.
The process service (IRemoteProcessService
) provides services for starting up processes on a remote host. It is obtained from a remote connection object by calling its getService(IRemoteProcessService.class)
method.
It is the entry point to get an IRemoteProcessBuilder
object, used to spawn processes on the remote host. Environment variables of remote host are accessed using this service too.
The UI Connection service (IRemoteUIConnectionService
) is used for manipulating connections in the UI, such as adding, editing, and opening connections.
Non-UI connection manipulation should use the IRemoteConnectionType
interface (obtained from services manager) and the services related with IRemoteConnection
interface.