Remote Systems
v6.4.1

com.ibm.etools.systems.dstore.core.client
Class ClientConnection

java.lang.Object
  extended bycom.ibm.etools.systems.dstore.core.client.ClientConnection

public class ClientConnection
extends Object

ClientConnection provides the standard means of creating a new connection to a DataStore.

  • If a connection is local, then a DataStore is instantiated in the same process to be used by the client to communicate with miners (tools).
  • If a connection is not local, then a virtual DataStore is instantiated in the current process to communicate with the remote DataStore. If the client wishes to instantiate a remote DataStore through a daemon, then ClientConnection first connects to the daemon requesting a DataStore at a given port, and then connects to the newly launched DataStore. Otherwise, a DataStore is expected to be running on the remote machine under the same port that the client tries to connect to.

  • Field Summary
    static String CLIENT_OLDER
               
    static String Copyright
               
    static String INCOMPATIBLE_CLIENT_UPDATE
               
    static String INCOMPATIBLE_PROTOCOL
               
    static String INCOMPATIBLE_SERVER_UPDATE
               
    static String SERVER_OLDER
               
     
    Constructor Summary
    ClientConnection(String name)
              Creates a new ClientConnection instance
    ClientConnection(String name, DomainNotifier notifier)
              Creates a new ClientConnection instance
    ClientConnection(String name, DomainNotifier notifier, int initialSize)
              Creates a new ClientConnection instance
    ClientConnection(String name, int initialSize)
              Creates a new ClientConnection instance
     
    Method Summary
     void addLoader(ExternalLoader loader)
              Adds a loader to be used to instantiate the miners
     ConnectionStatus connect(boolean launchServer, String user, String password)
              Connects to a remote DataStore by first communicating with a remote daemon and then connecting to the DataStore.
     ConnectionStatus connect(String ticket)
              Connects to a remote DataStore.
     ConnectionStatus connect(String ticket, int timeout)
               
     void disconnect()
              Disconnects from the DataStore and cleans up DataStore meta-information
    protected  ConnectionStatus doConnect(String ticket)
               
     DataStore getDataStore()
              Returns the DataStore that the client is connected to.
     String getHost()
              Returns the hostname/IP of the host to connect to
     String getHostDirectory()
              Returns the default working directory on the host machine
     String getPort()
              Returns the number of the socket port to connect to
     DataStoreTrustManager getTrustManager()
               
     boolean isConnected()
              Indicates whether the client is connected to the DataStore
     ConnectionStatus launchServer(String user, String password)
              Connects to a remote daemon and tells the daemon to launch a DataStore server.
     ConnectionStatus launchServer(String user, String password, int daemonPort)
              Connects to a remote daemon and tells the daemon to launch a DataStore server.
     ConnectionStatus localConnect()
              Creates and connects to a local DataStore to work with in the current process.
     void setHost(String host)
              Specifies the hostname or IP of the host to connect to
     void setHostDirectory(String directory)
              Specifies the default working directory on the remote machine
     void setLoaders(ArrayList loaders)
              Specifies the loaders used to instantiate the miners
     void setPort(String port)
              Specifies the number of the socket port to connect to
     void setSSLProperties(ISSLProperties properties)
               
     void setUsingSSL(boolean flag)
              Deprecated.  
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    Copyright

    public static final String Copyright
    See Also:
    Constant Field Values

    INCOMPATIBLE_SERVER_UPDATE

    public static String INCOMPATIBLE_SERVER_UPDATE

    INCOMPATIBLE_CLIENT_UPDATE

    public static String INCOMPATIBLE_CLIENT_UPDATE

    SERVER_OLDER

    public static String SERVER_OLDER

    CLIENT_OLDER

    public static String CLIENT_OLDER

    INCOMPATIBLE_PROTOCOL

    public static String INCOMPATIBLE_PROTOCOL
    Constructor Detail

    ClientConnection

    public ClientConnection(String name)
    Creates a new ClientConnection instance

    Parameters:
    name - an identifier for this connection

    ClientConnection

    public ClientConnection(String name,
                            int initialSize)
    Creates a new ClientConnection instance

    Parameters:
    name - an identifier for this connection
    initialSize - the number of elements to preallocate in the DataStore

    ClientConnection

    public ClientConnection(String name,
                            DomainNotifier notifier)
    Creates a new ClientConnection instance

    Parameters:
    name - an identifier for this connection
    notifier - the notifier used to keep the user interface in synch with the DataStore

    ClientConnection

    public ClientConnection(String name,
                            DomainNotifier notifier,
                            int initialSize)
    Creates a new ClientConnection instance

    Parameters:
    name - an identifier for this connection
    notifier - the notifier used to keep the user interface in synch with the DataStore
    initialSize - the number of elements to preallocate in the DataStore
    Method Detail

    setSSLProperties

    public void setSSLProperties(ISSLProperties properties)

    setUsingSSL

    public void setUsingSSL(boolean flag)
    Deprecated.  

    FIXME this will be removed - it's only here for backward compat Indicates to use SSL for socket communication

    Parameters:
    flag - whether to use SSL or not

    setLoaders

    public void setLoaders(ArrayList loaders)
    Specifies the loaders used to instantiate the miners

    Parameters:
    loaders - the loaders

    addLoader

    public void addLoader(ExternalLoader loader)
    Adds a loader to be used to instantiate the miners

    Parameters:
    loader - the loader

    setHost

    public void setHost(String host)
    Specifies the hostname or IP of the host to connect to

    Parameters:
    host - the hostname or IP of the machine to connect to

    setPort

    public void setPort(String port)
    Specifies the number of the socket port to connect to

    Parameters:
    port - the number of the socket port to connect to

    setHostDirectory

    public void setHostDirectory(String directory)
    Specifies the default working directory on the remote machine

    Parameters:
    directory - the remote working directory

    getHost

    public String getHost()
    Returns the hostname/IP of the host to connect to

    Returns:
    the hostname/IP

    getPort

    public String getPort()
    Returns the number of the socket port to connect to

    Returns:
    the number of the socket port to connect to

    getHostDirectory

    public String getHostDirectory()
    Returns the default working directory on the host machine

    Returns:
    the working directory on the host

    isConnected

    public boolean isConnected()
    Indicates whether the client is connected to the DataStore

    Returns:
    whether the client is connected

    disconnect

    public void disconnect()
    Disconnects from the DataStore and cleans up DataStore meta-information


    localConnect

    public ConnectionStatus localConnect()
    Creates and connects to a local DataStore to work with in the current process.

    Returns:
    the status of the DataStore connection

    connect

    public ConnectionStatus connect(boolean launchServer,
                                    String user,
                                    String password)
    Connects to a remote DataStore by first communicating with a remote daemon and then connecting to the DataStore.

    Parameters:
    launchServer - an indication of whether to launch a DataStore on the daemon on not
    user - the user ID of the current user on the remote machine
    password - the password of the current user on the remote machine
    Returns:
    the status of the connection

    getTrustManager

    public DataStoreTrustManager getTrustManager()

    connect

    public ConnectionStatus connect(String ticket)
    Connects to a remote DataStore. A socket is created and the virtual DataStore is initialized with an update handler, command handler, socket sender and socket receiver.

    Parameters:
    ticket - the ticket required to be granted access to the remote DataStore
    Returns:
    the status of the connection

    connect

    public ConnectionStatus connect(String ticket,
                                    int timeout)

    doConnect

    protected ConnectionStatus doConnect(String ticket)

    launchServer

    public ConnectionStatus launchServer(String user,
                                         String password)
    Connects to a remote daemon and tells the daemon to launch a DataStore server.

    Parameters:
    user - the user ID of the current user on the remote machine
    password - the password of the current user on the remote machine
    Returns:
    the status of the connection

    launchServer

    public ConnectionStatus launchServer(String user,
                                         String password,
                                         int daemonPort)
    Connects to a remote daemon and tells the daemon to launch a DataStore server.

    Parameters:
    user - the user ID of the current user on the remote machine
    password - the password of the current user on the remote machine
    daemonPort - the port of the daemon
    Returns:
    the status of the connection

    getDataStore

    public DataStore getDataStore()
    Returns the DataStore that the client is connected to.

    Returns:
    the DataStore

    Remote Systems
    v6.4.1

    Copyright © 2005 IBM Corp. All Rights Reserved.

    Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.