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.

### Nested Class Summary

Nested Classes
`static interface` `IRemoteConnection.Service` The interface that is extend by services provided for this remote connection.

### Field Summary

Fields
`static java.lang.String` `FILE_SEPARATOR_PROPERTY`
`static java.lang.String` `LINE_SEPARATOR_PROPERTY`
`static java.lang.String` `LOCALE_CHARMAP_PROPERTY`
`static java.lang.String` `OS_ARCH_PROPERTY`
`static java.lang.String` `OS_NAME_PROPERTY`
`static java.lang.String` `OS_VERSION_PROPERTY`
`static java.lang.String` `PATH_SEPARATOR_PROPERTY`
`static java.lang.String` `USER_HOME_PROPERTY`

### Method Summary

All Methods Instance Methods Abstract Methods
`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> T` `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> boolean` `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.

### Field Detail

#### OS_NAME_PROPERTY

    static final java.lang.String OS_NAME_PROPERTY

See Also:
  Constant Field Values

#### OS_VERSION_PROPERTY

    static final java.lang.String OS_VERSION_PROPERTY

See Also:
  Constant Field Values

#### OS_ARCH_PROPERTY

    static final java.lang.String OS_ARCH_PROPERTY

See Also:
  Constant Field Values

#### FILE_SEPARATOR_PROPERTY

    static final java.lang.String FILE_SEPARATOR_PROPERTY

See Also:
  Constant Field Values

#### PATH_SEPARATOR_PROPERTY

    static final java.lang.String PATH_SEPARATOR_PROPERTY

See Also:
  Constant Field Values

#### LINE_SEPARATOR_PROPERTY

    static final java.lang.String LINE_SEPARATOR_PROPERTY

See Also:
  Constant Field Values

#### USER_HOME_PROPERTY

    static final java.lang.String USER_HOME_PROPERTY

See Also:
  Constant Field Values

#### LOCALE_CHARMAP_PROPERTY

    static final java.lang.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

    java.lang.String getName()

Get unique name for this connection.

Returns:
  connection name

#### getService

    <T extends IRemoteConnection.Service> T getService​(java.lang.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​(java.lang.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

    java.lang.String getProperty​(java.lang.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

    java.lang.String getAttribute​(java.lang.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

    java.lang.String getSecureAttribute​(java.lang.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 {`RemoteConnectionChangeEvent` for a list of event types.

Parameters:
  `event` - event type indicating the nature of the event