com.jagacy
Class SessionVt

java.lang.Object
  extended bycom.jagacy.AbstractSession
      extended bycom.jagacy.SessionVt

public class SessionVt
extends AbstractSession

Supports a VT screen-scraping session.

Author:
Robert M. Preston

Constructor Summary
SessionVt(java.lang.String name)
          Creates a new session.
SessionVt(java.lang.String name, java.lang.String host)
          Creates a new session.
 
Method Summary
 boolean isLedOn(int led)
          Determines if an LED is on or not.
 boolean waitForChange(int mainTimeout, int trailingTimeout)
          Waits for the screen to change and the keyboard to unlock.
 boolean waitForChange(int mainTimeout, int trailingTimeout, java.lang.String tag)
          Waits for the tag to be received and the keyboard to unlock.
 boolean waitForChange(int timeout, java.lang.String tag)
          Waits for the tag to be received and the keyboard to unlock.
 boolean waitForChange(java.lang.String mainTimeoutProperty, java.lang.String trailingTimeoutProperty)
          Waits for the screen to change and the keyboard to unlock.
 boolean waitForChange(java.lang.String mainTimeoutProperty, java.lang.String trailingTimeoutProperty, java.lang.String tagProperty)
          Waits for the tag to be received and the keyboard to unlock.
 boolean waitForChangeProperty(java.lang.String timeoutProperty, java.lang.String tagProperty)
          Waits for the tag to be received and the keyboard to unlock.
 boolean waitForPosition(int row, int column, java.lang.String value, int mainTimeout, int trailingTimeout)
          Waits (in 100 millisecond intervals) for the value to appear at the given coordinates.
 boolean waitForPosition(Location location, java.lang.String value, int mainTimeout, int trailingTimeout)
          Waits (in 100 millisecond intervals) for the value to appear at the given location.
 boolean waitForPosition(java.lang.String propertyPrefix, int mainTimeout, int trailingTimeout)
          Waits (in 100 millisecond intervals) for the value to appear at the given coordinates.
 boolean waitForPosition(java.lang.String propertyPrefix, java.lang.String value, int mainTimeout, int trailingTimeout)
          Waits (in 100 millisecond intervals) for the value to appear at the given coordinates.
 boolean waitForPosition(java.lang.String propertyPrefix, java.lang.String value, java.lang.String mainTimeoutProperty, java.lang.String trailingTimeoutProperty)
          Waits (in 100 millisecond intervals) for the value to appear at the given coordinates.
 boolean waitForPositionProperty(java.lang.String propertyPrefix, java.lang.String mainTimeoutProperty, java.lang.String trailingTimeoutProperty)
          Waits (in 100 millisecond intervals) for the value to appear at the given coordinates.
 
Methods inherited from class com.jagacy.AbstractSession
abort, close, createLocation, createLocation, finalize, getAttributeForPosition, getHeight, getLogger, getName, getProperties, getWidth, isInsertOn, logoff, logon, open, read, read, readAlarmCount, readCursor, readCursorLocation, readPosition, readPosition, readPosition, readRow, readScreen, waitForChange, waitForChange, waitForPosition, waitForPosition, waitForPosition, waitForPosition, waitForPosition, waitForPosition, waitForUnlock, waitForUnlock, writeAfterLabel, writeAfterLabel, writeAfterLabelProperty, writeCursor, writeCursor, writeCursor, writeKey, writeKey, writePosition, writePosition, writePosition, writePosition, writeProperty, writeString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionVt

public SessionVt(java.lang.String name)
          throws JagacyException
Creates a new session.

Parameters:
name - The session name (also the name of the .properties file).
Throws:
JagacyException - If an error occurs.

SessionVt

public SessionVt(java.lang.String name,
                 java.lang.String host)
          throws JagacyException
Creates a new session.

Parameters:
name - The session name (also the name of the .properties file).
host - The session's host.
Throws:
JagacyException - If an error occurs.
Method Detail

waitForChange

public boolean waitForChange(int mainTimeout,
                             int trailingTimeout)
                      throws JagacyException
Waits for the screen to change and the keyboard to unlock.

Parameters:
mainTimeout - Amount of time to wait (in milliseconds).
trailingTimeout - Amount of time to wait for trailing characters (in milliseconds).
Returns:
true if screen changed and keyboard unlocked; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForChange

public boolean waitForChange(java.lang.String mainTimeoutProperty,
                             java.lang.String trailingTimeoutProperty)
                      throws JagacyException
Waits for the screen to change and the keyboard to unlock.

Parameters:
mainTimeoutProperty - Property to lookup (if property ends with '.seconds', value will be converted to milliseconds).
trailingTimeoutProperty - Property to lookup (if property ends with '.seconds', value will be converted to milliseconds).
Returns:
true if screen changed and keyboard unlocked; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForChange

public boolean waitForChange(int timeout,
                             java.lang.String tag)
                      throws JagacyException
Waits for the tag to be received and the keyboard to unlock.

Parameters:
timeout - Amount of time to wait (in milliseconds).
tag - Tag to be received.
Returns:
true if tag received and keyboard unlocked; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForChangeProperty

public boolean waitForChangeProperty(java.lang.String timeoutProperty,
                                     java.lang.String tagProperty)
                              throws JagacyException
Waits for the tag to be received and the keyboard to unlock.

Parameters:
timeoutProperty - Property to lookup (if property ends with '.seconds', value will be converted to milliseconds).
tagProperty - Property to lookup.
Returns:
true if tag received and keyboard unlocked; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForChange

public boolean waitForChange(int mainTimeout,
                             int trailingTimeout,
                             java.lang.String tag)
                      throws JagacyException
Waits for the tag to be received and the keyboard to unlock.

Parameters:
mainTimeout - Amount of time to wait (in milliseconds).
trailingTimeout - Amount of time to wait for trailing characters (in milliseconds).
tag - Tag to be received.
Returns:
true if tag received and keyboard unlocked; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForChange

public boolean waitForChange(java.lang.String mainTimeoutProperty,
                             java.lang.String trailingTimeoutProperty,
                             java.lang.String tagProperty)
                      throws JagacyException
Waits for the tag to be received and the keyboard to unlock.

Parameters:
mainTimeoutProperty - Property to lookup (if property ends with '.seconds', value will be converted to milliseconds).
trailingTimeoutProperty - Property to lookup (if property ends with '.seconds', value will be converted to milliseconds).
tagProperty - Property to lookup.
Returns:
true if tag received and keyboard unlocked; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForPosition

public boolean waitForPosition(int row,
                               int column,
                               java.lang.String value,
                               int mainTimeout,
                               int trailingTimeout)
                        throws JagacyException
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates.

Parameters:
row - Row (indexed from 0).
column - Column (indexed from 0).
value - Value to appear.
mainTimeout - Amount of time to wait (in milliseconds).
trailingTimeout - Amount of time to wait for trailing characters (in milliseconds).
Returns:
true if the value appeared; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForPosition

public boolean waitForPosition(Location location,
                               java.lang.String value,
                               int mainTimeout,
                               int trailingTimeout)
                        throws JagacyException
Waits (in 100 millisecond intervals) for the value to appear at the given location.

Parameters:
location - The location of the value.
value - Value to appear.
mainTimeout - Amount of time to wait (in milliseconds).
trailingTimeout - Amount of time to wait for trailing characters (in milliseconds).
Returns:
true if the value appeared; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForPositionProperty

public boolean waitForPositionProperty(java.lang.String propertyPrefix,
                                       java.lang.String mainTimeoutProperty,
                                       java.lang.String trailingTimeoutProperty)
                                throws JagacyException
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates. This method expects the property file to have the following entries:
<propertyPrefix>.row
<propertyPrefix>.column
<propertyPrefix>.value

Parameters:
propertyPrefix - Prefix used to lookup properties.
mainTimeoutProperty - Property to lookup (if property ends with '.seconds', value will be converted to milliseconds).
trailingTimeoutProperty - Property to lookup (if property ends with '.seconds', value will be converted to milliseconds).
Returns:
true if the value appeared; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForPosition

public boolean waitForPosition(java.lang.String propertyPrefix,
                               int mainTimeout,
                               int trailingTimeout)
                        throws JagacyException
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates. This method expects the property file to have the following entries:
<propertyPrefix>.row
<propertyPrefix>.column
<propertyPrefix>.value

Parameters:
propertyPrefix - Prefix used to lookup properties.
mainTimeout - Amount of time to wait (in milliseconds).
trailingTimeout - Amount of time to wait for trailing characters (in milliseconds).
Returns:
true if the value appeared; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForPosition

public boolean waitForPosition(java.lang.String propertyPrefix,
                               java.lang.String value,
                               java.lang.String mainTimeoutProperty,
                               java.lang.String trailingTimeoutProperty)
                        throws JagacyException
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates. This method expects the property file to have the following entries:
<propertyPrefix>.row
<propertyPrefix>.column

Parameters:
propertyPrefix - Prefix used to lookup properties.
value - Value to appear.
mainTimeoutProperty - Property to lookup (if property ends with '.seconds', value will be converted to milliseconds).
trailingTimeoutProperty - Property to lookup (if property ends with '.seconds', value will be converted to milliseconds).
Returns:
true if the value appeared; false otherwise.
Throws:
JagacyException - If an error occurs.

waitForPosition

public boolean waitForPosition(java.lang.String propertyPrefix,
                               java.lang.String value,
                               int mainTimeout,
                               int trailingTimeout)
                        throws JagacyException
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates. This method expects the property file to have the following entries:
<propertyPrefix>.row
<propertyPrefix>.column

Parameters:
propertyPrefix - Prefix used to lookup properties.
value - Value to appear.
mainTimeout - Amount of time to wait (in milliseconds).
trailingTimeout - Amount of time to wait for trailing characters (in milliseconds).
Returns:
true if the value appeared; false otherwise.
Throws:
JagacyException - If an error occurs.

isLedOn

public boolean isLedOn(int led)
                throws JagacyException
Determines if an LED is on or not.

Parameters:
led - The LED to check.
Returns:
true if the LED is on; false otherwise.
Throws:
JagacyException - If an error occurs.