public class RemoteConnectionWorkingCopy extends java.lang.Object implements IRemoteConnectionWorkingCopy
IRemoteConnection.ServiceFILE_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 |
|---|
RemoteConnectionWorkingCopy(RemoteConnection original)
Edit Connection
|
RemoteConnectionWorkingCopy(RemoteConnectionType connectionType,
java.lang.String name)
New Connection.
|
| 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.
|
IRemoteConnection |
getOriginal()
Returns the original connection this working copy was created from.
|
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 |
isDirty()
Returns whether this connection has been modified since it was last saved or created.
|
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.
|
IRemoteConnection |
save()
Saves this working copy to its original connection and returns a handle to the resulting connection.
|
void |
setAttribute(java.lang.String key,
java.lang.String value)
Set an implementation dependent attribute for the connection.
|
void |
setName(java.lang.String name)
Set the name for this connection
|
void |
setSecureAttribute(java.lang.String key,
java.lang.String value)
Set an attribute such as a password that's stored in secure storage.
|
public RemoteConnectionWorkingCopy(RemoteConnectionType connectionType, java.lang.String name)
public RemoteConnectionWorkingCopy(RemoteConnection original)
public java.lang.String getName()
IRemoteConnectiongetName in interface IRemoteConnectionpublic void setName(java.lang.String name)
IRemoteConnectionWorkingCopysetName in interface IRemoteConnectionWorkingCopypublic java.lang.String getAttribute(java.lang.String key)
IRemoteConnectiongetAttribute in interface IRemoteConnectionpublic void setAttribute(java.lang.String key,
java.lang.String value)
IRemoteConnectionWorkingCopy#getAttributes(). Attributes are persisted along with connection information.setAttribute in interface IRemoteConnectionWorkingCopykey - attribute keyvalue - attribute valuepublic java.lang.String getSecureAttribute(java.lang.String key)
IRemoteConnectiongetSecureAttribute in interface IRemoteConnectionpublic void setSecureAttribute(java.lang.String key,
java.lang.String value)
IRemoteConnectionWorkingCopysetSecureAttribute in interface IRemoteConnectionWorkingCopypublic void addConnectionChangeListener(IRemoteConnectionChangeListener listener)
IRemoteConnectionaddConnectionChangeListener in interface IRemoteConnectionpublic void removeConnectionChangeListener(IRemoteConnectionChangeListener listener)
IRemoteConnectionremoveConnectionChangeListener in interface IRemoteConnectionpublic void fireConnectionChangeEvent(int type)
IRemoteConnectionRemoteConnectionChangeEvent for a list of event
types.fireConnectionChangeEvent in interface IRemoteConnectionpublic IRemoteConnectionType getConnectionType()
IRemoteConnectiongetConnectionType in interface IRemoteConnectionpublic IRemoteConnectionWorkingCopy getWorkingCopy()
IRemoteConnectiongetWorkingCopy in interface IRemoteConnectionpublic <T extends IRemoteConnection.Service> T getService(java.lang.Class<T> service)
IRemoteConnectiongetService in interface IRemoteConnectionservice - the interface the required service must implementspublic <T extends IRemoteConnection.Service> boolean hasService(java.lang.Class<T> service)
IRemoteConnectionhasService in interface IRemoteConnectionservice - The service to be testedpublic IRemoteConnection getOriginal()
IRemoteConnectionWorkingCopygetOriginal in interface IRemoteConnectionWorkingCopypublic boolean isDirty()
IRemoteConnectionWorkingCopyisDirty in interface IRemoteConnectionWorkingCopypublic IRemoteConnection save() throws RemoteConnectionException
IRemoteConnectionWorkingCopysave in interface IRemoteConnectionWorkingCopyRemoteConnectionExceptionpublic void open(org.eclipse.core.runtime.IProgressMonitor monitor)
throws RemoteConnectionException
IRemoteConnectionopen in interface IRemoteConnectionmonitor - 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.RemoteConnectionExceptionpublic void close()
IRemoteConnectionclose in interface IRemoteConnectionpublic boolean isOpen()
IRemoteConnectionisOpen in interface IRemoteConnectionpublic java.lang.String getProperty(java.lang.String key)
IRemoteConnectiongetProperty in interface IRemoteConnectionkey - the name of the property