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.
Restriction:
This interface is not intended to be implemented by clients.
  • Field Details

  • Method Details

    • 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

      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