Package org.eclipse.remote.core
Interface IRemoteConnection
- All Known Subinterfaces:
IRemoteConnectionWorkingCopy
public interface IRemoteConnection
Represents a connection to a remote system. Use the getService method to get at connection
specific services. Connections have state, open or closed. Some connection types are always
open in which case the close does nothing. Connections have properties which are values that
describe the connection and are discovered. Connections also have attributes which are
client specified values that control the connection.
- Restriction:
- This interface is not intended to be implemented by clients.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
The interface that is extend by services provided for this remote connection. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Register a listener that will be notified when this connection's status changes.void
close()
Close the connection.void
fireConnectionChangeEvent
(int type) Notify all listeners when this connection's status changes.getAttribute
(String key) Get an attribute for a connection.Get the connection type of this connectiongetName()
Get unique name for this connection.getProperty
(String key) Gets the remote system property indicated by the specified key.getSecureAttribute
(String key) Get an attribute that is stored in secure storage, such as passwords.<T extends IRemoteConnection.Service>
TgetService
(Class<T> service) Get the service for this remote connection that implements the given interface.Return a working copy to allow setting and changing of attributes.<T extends IRemoteConnection.Service>
booleanhasService
(Class<T> service) Does this connection support the given service.boolean
isOpen()
Test if the connection is open.void
open
(org.eclipse.core.runtime.IProgressMonitor monitor) Open the connection.void
Remove a listener that will be notified when this connection's status changes.
-
Field Details
-
OS_NAME_PROPERTY
- See Also:
-
OS_VERSION_PROPERTY
- See Also:
-
OS_ARCH_PROPERTY
- See Also:
-
FILE_SEPARATOR_PROPERTY
- See Also:
-
PATH_SEPARATOR_PROPERTY
- See Also:
-
LINE_SEPARATOR_PROPERTY
- See Also:
-
USER_HOME_PROPERTY
- See Also:
-
LOCALE_CHARMAP_PROPERTY
- Since:
- 2.0
- See Also:
-
-
Method Details
-
getConnectionType
IRemoteConnectionType getConnectionType()Get the connection type of this connection- Returns:
- connection type
- Since:
- 2.0
-
getName
String getName()Get unique name for this connection.- Returns:
- connection name
-
getService
Get the service for this remote connection that implements the given interface.- Parameters:
service
- the interface the required service must implements- Returns:
- the desired service or null if there is no such service available
- Throws:
org.eclipse.core.runtime.CoreException
- Since:
- 2.0
-
hasService
Does this connection support the given service.- Parameters:
service
- The service to be tested- Returns:
- true if this connection supports the service
- Since:
- 2.0
-
open
Open the connection. Must be called before the connection can be used.- Parameters:
monitor
- the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done() on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot be cancelled.- Throws:
RemoteConnectionException
-
close
void close()Close the connection. Must be called to terminate the connection. -
isOpen
boolean isOpen()Test if the connection is open.- Returns:
- true if connection is open.
-
getProperty
Gets the remote system property indicated by the specified key. The connection must be open prior to calling this method.- Parameters:
key
- the name of the property- Returns:
- the string value of the property, or null if no property has that key
-
getAttribute
Get an attribute for a connection. NOTE: the attributes do not include any security related information (e.g. passwords, keys, etc.)- Parameters:
key
-- Returns:
- the attribute value, or empty string if not defined.
- Since:
- 2.0
-
getSecureAttribute
Get an attribute that is stored in secure storage, such as passwords.- Parameters:
key
-- Returns:
- the attribute value, or empty string if not defined.
- Since:
- 2.0
-
getWorkingCopy
IRemoteConnectionWorkingCopy getWorkingCopy()Return a working copy to allow setting and changing of attributes.- Returns:
- working copy of remote
-
addConnectionChangeListener
Register a listener that will be notified when this connection's status changes.- Parameters:
listener
-
-
removeConnectionChangeListener
Remove a listener that will be notified when this connection's status changes.- Parameters:
listener
-
-
fireConnectionChangeEvent
void fireConnectionChangeEvent(int type) Notify all listeners when this connection's status changes. See {RemoteConnectionChangeEvent
for a list of event types.- Parameters:
event
- event type indicating the nature of the event
-