com.wrq.apptrieve.agent
Class TerminalScreen

java.lang.Object
  extended by com.wrq.apptrieve.agent.TerminalScreen
All Implemented Interfaces:
java.io.Serializable

public final class TerminalScreen
extends java.lang.Object
implements java.io.Serializable

TerminalScreen represents a terminal screen. It contains methods that allow an entity or an unrecognized screen to be displayed, for example, as a web page.

See Also:
Serialized Form

Constructor Summary
TerminalScreen(int rows, int cols, int cursrow, int curscol, java.lang.String entityName, java.lang.String text, byte[] attrs, java.util.Map attrValues, java.util.List attrLocations, java.util.List attrReadables, java.util.List attrWritables, java.lang.String reachableEntities, int sessionType, boolean fConnected, java.util.List operationNames, java.lang.String defaultOperation, boolean legacyRejuvenation)
          Constructor for internal use only.
TerminalScreen(int rows, int cols, int cursrow, int curscol, java.lang.String entityName, java.lang.String text, byte[] attrs, java.util.Map attrValues, java.util.List attrLocations, java.util.List attrReadables, java.util.List attrWritables, java.lang.String reachableEntities, int sessionType, boolean fConnected, java.util.List operationNames, java.lang.String defaultOperation, boolean legacyRejuvenation, java.util.List hiddenAttrs)
          Constructor for internal use only.
 
Method Summary
protected  void computeFields()
          Compute the field information for this screen.
 boolean equals(java.lang.Object o)
           
 java.lang.String get3270CommErrorCode()
          Return communication error code (a 4-digit hex string), or an empty string if there is no communication error.
 java.lang.String get3270KeyboardDisabledReason()
          Get the 3270 keyboard disablement message.
 java.lang.String get3270PartitionId()
          Return the 3270 partition ID (A number from 0 to 255), or an empty string if partitions are not in use.
 java.lang.String get3270PartitionOwner()
          Return the 3270 partition owner.
 java.lang.String get5250ErrorCode()
          Return the 5250 error code (1 4-digit hex value), or an empty string if there is no error condition.
 boolean get5250InputInhibit()
          Return a flag indicating that the Input Inhibit (Also known as keyboard locked) indicator is asserted on the status line.
 boolean get5250MessageWaiting()
          Return a flag indicating that the Message Wait indicator is asserted on the status line.
 boolean get5250SystemAvailable()
          Return a flag indicating that the AS/400 system available indicator is asserted on the status line.
 int getColor(int offset)
          Gets the color of the character at the specified offset.
 int getColumns()
          Get the number of columns of text on the screen.
 int getCursorColumn()
          Get the zero-based column number where the cursor is located.
 int getCursorPosition()
          Get the zero-based absolute offset to where the cursor is located.
 int getCursorRow()
          Get the zero-based row number where the cursor is located.
 java.lang.String getDefaultOperationName()
          Get the name of the default VHI operation.
 Screen getEntity()
          Create an XML representation of a terminal screen, using VHI entity attributes when presenting input fields.
 java.lang.String getEntityName()
          Return the name of the host application screen.
 ScreenField getField(int i)
          Return the ith screen field.
 int getFieldCount()
          Return the number of fields on the screen.
 java.util.List getOperationNames()
          Get a list of operation names for this screen.
 java.util.List getReachableEntities()
          Get a list of entities reachable from the current entity.
 java.util.Map getReadableAttributes()
          Get a map of readable attributes and their values.
 int getRows()
          Get the number of rows of text on the screen, excluding the OIA and divider line.
 Screen getScreen()
          Create an XML representation of a terminal screen.
 java.lang.String getText()
          Get the text for the entire screen.
 java.lang.String getText(int offset, int length)
          Get length characters of text from the terminal screen starting at offset.
 java.lang.String getTextRow(int row)
          Get a row of text for this screen.
 java.util.Map getWriteableAttributes()
          Get a map of writeable attributes and their values.
 boolean isBlink(int offset)
          Determines if the character at the specified offset is blinking.
 boolean isColumnSeparated(int offset)
          Determines if the character at the specified offset is column separated.
 boolean isConnectedToHost()
          Determine if the session is connected to the host system.
 boolean isFieldEnd(int offset)
          Determines if the character at the specified offset is the end of a terminal field.
 boolean isFieldStart(int offset)
          Determines if the character at the specified offset is the start of a terminal field.
 boolean isFieldStructured()
          Returns whether or not this screen has any fields.
 boolean isHighIntensity(int offset)
          Determines if the character at the specified offset is high intensity.
 boolean isInput(int offset)
          Determines if the character at the specified offset is an input field.
 boolean isNumeric(int offset)
          Determines if the character at the specified offset is numeric.
 boolean isPenDetect(int offset)
          Determines if the character at the specified offset is pen detect.
 boolean isReverseVideo(int offset)
          Determines if the character at the specified offset is reverse video.
 boolean isUnderscore(int offset)
          Determines if the character at the specified offset is underscore.
 boolean isVisible(int offset)
          Determines if the character at the specified offset is visible.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerminalScreen

public TerminalScreen(int rows,
                      int cols,
                      int cursrow,
                      int curscol,
                      java.lang.String entityName,
                      java.lang.String text,
                      byte[] attrs,
                      java.util.Map attrValues,
                      java.util.List attrLocations,
                      java.util.List attrReadables,
                      java.util.List attrWritables,
                      java.lang.String reachableEntities,
                      int sessionType,
                      boolean fConnected,
                      java.util.List operationNames,
                      java.lang.String defaultOperation,
                      boolean legacyRejuvenation)
Constructor for internal use only.

Parameters:
rows - rows
cols - cols
cursrow - cursrow
curscol - curscol
entityName - entityName
text - text
attrs - attrs
attrValues - attrValues
attrLocations - attrLocations
attrReadables - attrReadables
attrWritables - attrWriteables
reachableEntities - reachableEntities
sessionType - sessionType
fConnected - fConnected
operationNames - operationNames
defaultOperation - defaultOperation
legacyRejuvenation - flag indicating that legacy rejuvenation naming conventions are in effect.

TerminalScreen

public TerminalScreen(int rows,
                      int cols,
                      int cursrow,
                      int curscol,
                      java.lang.String entityName,
                      java.lang.String text,
                      byte[] attrs,
                      java.util.Map attrValues,
                      java.util.List attrLocations,
                      java.util.List attrReadables,
                      java.util.List attrWritables,
                      java.lang.String reachableEntities,
                      int sessionType,
                      boolean fConnected,
                      java.util.List operationNames,
                      java.lang.String defaultOperation,
                      boolean legacyRejuvenation,
                      java.util.List hiddenAttrs)
Constructor for internal use only.

Parameters:
rows - rows
cols - cols
cursrow - cursrow
curscol - curscol
entityName - entityName
text - text
attrs - attrs
attrValues - attrValues
attrLocations - attrLocations
attrReadables - attrReadables
attrWritables - attrWriteables
reachableEntities - reachableEntities
sessionType - sessionType
fConnected - fConnected
operationNames - operationNames
defaultOperation - defaultOperation
legacyRejuvenation - flag indicating that legacy rejuvenation naming conventions are in effect.
Method Detail

getRows

public int getRows()
Get the number of rows of text on the screen, excluding the OIA and divider line.

Returns:
Number of rows on this screen.

getColumns

public int getColumns()
Get the number of columns of text on the screen.

Returns:
Number of columns on this screen.

getCursorRow

public int getCursorRow()
Get the zero-based row number where the cursor is located.

Returns:
The (zero-based) row number containing the cursor.

getCursorColumn

public int getCursorColumn()
Get the zero-based column number where the cursor is located.

Returns:
The (zero-based) column number containing the cursor.

getCursorPosition

public int getCursorPosition()
Get the zero-based absolute offset to where the cursor is located.

Returns:
The (zero-based) cursor offset within the screen.

get3270KeyboardDisabledReason

public java.lang.String get3270KeyboardDisabledReason()
Get the 3270 keyboard disablement message.

Expected return values are:

Returns:
3270 keyboard disabled reason/status.

get3270PartitionId

public java.lang.String get3270PartitionId()
Return the 3270 partition ID (A number from 0 to 255), or an empty string if partitions are not in use.

Returns:
3270 partition ID

get3270PartitionOwner

public java.lang.String get3270PartitionOwner()
Return the 3270 partition owner.

Expected return values are:

Returns:
3270 partition owner.

get3270CommErrorCode

public java.lang.String get3270CommErrorCode()
Return communication error code (a 4-digit hex string), or an empty string if there is no communication error. Note: Chances of seeing one of these ranges from rare to never.

Returns:
3270 communication error text

get5250SystemAvailable

public boolean get5250SystemAvailable()
Return a flag indicating that the AS/400 system available indicator is asserted on the status line.

Returns:
5250 System Available flag

get5250MessageWaiting

public boolean get5250MessageWaiting()
Return a flag indicating that the Message Wait indicator is asserted on the status line.

Returns:
5250 Message Waiting flag

get5250InputInhibit

public boolean get5250InputInhibit()
Return a flag indicating that the Input Inhibit (Also known as keyboard locked) indicator is asserted on the status line.

Returns:
5250 Input Inhibit (Keyboard disabled) flag

get5250ErrorCode

public java.lang.String get5250ErrorCode()
Return the 5250 error code (1 4-digit hex value), or an empty string if there is no error condition.

Returns:
5250 Error Code (4-digit hex value)

getFieldCount

public int getFieldCount()
Return the number of fields on the screen.

Returns:
The number of field separators (== number of fields) on the screen. This number will be zero when isFieldStructured() returns false.

getField

public ScreenField getField(int i)
Return the ith screen field. This method will return a "faked" ScreenField object (getField(0)) which will provide access to the entire screen if the screen contains no fields.

Parameters:
i - Index of field to return.
Returns:
Requested field object.
Throws:
java.lang.IndexOutOfBoundsException - if the i argument is out of range.

isFieldStructured

public boolean isFieldStructured()
Returns whether or not this screen has any fields. If there are no fields you can either use the access methods of this class to get the screen contents or you can use the (single) ScreenField object returned by getField(0).

Returns:
true if the screen is structured.

computeFields

protected void computeFields()
Compute the field information for this screen.


getEntityName

public java.lang.String getEntityName()
Return the name of the host application screen.

Returns:
Empty string if host screen not recognized, else the entity name defined in the VHI model file.

getReachableEntities

public java.util.List getReachableEntities()
Get a list of entities reachable from the current entity.

Returns:
list of reachable entities.

getOperationNames

public java.util.List getOperationNames()
Get a list of operation names for this screen.

Returns:
list of operation names.

getDefaultOperationName

public java.lang.String getDefaultOperationName()
Get the name of the default VHI operation.

Returns:
Default VHI operation, or null if there is none.

getReadableAttributes

public java.util.Map getReadableAttributes()
Get a map of readable attributes and their values.

Returns:
Map of readable VHI attributes and their values.

getWriteableAttributes

public java.util.Map getWriteableAttributes()
Get a map of writeable attributes and their values.

Returns:
Map of writeable VHI attributes and their values.

getText

public java.lang.String getText()
Get the text for the entire screen.

Returns:
text for the entire terminal screen.

getText

public java.lang.String getText(int offset,
                                int length)
Get length characters of text from the terminal screen starting at offset.

Parameters:
offset - 0-based offset starting character
length - number of characters to return
Returns:
Requested characters from the display.
Throws:
java.lang.IndexOutOfBoundsException - if the arguments are out of range.

getTextRow

public java.lang.String getTextRow(int row)
Get a row of text for this screen.

Parameters:
row - 0-based row for which text is to be obtained.
Returns:
Row of text, or empty string if row value is out of range.
Throws:
java.lang.IndexOutOfBoundsException - if the row argument is out of range.

getColor

public int getColor(int offset)
Gets the color of the character at the specified offset.

Parameters:
offset - 0-based offset of character for which color is to be obtained.
Returns:
Color value.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

Expected return values are:

  • AppConnRejuvenationSession.HostRedColor
  • AppConnRejuvenationSession.HostBlueColor
  • AppConnRejuvenationSession.HostPinkColor
  • AppConnRejuvenationSession.HostGreenColor
  • AppConnRejuvenationSession.HostTurquoiseColor
  • AppConnRejuvenationSession.HostYellowColor
  • AppConnRejuvenationSession.HostWhiteColor
  • AppConnRejuvenationSession.StatusLineColor
  • AppConnRejuvenationSession.ProtectedNormalAlphaColor
  • AppConnRejuvenationSession.ProtectedNormalNumericColor
  • AppConnRejuvenationSession.ProtectedHighlightAlphaColor
  • AppConnRejuvenationSession.ProtectedHighlightNumericColor
  • AppConnRejuvenationSession.UnprotectedNormalAlphaColor
  • AppConnRejuvenationSession.UnprotectedNormalNumericColor
  • AppConnRejuvenationSession.UnprotectedHighlightAlphaColor
  • AppConnRejuvenationSession.UnprotectedHighlightNumericColor
  • AppConnRejuvenationSession.StatusLineColor
  • AppConnRejuvenationSession.MessageLineColor
  • AppConnRejuvenationSession.ErrorLineColor
  • AppConnRejuvenationSession.SysRequestColor


isConnectedToHost

public boolean isConnectedToHost()
Determine if the session is connected to the host system.

Returns:
Flag indicating that this session is connected to the host system.

isBlink

public boolean isBlink(int offset)
Determines if the character at the specified offset is blinking.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is a blinking character.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isColumnSeparated

public boolean isColumnSeparated(int offset)
Determines if the character at the specified offset is column separated.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is a column separated character.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isFieldStart

public boolean isFieldStart(int offset)
Determines if the character at the specified offset is the start of a terminal field.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is the start of a terminal field.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isFieldEnd

public boolean isFieldEnd(int offset)
Determines if the character at the specified offset is the end of a terminal field.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is the end of a terminal field.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isInput

public boolean isInput(int offset)
Determines if the character at the specified offset is an input field.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is an input field.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isHighIntensity

public boolean isHighIntensity(int offset)
Determines if the character at the specified offset is high intensity.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is an intense display character.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isVisible

public boolean isVisible(int offset)
Determines if the character at the specified offset is visible.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is a visible character.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isNumeric

public boolean isNumeric(int offset)
Determines if the character at the specified offset is numeric.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is a character within a numeric field.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isPenDetect

public boolean isPenDetect(int offset)
Determines if the character at the specified offset is pen detect.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is a character within a lightpen field.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isReverseVideo

public boolean isReverseVideo(int offset)
Determines if the character at the specified offset is reverse video.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is a reverse-video character.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

isUnderscore

public boolean isUnderscore(int offset)
Determines if the character at the specified offset is underscore.

Parameters:
offset - 0-based offset of character for which data is to be obtained.
Returns:
Flag indicating that this is an underlined character.
Throws:
java.lang.IndexOutOfBoundsException - if the offset argument is out of range.

getEntity

public Screen getEntity()
Create an XML representation of a terminal screen, using VHI entity attributes when presenting input fields.

Returns:
String containing XML representation of a terminal screen, or null if this is not a defined entity.

getScreen

public Screen getScreen()
Create an XML representation of a terminal screen.

Returns:
String containing XML representation of a terminal screen.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object