Package org.eclipse.remote.core
Interface IRemoteConnection
-
- All Known Subinterfaces:
IRemoteConnectionWorkingCopy
public interface IRemoteConnectionRepresents 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 Classes Modifier and Type Interface Description static interfaceIRemoteConnection.ServiceThe interface that is extend by services provided for this remote connection.
-
Field Summary
Fields Modifier and Type Field Description static StringFILE_SEPARATOR_PROPERTYstatic StringLINE_SEPARATOR_PROPERTYstatic StringLOCALE_CHARMAP_PROPERTYstatic StringOS_ARCH_PROPERTYstatic StringOS_NAME_PROPERTYstatic StringOS_VERSION_PROPERTYstatic StringPATH_SEPARATOR_PROPERTYstatic StringUSER_HOME_PROPERTY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddConnectionChangeListener(IRemoteConnectionChangeListener listener)Register a listener that will be notified when this connection's status changes.voidclose()Close the connection.voidfireConnectionChangeEvent(int type)Notify all listeners when this connection's status changes.StringgetAttribute(String key)Get an attribute for a connection.IRemoteConnectionTypegetConnectionType()Get the connection type of this connectionStringgetName()Get unique name for this connection.StringgetProperty(String key)Gets the remote system property indicated by the specified key.StringgetSecureAttribute(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.IRemoteConnectionWorkingCopygetWorkingCopy()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.booleanisOpen()Test if the connection is open.voidopen(org.eclipse.core.runtime.IProgressMonitor monitor)Open the connection.voidremoveConnectionChangeListener(IRemoteConnectionChangeListener listener)Remove a listener that will be notified when this connection's status changes.
-
-
-
Field Detail
-
OS_NAME_PROPERTY
static final String OS_NAME_PROPERTY
- See Also:
- Constant Field Values
-
OS_VERSION_PROPERTY
static final String OS_VERSION_PROPERTY
- See Also:
- Constant Field Values
-
OS_ARCH_PROPERTY
static final String OS_ARCH_PROPERTY
- See Also:
- Constant Field Values
-
FILE_SEPARATOR_PROPERTY
static final String FILE_SEPARATOR_PROPERTY
- See Also:
- Constant Field Values
-
PATH_SEPARATOR_PROPERTY
static final String PATH_SEPARATOR_PROPERTY
- See Also:
- Constant Field Values
-
LINE_SEPARATOR_PROPERTY
static final String LINE_SEPARATOR_PROPERTY
- See Also:
- Constant Field Values
-
USER_HOME_PROPERTY
static final String USER_HOME_PROPERTY
- See Also:
- Constant Field Values
-
LOCALE_CHARMAP_PROPERTY
static final String LOCALE_CHARMAP_PROPERTY
- Since:
- 2.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
<T extends IRemoteConnection.Service> T getService(Class<T> service)
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
<T extends IRemoteConnection.Service> boolean hasService(Class<T> service)
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
void open(org.eclipse.core.runtime.IProgressMonitor monitor) throws RemoteConnectionException
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
String getProperty(String key)
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
String getAttribute(String key)
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
String getSecureAttribute(String key)
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
void addConnectionChangeListener(IRemoteConnectionChangeListener listener)
Register a listener that will be notified when this connection's status changes.- Parameters:
listener-
-
removeConnectionChangeListener
void removeConnectionChangeListener(IRemoteConnectionChangeListener listener)
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 {RemoteConnectionChangeEventfor a list of event types.- Parameters:
event- event type indicating the nature of the event
-
-