public class RemoteConnection extends java.lang.Object implements IRemoteConnection
IRemoteConnection.Service
FILE_SEPARATOR_PROPERTY, LINE_SEPARATOR_PROPERTY, LOCALE_CHARMAP_PROPERTY, OS_ARCH_PROPERTY, OS_NAME_PROPERTY, OS_VERSION_PROPERTY, PATH_SEPARATOR_PROPERTY, USER_HOME_PROPERTY
Constructor and Description |
---|
RemoteConnection(RemoteConnectionType connectionType,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionChangeListener(IRemoteConnectionChangeListener listener)
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.
|
java.lang.String |
getAttribute(java.lang.String key)
Get an attribute for a connection.
|
IRemoteConnectionType |
getConnectionType()
Get the connection type of this connection
|
java.lang.String |
getName()
Get unique name for this connection.
|
java.lang.String |
getProperty(java.lang.String key)
Gets the remote system property indicated by the specified key.
|
java.lang.String |
getSecureAttribute(java.lang.String key)
Get an attribute that is stored in secure storage, such as passwords.
|
<T extends IRemoteConnection.Service> |
getService(java.lang.Class<T> service)
Get the service for this remote connection that implements the given interface.
|
IRemoteConnectionWorkingCopy |
getWorkingCopy()
Return a working copy to allow setting and changing of attributes.
|
<T extends IRemoteConnection.Service> |
hasService(java.lang.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 |
removeConnectionChangeListener(IRemoteConnectionChangeListener listener)
Remove a listener that will be notified when this connection's status changes.
|
java.lang.String |
toString() |
public RemoteConnection(RemoteConnectionType connectionType, java.lang.String name)
public IRemoteConnectionType getConnectionType()
IRemoteConnection
getConnectionType
in interface IRemoteConnection
public <T extends IRemoteConnection.Service> T getService(java.lang.Class<T> service)
IRemoteConnection
getService
in interface IRemoteConnection
service
- the interface the required service must implementspublic <T extends IRemoteConnection.Service> boolean hasService(java.lang.Class<T> service)
IRemoteConnection
hasService
in interface IRemoteConnection
service
- The service to be testedpublic java.lang.String getName()
IRemoteConnection
getName
in interface IRemoteConnection
public java.lang.String getAttribute(java.lang.String key)
IRemoteConnection
getAttribute
in interface IRemoteConnection
public java.lang.String getSecureAttribute(java.lang.String key)
IRemoteConnection
getSecureAttribute
in interface IRemoteConnection
public IRemoteConnectionWorkingCopy getWorkingCopy()
IRemoteConnection
getWorkingCopy
in interface IRemoteConnection
public java.lang.String getProperty(java.lang.String key)
IRemoteConnection
getProperty
in interface IRemoteConnection
key
- the name of the propertypublic void open(org.eclipse.core.runtime.IProgressMonitor monitor) throws RemoteConnectionException
IRemoteConnection
open
in interface IRemoteConnection
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.RemoteConnectionException
public void close()
IRemoteConnection
close
in interface IRemoteConnection
public boolean isOpen()
IRemoteConnection
isOpen
in interface IRemoteConnection
public void addConnectionChangeListener(IRemoteConnectionChangeListener listener)
IRemoteConnection
addConnectionChangeListener
in interface IRemoteConnection
public void removeConnectionChangeListener(IRemoteConnectionChangeListener listener)
IRemoteConnection
removeConnectionChangeListener
in interface IRemoteConnection
public void fireConnectionChangeEvent(int type)
IRemoteConnection
RemoteConnectionChangeEvent
for a list of event
types.fireConnectionChangeEvent
in interface IRemoteConnection
public java.lang.String toString()
toString
in class java.lang.Object