Services Builder for Screens

com.attachmate.sc.ssa
Class VTController

java.lang.Object
  |
  +--com.attachmate.sc.ssa.VTController
All Implemented Interfaces:
IController

public class VTController
extends java.lang.Object
implements IController

VT controller for IQAScreen.sendKeys.

The following actions are supported.

KeyCommand
@0IVTDirectAccessConstants.CMD_NONE
@1IVTDirectAccessConstants.CMD_F1
@2IVTDirectAccessConstants.CMD_F2
@3IVTDirectAccessConstants.CMD_F3
@4IVTDirectAccessConstants.CMD_F4
@5IVTDirectAccessConstants.CMD_F5
@6IVTDirectAccessConstants.CMD_F6
@7IVTDirectAccessConstants.CMD_F7
@8IVTDirectAccessConstants.CMD_F8
@9IVTDirectAccessConstants.CMD_F9
@aIVTDirectAccessConstants.CMD_F10
@bIVTDirectAccessConstants.CMD_F11
@cIVTDirectAccessConstants.CMD_F12
@dIVTDirectAccessConstants.CMD_F13
@eIVTDirectAccessConstants.CMD_F14
@fIVTDirectAccessConstants.CMD_F15
@gIVTDirectAccessConstants.CMD_F16
@hIVTDirectAccessConstants.CMD_F17
@iIVTDirectAccessConstants.CMD_F18
@jIVTDirectAccessConstants.CMD_F19
@kIVTDirectAccessConstants.CMD_F20
@EIVTDirectAccessConstants.CMD_TRANSMIT
@uIVTDirectAccessConstants.CMD_PREVIOUS
@vIVTDirectAccessConstants.CMD_NEXT
@DIVTDirectAccessConstants.CMD_REMOVE
@UIVTDirectAccessConstants.CMD_UP
@VIVTDirectAccessConstants.CMD_DOWN
@LIVTDirectAccessConstants.CMD_LEFT
@ZIVTDirectAccessConstants.CMD_RIGHT
@wIVTDirectAccessConstants.CMD_PF1
@xIVTDirectAccessConstants.CMD_PF2
@yIVTDirectAccessConstants.CMD_PF3
@zIVTDirectAccessConstants.CMD_PF4
@TIVTDirectAccessConstants.CMD_TAB
@<IVTDirectAccessConstants.CMD_BACKSPACE
@HIVTDirectAccessConstants.CMD_HOLD
@PIVTDirectAccessConstants.CMD_PRINT
@XIVTDirectAccessConstants.CMD_COMPOSE
@NIVTDirectAccessConstants.CMD_RETURN
@A@fIVTDirectAccessConstants.CMD_FIND
@A@IIVTDirectAccessConstants.CMD_INSERT
@A@sIVTDirectAccessConstants.CMD_SELECT
@A@QIVTDirectAccessConstants.CMD_BREAK
@A@0IVTDirectAccessConstants.CMD_KEYPAD_0
@A@1IVTDirectAccessConstants.CMD_KEYPAD_1
@A@2IVTDirectAccessConstants.CMD_KEYPAD_2
@A@3IVTDirectAccessConstants.CMD_KEYPAD_3
@A@4IVTDirectAccessConstants.CMD_KEYPAD_4
@A@5IVTDirectAccessConstants.CMD_KEYPAD_5
@A@6IVTDirectAccessConstants.CMD_KEYPAD_6
@A@7IVTDirectAccessConstants.CMD_KEYPAD_7
@A@8IVTDirectAccessConstants.CMD_KEYPAD_8
@A@9IVTDirectAccessConstants.CMD_KEYPAD_9
@A@-IVTDirectAccessConstants.CMD_KEYPAD_MINUS
@A@,IVTDirectAccessConstants.CMD_KEYPAD_COMMA
@A@EIVTDirectAccessConstants.CMD_KEYPAD_ENTER
@A@.IVTDirectAccessConstants.CMD_KEYPAD_DECIMAL
@A@*IVTDirectAccessConstants.CMD_KEYPAD_MULTIPLY
@A@/IVTDirectAccessConstants.CMD_KEYPAD_DIVIDE
@A@+IVTDirectAccessConstants.CMD_KEYPAD_PLUS
@A@RIVTDirectAccessConstants.CMD_KEYPAD_ESCAPE
@S@1IVTDirectAccessConstants.CMD_SHIFT_F1
@S@2IVTDirectAccessConstants.CMD_SHIFT_F2
@S@3IVTDirectAccessConstants.CMD_SHIFT_F3
@S@4IVTDirectAccessConstants.CMD_SHIFT_F4
@S@5IVTDirectAccessConstants.CMD_SHIFT_F5
@S@6IVTDirectAccessConstants.CMD_SHIFT_F6
@S@7IVTDirectAccessConstants.CMD_SHIFT_F7
@S@8IVTDirectAccessConstants.CMD_SHIFT_F8
@S@9IVTDirectAccessConstants.CMD_SHIFT_F9
@S@aIVTDirectAccessConstants.CMD_SHIFT_F10
@S@bIVTDirectAccessConstants.CMD_SHIFT_F11
@S@cIVTDirectAccessConstants.CMD_SHIFT_F12
@S@dIVTDirectAccessConstants.CMD_SHIFT_F13
@S@eIVTDirectAccessConstants.CMD_SHIFT_F14
@S@fIVTDirectAccessConstants.CMD_SHIFT_F15
@S@gIVTDirectAccessConstants.CMD_SHIFT_F16
@S@hIVTDirectAccessConstants.CMD_SHIFT_F17
@S@iIVTDirectAccessConstants.CMD_SHIFT_F18
@S@jIVTDirectAccessConstants.CMD_SHIFT_F19
@S@kIVTDirectAccessConstants.CMD_SHIFT_F20
@^@0IVTDirectAccessConstants.CMD_CONTROL_AT
@^@AIVTDirectAccessConstants.CMD_CONTROL_A
@^@BIVTDirectAccessConstants.CMD_CONTROL_B
@^@CIVTDirectAccessConstants.CMD_CONTROL_C
@^@DIVTDirectAccessConstants.CMD_CONTROL_D
@^@EIVTDirectAccessConstants.CMD_CONTROL_E
@^@FIVTDirectAccessConstants.CMD_CONTROL_F
@^@GIVTDirectAccessConstants.CMD_CONTROL_G
@^@HIVTDirectAccessConstants.CMD_CONTROL_H
@^@IIVTDirectAccessConstants.CMD_CONTROL_I
@^@JIVTDirectAccessConstants.CMD_CONTROL_J
@^@KIVTDirectAccessConstants.CMD_CONTROL_K
@^@LIVTDirectAccessConstants.CMD_CONTROL_L
@^@MIVTDirectAccessConstants.CMD_CONTROL_M
@^@NIVTDirectAccessConstants.CMD_CONTROL_N
@^@OIVTDirectAccessConstants.CMD_CONTROL_O
@^@PIVTDirectAccessConstants.CMD_CONTROL_P
@^@QIVTDirectAccessConstants.CMD_CONTROL_Q
@^@RIVTDirectAccessConstants.CMD_CONTROL_R
@^@SIVTDirectAccessConstants.CMD_CONTROL_S
@^@TIVTDirectAccessConstants.CMD_CONTROL_T
@^@UIVTDirectAccessConstants.CMD_CONTROL_U
@^@VIVTDirectAccessConstants.CMD_CONTROL_V
@^@WIVTDirectAccessConstants.CMD_CONTROL_W
@^@XIVTDirectAccessConstants.CMD_CONTROL_X
@^@YIVTDirectAccessConstants.CMD_CONTROL_Y
@^@ZIVTDirectAccessConstants.CMD_CONTROL_Z
@^@[IVTDirectAccessConstants.CMD_CONTROL_LBRACKET
@^@\IVTDirectAccessConstants.CMD_CONTROL_BACKSLASH
@^@]IVTDirectAccessConstants.CMD_CONTROL_RBRACKET
@^@^IVTDirectAccessConstants.CMD_CONTROL_CARET
@^@_IVTDirectAccessConstants.CMD_CONTROL_UNDERSCORE


Field Summary
protected static java.lang.String ACTION_KEYS
          a list of single character commands used by sendkeys.
protected static int[] ACTION_LIST
          a list of commands and actions from IDirectActionConstants that match up with the sendkeys commands in ACTION_KEYS
protected static java.lang.String MULTI_COMMAND
          a list of sendkey commands that are the prefix to combination commands.
protected static java.lang.String[] SUB_COMMANDS
          a list of command suffixes for each character in MULTI_COMMAND.
protected static int[][] SUBKEYS
          a list for character in the SUB_COMMANDS list.
 
Constructor Summary
VTController(com.attachmate.sc.ssa.IDirectAccess da)
           
 
Method Summary
protected  void execute(int command)
          Execute a command.
 Point getCursorTrigger()
          Sets the cursor trigger.
 IPerformanceTool getPerformanceTool()
          Gets the current performance tool from the current controller.
 long getSettleTime()
          Gets the amount of time a read should wait for a settled read.
 long getTimeout()
          Gets the maximum amount of time a read should take.
 void performAction(java.lang.String commands)
          Convert the supplied array of commands into actions.
protected  void read()
          Read data from the host.
 void setCursorTrigger(Point p)
          Sets the cursor trigger.
 void setFieldText(java.lang.String text)
          Write the supplied text to where the cursor is sitting.
 void setPerformanceTool(IPerformanceTool tool)
          Sets the performance tools on the current controller.
 void setSettleTime(long milliseconds)
          Sets the amount of time a read should wait for a settled read.
 void setTimeout(long milliseconds)
          Sets the amount of time to perform a read
protected  void write(int command)
          Send a command to the host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_KEYS

protected static final java.lang.String ACTION_KEYS
a list of single character commands used by sendkeys. This must be kept up to date with ACTION_LIST

See Also:
Constant Field Values

ACTION_LIST

protected static final int[] ACTION_LIST
a list of commands and actions from IDirectActionConstants that match up with the sendkeys commands in ACTION_KEYS


MULTI_COMMAND

protected static final java.lang.String MULTI_COMMAND
a list of sendkey commands that are the prefix to combination commands.

See Also:
Constant Field Values

SUB_COMMANDS

protected static final java.lang.String[] SUB_COMMANDS
a list of command suffixes for each character in MULTI_COMMAND.


SUBKEYS

protected static final int[][] SUBKEYS
a list for character in the SUB_COMMANDS list. Use the actions and commands in IVTDirectAccessConstants.

Constructor Detail

VTController

public VTController(com.attachmate.sc.ssa.IDirectAccess da)
Method Detail

setFieldText

public void setFieldText(java.lang.String text)
                  throws ProtectedFieldException
Write the supplied text to where the cursor is sitting. The text will be trimmed to fit the field length.

Specified by:
setFieldText in interface IController
Parameters:
text - the String to write to the field
Throws:
ProtectedFieldException

performAction

public void performAction(java.lang.String commands)
                   throws com.attachmate.nav.engine.NavException,
                          java.io.IOException
Convert the supplied array of commands into actions. Any "AID" keys will be sent to the host. Actions will manipulate fields.

Specified by:
performAction in interface IController
Parameters:
commands - a String containing a list of commands.
Throws:
com.attachmate.nav.engine.CustomStepException
java.io.IOException
com.attachmate.nav.engine.NavException

setTimeout

public void setTimeout(long milliseconds)
Sets the amount of time to perform a read

Specified by:
setTimeout in interface IController
Parameters:
milliseconds - the maximum number of milliseconds the read should take.

getTimeout

public long getTimeout()
Gets the maximum amount of time a read should take.

Specified by:
getTimeout in interface IController
Returns:
the maximum amount of time in milliseconds.

setSettleTime

public void setSettleTime(long milliseconds)
Sets the amount of time a read should wait for a settled read. If the read returns with data before the time set, the timer is reset and another read is performed.

Specified by:
setSettleTime in interface IController
Parameters:
milliseconds - the amount of time to wait per read.

getSettleTime

public long getSettleTime()
Gets the amount of time a read should wait for a settled read. If the read returns with data before tthe time set, the timer is reset and another read is performed.

Specified by:
getSettleTime in interface IController
Returns:
the number of milliseconds to wait per read.

setCursorTrigger

public void setCursorTrigger(Point p)
Sets the cursor trigger. A settled read will exit when the host sets the cursor to this coordinate.

Specified by:
setCursorTrigger in interface IController
Parameters:
p - a Point containing the cursor coordinate to wait for. If it is set to (0,0), the read will rely on the timeout and settleTime for exiting the settled read.

getCursorTrigger

public Point getCursorTrigger()
Sets the cursor trigger. A settled read will exit when the host sets the cursor to this coordinate.

Specified by:
getCursorTrigger in interface IController
Returns:
a Point containing the cursor coordinate to wait for. If it is set to (0,0), the read will rely on the timeout and settleTime for exiting the settled read.

setPerformanceTool

public void setPerformanceTool(IPerformanceTool tool)
Sets the performance tools on the current controller.

Specified by:
setPerformanceTool in interface IController
Parameters:
tool - a reference to an object that has implemented IPerformanceTool.

getPerformanceTool

public IPerformanceTool getPerformanceTool()
Gets the current performance tool from the current controller.

Specified by:
getPerformanceTool in interface IController
Returns:
a reference to the object that has been assigned to this controller.

execute

protected void execute(int command)
                throws java.io.IOException,
                       com.attachmate.nav.engine.NavException
Execute a command. Performs a write and a settled read.

Parameters:
command - the command to execute on the write. This needs to be a IVTDirectAccessConstants CMD command.
Throws:
java.io.IOException
com.attachmate.nav.engine.NavException

write

protected void write(int command)
              throws java.io.IOException
Send a command to the host. Performs a write to the host using the commands (CMD_*) from IVTDirectAccessConstants

Parameters:
command - the command to send to the host.
Throws:
java.io.IOException

read

protected void read()
             throws java.io.IOException,
                    com.attachmate.nav.engine.NavException
Read data from the host. Performs a settled read. It uses the following pattern:
    try {
      read(timeout);
      while (onReadExit(status, bTimedOut)) { read(settleTime);}
    } catch (Timeout) { bTimedOut=true }
 

It uses the onReadExit() from IPerformanceTool to decide if another read is necessary.

Throws:
java.io.IOException
com.attachmate.nav.engine.NavException

Services Builder for Screens