T-Plan Robot Enterprise 3.4
Build No. 3.4-20130322.1

com.tplan.robot.remoteclient
Class AbstractRemoteDesktopClient

java.lang.Object
  extended by com.tplan.robot.remoteclient.AbstractRemoteDesktopClient
All Implemented Interfaces:
Plugin, Capability, ImageOwner, RemoteDesktopClient
Direct Known Subclasses:
AdbClient, ImageClient, LocalJavaClient, RfbClientImpl

public abstract class AbstractRemoteDesktopClient
extends Object
implements RemoteDesktopClient, ImageOwner

Base abstract class for desktop clients which provides common infrastructure for server and client listeners.


T-Plan Robot Enterprise, (C) 2009-2013 T-Plan Limited. All rights reserved.


Field Summary
 
Fields inherited from interface com.tplan.robot.remoteclient.RemoteDesktopClient
LOGIN_PARAM_PASSWORD, LOGIN_PARAM_URI, LOGIN_PARAM_USER
 
Constructor Summary
AbstractRemoteDesktopClient()
           
 
Method Summary
 void addClientListener(RemoteDesktopClientListener listener)
          Add a client listener.
 void addServerListener(RemoteDesktopServerListener listener)
          Add a server listener to the client.
 void destroy()
          Destroy the client and make it ready for garbage collection.
protected  void fireRemoteClientEvent(RemoteDesktopClientEvent evt)
          Fire a client event to all registered listeners.
protected  void fireRemoteServerEvent(RemoteDesktopServerEvent evt)
          Fire a server event to all registered listeners.
 boolean isActivelyUpdating()
          The client is by default considered passive (the method returns false).
 boolean isConnectedTo(String connectString)
          Test whether this client is connected to a desktop identified by a particular URL (connect string).
 boolean isStatic()
          The client is by default considered dynamic (the method returns false).
 void removeClientListener(RemoteDesktopClientListener listener)
          Remove an object from the list of client listeners.
 void removeServerListener(RemoteDesktopServerListener listener)
          Remove an object from the list of server listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tplan.robot.remoteclient.RemoteDesktopClient
close, connect, getConnectString, getDefaultPort, getDesktopHeight, getDesktopName, getDesktopWidth, getHost, getImage, getLastMouseEvent, getLoginParamsSpecification, getPassword, getPort, getProtocol, getUser, hasSufficientConnectInfo, isConnected, isConnecting, isConsoleMode, isLocalDisplay, sendClientCutText, setConsoleMode, setLoginParams
 
Methods inherited from interface com.tplan.robot.plugin.Plugin
checkDependencies, getCode, getDate, getDescription, getDisplayName, getImplementedInterface, getLowestSupportedVersion, getMessageAfterInstall, getMessageBeforeInstall, getSupportContact, getUniqueId, getVendorHomePage, getVendorName, getVersion, requiresRestart
 

Constructor Detail

AbstractRemoteDesktopClient

public AbstractRemoteDesktopClient()
Method Detail

addServerListener

public void addServerListener(RemoteDesktopServerListener listener)
Add a server listener to the client. Each registered listener will receive an event whenever a server message is received.

Specified by:
addServerListener in interface RemoteDesktopClient
Parameters:
listener - an object implementing the RemoteServerListener interface.

removeServerListener

public void removeServerListener(RemoteDesktopServerListener listener)
Remove an object from the list of server listeners. If the argument object is not registered in the list, the method should do nothing.

Specified by:
removeServerListener in interface RemoteDesktopClient
Parameters:
listener - an object implementing the RemoteDesktopServerListener interface.

fireRemoteServerEvent

protected void fireRemoteServerEvent(RemoteDesktopServerEvent evt)
Fire a server event to all registered listeners.

Parameters:
evt - a server client event

addClientListener

public void addClientListener(RemoteDesktopClientListener listener)
Add a client listener. Each registered listener will receive an event whenever the client sends one of the selected messages to the server, such as PointerEvent, KeyEvent etc.

Specified by:
addClientListener in interface RemoteDesktopClient
Parameters:
listener - an object implementing the RemoteDesktopClientListener interface.

removeClientListener

public void removeClientListener(RemoteDesktopClientListener listener)
Remove an object from the list of client listeners. If the argument object is not registered in the list, the method should do nothing.

Specified by:
removeClientListener in interface RemoteDesktopClient
Parameters:
listener - an object implementing the RemoteDesktopClientListener interface.

fireRemoteClientEvent

protected void fireRemoteClientEvent(RemoteDesktopClientEvent evt)
Fire a client event to all registered listeners.

Parameters:
evt - a desktop client event

destroy

public void destroy()
Destroy the client and make it ready for garbage collection.

Specified by:
destroy in interface RemoteDesktopClient

isConnectedTo

public boolean isConnectedTo(String connectString)
Description copied from interface: RemoteDesktopClient
Test whether this client is connected to a desktop identified by a particular URL (connect string). The method should for example check whether the referred host and port is the same (if applicable). For example, if the client is a VNC one and is connected to "localhost:1", the method should return true when the argument is "rfb://127.0.0.1:5901" because the URL refers to the same host and port.

Specified by:
isConnectedTo in interface RemoteDesktopClient
Parameters:
connectString - an URL (connect string).
Returns:
true if the client is connected to the connect string

isActivelyUpdating

public boolean isActivelyUpdating()
The client is by default considered passive (the method returns false). Override this method for active clients.

Specified by:
isActivelyUpdating in interface ImageOwner
Returns:
false by default.

isStatic

public boolean isStatic()
The client is by default considered dynamic (the method returns false). Override this method for static image clients.

Specified by:
isStatic in interface ImageOwner
Returns:
false by default.

T-Plan Robot Enterprise 3.4
Build No. 3.4-20130322.1