org.eclipse.ecf.provider.comm
Interface IConnection

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
All Known Subinterfaces:
IAsynchConnection, ISynchAsynchConnection, ISynchConnection
All Known Implementing Classes:
Client, SSLClient

public interface IConnection
extends org.eclipse.core.runtime.IAdaptable

Connection interface to represent transport-level connections


Method Summary
 void addListener(IConnectionListener listener)
          Add comm layer event listener
 java.lang.Object connect(ID targetID, java.lang.Object data, int timeout)
          Connect to a remote process
 void disconnect()
          Disconnect
 ID getLocalID()
          Get local ID for this connection
 java.util.Map getProperties()
          Get properties for this connection
 boolean isConnected()
           
 boolean isStarted()
           
 void removeListener(IConnectionListener listener)
          remove comm layer event listener
 void start()
          Start connection
 void stop()
          Stop connection
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Method Detail

connect

java.lang.Object connect(ID targetID,
                         java.lang.Object data,
                         int timeout)
                         throws ECFException
Connect to a remote process

Parameters:
targetID - the identity of the remote to connect to. Must not be null.
data - any data to send with the connection request (e.g. password or other authentication data)
timeout - the timeout (in ms) for the connection to occur
Returns:
a result object that is of type specific to provider implementation
Throws:
ECFException - thrown if some problem with connect

disconnect

void disconnect()
Disconnect


isConnected

boolean isConnected()
Returns:
true if the implementing class has been previously connected, false if not connected

getLocalID

ID getLocalID()
Get local ID for this connection

Returns:
ID associated with local instance

start

void start()
Start connection


stop

void stop()
Stop connection


isStarted

boolean isStarted()
Returns:
true if connection is started, false otherwise

getProperties

java.util.Map getProperties()
Get properties for this connection

Returns:
Map the properties associated with this connection. May be null.

addListener

void addListener(IConnectionListener listener)
Add comm layer event listener

Parameters:
listener - the listener to add

removeListener

void removeListener(IConnectionListener listener)
remove comm layer event listener

Parameters:
listener - the listener to remove