Remote System Explorer DataStore
Release 3.4

org.eclipse.dstore.core.client
Class ClientConnection

java.lang.Object
  extended by org.eclipse.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 CANNOT_CONNECT
               
    static String CLIENT_OLDER
               
    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, IDomainNotifier notifier)
              Creates a new ClientConnection instance
    ClientConnection(String name, IDomainNotifier notifier, int initialSize)
              Creates a new ClientConnection instance
    ClientConnection(String name, int initialSize)
              Creates a new ClientConnection instance
     
    Method Summary
     void addLoader(IExternalLoader 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)
               
     ConnectionStatus connectDaemon(int daemonPort, int timeout)
              Connect to a remote daemon
     void disconnect()
              Disconnects from the DataStore and cleans up DataStore meta-information
    protected  ConnectionStatus doConnect(String ticket)
               
     int getClientMinor()
               
     int getClientVersion()
               
     IDataStoreCompatibilityHandler getCompatibilityHandler()
               
     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
     Socket getLaunchSocket()
              Reeturns the launch socket
     String getPort()
              Returns the number of the socket port to connect to
     int getServerMinor()
               
     int getServerVersion()
               
     IDataStoreTrustManager getTrustManager()
               
     boolean isConnected()
              Indicates whether the client is connected to the DataStore
     boolean isKnownStatus(String status)
               
     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 launchServer(String user, String password, int daemonPort, int timeout)
               
     ConnectionStatus localConnect()
              Creates and connects to a local DataStore to work with in the current process.
     void setCompatibilityHandler(IDataStoreCompatibilityHandler handler)
               
     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)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    INCOMPATIBLE_SERVER_UPDATE

    public static final String INCOMPATIBLE_SERVER_UPDATE
    See Also:
    Constant Field Values

    INCOMPATIBLE_CLIENT_UPDATE

    public static final String INCOMPATIBLE_CLIENT_UPDATE
    See Also:
    Constant Field Values

    SERVER_OLDER

    public static final String SERVER_OLDER
    See Also:
    Constant Field Values

    CLIENT_OLDER

    public static final String CLIENT_OLDER
    See Also:
    Constant Field Values

    INCOMPATIBLE_PROTOCOL

    public static final String INCOMPATIBLE_PROTOCOL
    See Also:
    Constant Field Values

    CANNOT_CONNECT

    public static final String CANNOT_CONNECT
    See Also:
    Constant Field Values
    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,
                            IDomainNotifier 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
    Since:
    3.0 changed DomainNotifier into IDomainNotifier

    ClientConnection

    public ClientConnection(String name,
                            IDomainNotifier 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
    Since:
    3.0 changed DomainNotifier into IDomainNotifier
    Method Detail

    getClientVersion

    public int getClientVersion()

    getClientMinor

    public int getClientMinor()

    getServerVersion

    public int getServerVersion()

    getServerMinor

    public int getServerMinor()

    setSSLProperties

    public void setSSLProperties(ISSLProperties properties)

    setCompatibilityHandler

    public void setCompatibilityHandler(IDataStoreCompatibilityHandler handler)
    Since:
    3.0 changed DataStoreCompatibilityHandler into IDataStoreCompatibilityHandler

    getCompatibilityHandler

    public IDataStoreCompatibilityHandler getCompatibilityHandler()
    Since:
    3.0 changed DataStoreCompatibilityHandler into IDataStoreCompatibilityHandler

    setLoaders

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

    Parameters:
    loaders - the loaders

    addLoader

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

    Parameters:
    loader - the loader
    Since:
    3.0 changed ExternalLoader into IExternalLoader

    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 IDataStoreTrustManager getTrustManager()
    Since:
    3.0 changed DataStoreTrustManager into IDataStoreTrustManager

    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

    launchServer

    public ConnectionStatus launchServer(String user,
                                         String password,
                                         int daemonPort,
                                         int timeout)

    connectDaemon

    public ConnectionStatus connectDaemon(int daemonPort,
                                          int timeout)
    Connect to a remote daemon

    Parameters:
    daemonPort - the port of the daemon
    Returns:
    the status of the connection
    Since:
    3.0

    getLaunchSocket

    public Socket getLaunchSocket()
    Reeturns the launch socket

    Returns:
    the launch socket

    getDataStore

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

    Returns:
    the DataStore

    isKnownStatus

    public boolean isKnownStatus(String status)

    Remote System Explorer DataStore
    Release 3.4

    Copyright (c) IBM Corporation and others 2000, 2012. All Rights Reserved.