public class RemoteConnectionWorkingCopy extends java.lang.Object implements IRemoteConnectionWorkingCopy
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 |
---|
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()
IRemoteConnection
getName
in interface IRemoteConnection
public void setName(java.lang.String name)
IRemoteConnectionWorkingCopy
setName
in interface IRemoteConnectionWorkingCopy
public java.lang.String getAttribute(java.lang.String key)
IRemoteConnection
getAttribute
in interface IRemoteConnection
public void setAttribute(java.lang.String key, java.lang.String value)
IRemoteConnectionWorkingCopy
#getAttributes()
. Attributes are persisted along with connection information.setAttribute
in interface IRemoteConnectionWorkingCopy
key
- attribute keyvalue
- attribute valuepublic java.lang.String getSecureAttribute(java.lang.String key)
IRemoteConnection
getSecureAttribute
in interface IRemoteConnection
public void setSecureAttribute(java.lang.String key, java.lang.String value)
IRemoteConnectionWorkingCopy
setSecureAttribute
in interface IRemoteConnectionWorkingCopy
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 IRemoteConnectionType getConnectionType()
IRemoteConnection
getConnectionType
in interface IRemoteConnection
public IRemoteConnectionWorkingCopy getWorkingCopy()
IRemoteConnection
getWorkingCopy
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 IRemoteConnection getOriginal()
IRemoteConnectionWorkingCopy
getOriginal
in interface IRemoteConnectionWorkingCopy
public boolean isDirty()
IRemoteConnectionWorkingCopy
isDirty
in interface IRemoteConnectionWorkingCopy
public IRemoteConnection save() throws RemoteConnectionException
IRemoteConnectionWorkingCopy
save
in interface IRemoteConnectionWorkingCopy
RemoteConnectionException
public 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 java.lang.String getProperty(java.lang.String key)
IRemoteConnection
getProperty
in interface IRemoteConnection
key
- the name of the property