Services Builder for Screens

com.attachmate.common.eai.tasks
Class ScreenNativeAccess

java.lang.Object
  |
  +--com.attachmate.common.eai.tasks.BaseTaskBean
        |
        +--com.attachmate.common.eai.tasks.NavTaskBean
              |
              +--com.attachmate.common.eai.tasks.ScreenNativeAccess
All Implemented Interfaces:
INativeAccess, INativeAccessConstants, ITask, java.io.Serializable
Direct Known Subclasses:
ScreenNativeAccessEx

public class ScreenNativeAccess
extends com.attachmate.common.eai.tasks.NavTaskBean
implements INativeAccess

Implements INativeAccess and supply a host neutral view of the screen. Provides a mechnism to recover from tasks failures or render host screens.

See Also:
INativeAccess, ITask, Serialized Form

Field Summary
 
Fields inherited from class com.attachmate.common.eai.tasks.NavTaskBean
m_InputFields, m_MapName, m_MultiValInputFields, m_MultiValInputVals, m_MultiValOutputFields, m_MultiValOutputVals, m_OutputFields, m_Route
 
Fields inherited from class com.attachmate.common.eai.tasks.BaseTaskBean
m_Config, m_InstanceName, m_JobName, m_ResourceName, m_ServerAddress, m_TaskName, m_Timeout, m_Version
 
Fields inherited from interface com.attachmate.common.eai.tasks.INativeAccess
PROPERTY_NOT_INITIALIZED
 
Fields inherited from interface com.attachmate.common.eai.tasks.INativeAccessConstants
ATTR_BLINK, ATTR_CHAR_SET_APL, ATTR_COLUMN_SEPARATOR, ATTR_DEFAULT, ATTR_HIGH_INTENSITY, ATTR_LEFT_LINE, ATTR_OVERLINE, ATTR_REVERSE, ATTR_RIGHT_LINE, ATTR_STRIKETHROUGH, ATTR_UNDERLINE, ATTR_VISIBLE, CMD_ATTENTION, CMD_CLEAR, CMD_CTRL, CMD_DISABLEFORMS, CMD_ENABLEFORMS, CMD_F1, CMD_F10, CMD_F11, CMD_F12, CMD_F13, CMD_F14, CMD_F15, CMD_F16, CMD_F17, CMD_F18, CMD_F19, CMD_F2, CMD_F20, CMD_F21, CMD_F22, CMD_F23, CMD_F24, CMD_F3, CMD_F4, CMD_F5, CMD_F6, CMD_F7, CMD_F8, CMD_F9, CMD_HELP, CMD_LOCAL, CMD_MESSAGE_WAIT, CMD_PA1, CMD_PA2, CMD_PA3, CMD_PRINT, CMD_RECEIVE, CMD_REFRESH_NULL, CMD_RESET, CMD_ROLLDOWN, CMD_ROLLUP, CMD_SPECIFY, CMD_SYSTEM_MODE, CMD_SYSTEM_REQUEST, CMD_TEST, CMD_TRANSMIT, CMD_TRANSMIT_LINE, CMD_TRANSMIT_SCREEN, CMD_WORKSTATION_MODE, COLOR_BG_BLACK, COLOR_BG_BLUE, COLOR_BG_DEFAULT, COLOR_BG_DK_BLUE, COLOR_BG_DK_GREEN, COLOR_BG_DK_MAGENTA, COLOR_BG_DK_RED, COLOR_BG_DK_TURQUOISE, COLOR_BG_DK_YELLOW, COLOR_BG_GRAY, COLOR_BG_GREEN, COLOR_BG_LT_GRAY, COLOR_BG_MAGENTA, COLOR_BG_MASK, COLOR_BG_RED, COLOR_BG_TURQUOISE, COLOR_BG_WHITE, COLOR_BG_YELLOW, COLOR_FG_BLACK, COLOR_FG_BLUE, COLOR_FG_DEFAULT, COLOR_FG_DK_BLUE, COLOR_FG_DK_GREEN, COLOR_FG_DK_MAGENTA, COLOR_FG_DK_RED, COLOR_FG_DK_TURQUOISE, COLOR_FG_DK_YELLOW, COLOR_FG_GRAY, COLOR_FG_GREEN, COLOR_FG_LT_GRAY, COLOR_FG_MAGENTA, COLOR_FG_MASK, COLOR_FG_RED, COLOR_FG_TURQUOISE, COLOR_FG_WHITE, COLOR_FG_YELLOW, ERROR_CODE_FATAL, ERROR_CODE_INPUT_INHIBITED_EXCEPTION, ERROR_CODE_KEYLOCK, ERROR_CODE_PROTECTED_FIELD_EXCEPTION, ERROR_CODE_SCREEN_CHANGED, ERROR_CODE_TIMEOUT, ERROR_CODE_TRUNCATED_EXCEPTION, ERROR_CODE_UNKNOWN, ERROR_CODE_UNKNOWN_KEYLOCK, FIELD_ALPHA_ONLY, FIELD_ALPHA_SHIFT, FIELD_ATTRIB_SPACE, FIELD_ATTRIBUTE, FIELD_AUTO_ENTER, FIELD_CHECK_MOD_10, FIELD_CHECK_MOD_11, FIELD_DIGITS, FIELD_EXIT_REQ, FIELD_LIGHT_PEN, FIELD_MAGNETIC_STRIP, FIELD_MANDATORY_ENTRY, FIELD_MANDATORY_FILL, FIELD_MARK_DUP, FIELD_MODE_BLOCK, FIELD_MODE_PROTECTED, FIELD_MODIFIED, FIELD_NUMERIC_ONLY, FIELD_NUMERIC_SHIFT, FIELD_RA_BLANKFILL, FIELD_RA_ZEROFILL, FIELD_RIGHT_JUSTIFIED, FIELD_SIGNED_NUMERIC, FIELD_TRIGGER, FIELD_TYPE_MESSAGE, FIELD_TYPE_TABLE, FIELD_TYPE_USER, FIELD_UPPERCASE, STATUS_DATA_CHANGED, STATUS_EOR, STATUS_FORMAT_CHANGED, STATUS_KBD_UNLOCK, STATUS_MESSAGE_WAITING, STATUS_SCREEN_ERASED, STATUS_SIZE_CHANGED, STATUS_TYPE_CHANGED, STR_FATAL_ERROR, STR_SCREEN_CHANGED, STR_WARNING, STR_WARNING_KEYLOCK, STR_WARNING_TIMEOUT, STR_WARNING_UNKNOWN, USE_SYSTEM_DEFAULT
 
Fields inherited from interface com.attachmate.tasks.ITask
PRESERVE_ALWAYS, PRESERVE_NEVER, PRESERVE_ON_ERROR
 
Constructor Summary
ScreenNativeAccess()
          Configure the task bean for NativeAccess and settings to the defaults.
 
Method Summary
protected  void doExecute(com.attachmate.common.eai.ITaskServer server)
          reset the field count to 0 if the count is invalid
 long[] getCharacterAttr()
          Gets the extended attribute bits for the entire screen.
 int getColumns()
          Gets the number of columns on the screen
 int getCommand()
          Gets the current execution command
 int getCurrentPage()
          Gets the current page number
 int getCursorColumn()
          Gets the current cursor column position
 int getCursorRow()
          Gets the current row position of the cursor
 long[] getFieldAttr()
          Gets the attribute bits for every field on the screen.
 long getFieldAttr(int fieldIndex)
          Gets the attribute bits of the desired field.
 int getFieldCount()
          Gets the number of fields on the current screen
 int[] getFieldEndColumn()
          Gets the ending column of each field on the screen.
 int getFieldEndColumn(int fieldIndex)
          Gets the ending column for the desired field.
 int[] getFieldEndRow()
          Gets the ending row of each field on the screen.
 int getFieldEndRow(int fieldIndex)
          Gets the ending row of the desired field.
 java.lang.String[] getFieldInputText()
          Gets the text from all pre-defined input fields on the screen.
 java.lang.String getFieldInputText(int fieldIndex)
          Gets the field input text from the desired field.
 int[] getFieldLength()
          Gets the field length for each field on the screen.
 int getFieldLength(int fieldIndex)
          Gets the length of the desired field.
 int[] getFieldPage()
          Gets the screen page of all of the fields.
 int getFieldPage(int fieldIndex)
          Gets the screen page of the desired field.
 int[] getFieldStartColumn()
          Gets the starting column for each field on the screen.
 int getFieldStartColumn(int fieldIndex)
          Gets the starting column of the desired field.
 int[] getFieldStartRow()
          Gets the starting row of every field on the screen.
 int getFieldStartRow(int fieldIndex)
          Gets the starting row of the desired field.
 java.lang.String[] getFieldText()
          Gets the text from all pre-defined fields on the screen.
 java.lang.String getFieldText(int fieldIndex)
          Gets the visible text from the desired field.
 int getHostFlags()
          Gets the host status flags.
 java.lang.String getHostMessage()
          Deprecated.  
 java.lang.String getHostType()
          Gets the type of the host connection
 int getPageCount()
          Gets the number of pages on a multi-page viewer
 java.lang.String getPoolName()
          Gets the pool name
 int getRows()
          Gets the number rows on the screen
 java.lang.String getScreenName()
          Gets the name of the host screen from the pool's NavMap
 int getSettleTime()
          Gets the amount of time that NativeAccess will wait for a screen to settle before the screen data is returned.
 java.lang.String getShare()
          Gets the session's context name.
 void setCommand(int command)
          Sets the command to execute on the screen.
protected  void setConfiguration(com.attachmate.common.eai.ITaskServer server)
          Handles the specifics of setting up the configuration info needed by ITaskServer to connect a task.
 void setCurrentPage(int newPage)
          Sets the currently active page.
 void setCursorColumn(int inColumn)
          Moves the cursor horizontally to the specified column.
 void setCursorRow(int inRow)
          Moves the cursor vertically to the specified row.
 void setFieldInputText(int fieldIndex, java.lang.String fieldText)
          Sets the text in the desired input field.
 void setFieldInputText(java.lang.String[] fieldsText)
          Sets the text in all input fields.
 void setSettleTime(int milliseconds)
          Sets the settle time for the screen to become stable.
 void setShare(java.lang.String name)
          Sets the name of the NavMap.
 
Methods inherited from class com.attachmate.common.eai.tasks.NavTaskBean
getMapName, getMultiValPropArray, getMultiValPropVal, getMultiValuePropArray, getMultiValuePropVal, getRecordCount, getRoute, getTaskContext, getUniqueIdentifier
 
Methods inherited from class com.attachmate.common.eai.tasks.BaseTaskBean
addTaskListener, cancel, clearContext, copyContext, executeAsync, executeSync, freeTaskServer, getInstanceName, getJobName, getLocale, getPreserveContext, getResourceName, getStatus, getTimeout, getVersion, lockTaskServer, removeTaskListener, setInstanceName, setJobName, setLocale, setPreserveContext, setResourceName, setTimeout, transferContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenNativeAccess

public ScreenNativeAccess()
Configure the task bean for NativeAccess and settings to the defaults. Sets the task to ITask.PRESERVE_ALWAYS. This may be overriden if necessary before calling executeSync().

See Also:
BaseTaskBean.executeSync(), ITask.PRESERVE_ALWAYS
Method Detail

setConfiguration

protected void setConfiguration(com.attachmate.common.eai.ITaskServer server)
                         throws java.lang.Exception
Handles the specifics of setting up the configuration info needed by ITaskServer to connect a task. Made abstract because the data needed to set up a specific type of task is not known by this base bean and needs to be implemented by classes which extend this.

Overrides:
setConfiguration in class com.attachmate.common.eai.tasks.NavTaskBean
Parameters:
server - The ITaskServer the bean sets the configuration on.
java.lang.Exception

getHostMessage

public java.lang.String getHostMessage()
Deprecated.  

Specified by:
getHostMessage in interface INativeAccess
Returns:
the host message, if it exists.

getHostFlags

public int getHostFlags()
Gets the host status flags.

Specified by:
getHostFlags in interface INativeAccess
Returns:
the host message flags.

getPoolName

public java.lang.String getPoolName()
Gets the pool name

Specified by:
getPoolName in interface INativeAccess
Returns:
the name of the pool this bean is accessing.

getShare

public java.lang.String getShare()
Gets the session's context name.

Specified by:
getShare in interface INativeAccess
Returns:
the name of the NavMap or null if the name was not set.

setShare

public void setShare(java.lang.String name)
Sets the name of the NavMap.

Specified by:
setShare in interface INativeAccess
Parameters:
name - the name of the NavMap used by the target session

getScreenName

public java.lang.String getScreenName()
Gets the name of the host screen from the pool's NavMap

Specified by:
getScreenName in interface INativeAccess
Returns:
the name of the current screen or null if the screen was not recognized.

getRows

public int getRows()
Gets the number rows on the screen

Specified by:
getRows in interface INativeAccess
Returns:
the number of rows on the screen.

getColumns

public int getColumns()
Gets the number of columns on the screen

Specified by:
getColumns in interface INativeAccess
Returns:
the number of columns on the screen.

getCursorRow

public int getCursorRow()
Gets the current row position of the cursor

Specified by:
getCursorRow in interface INativeAccess
Returns:
the row that the cursor is on.

setCursorRow

public void setCursorRow(int inRow)
Moves the cursor vertically to the specified row.

Specified by:
setCursorRow in interface INativeAccess
Parameters:
inRow - the desired cursor row

getCursorColumn

public int getCursorColumn()
Gets the current cursor column position

Specified by:
getCursorColumn in interface INativeAccess
Returns:
the column that the cursor is on.

setCursorColumn

public void setCursorColumn(int inColumn)
Moves the cursor horizontally to the specified column.

Specified by:
setCursorColumn in interface INativeAccess
Parameters:
inColumn - the desired cursor column

getFieldCount

public int getFieldCount()
Gets the number of fields on the current screen

Specified by:
getFieldCount in interface INativeAccess
Returns:
the number of pre-defined fields on the screen.

getFieldText

public java.lang.String getFieldText(int fieldIndex)
Gets the visible text from the desired field.

Specified by:
getFieldText in interface INativeAccess
Parameters:
fieldIndex - the index of the field to retrieve text from
Returns:
the visible text from the field

getFieldText

public java.lang.String[] getFieldText()
Gets the text from all pre-defined fields on the screen.

Specified by:
getFieldText in interface INativeAccess
Returns:
an array of Strings, one for each field's text

getFieldPage

public int getFieldPage(int fieldIndex)
Gets the screen page of the desired field.

Specified by:
getFieldPage in interface INativeAccess
Parameters:
fieldIndex - the index of the field to retrieve the page from
Returns:
the field's screen page

getFieldPage

public int[] getFieldPage()
Gets the screen page of all of the fields.

Specified by:
getFieldPage in interface INativeAccess
Returns:
an array of integers, one for each field's screen page

getFieldInputText

public java.lang.String getFieldInputText(int fieldIndex)
Gets the field input text from the desired field.

Specified by:
getFieldInputText in interface INativeAccess
Parameters:
fieldIndex - the index of the field to retrieve text from
Returns:
the field input text from the field

getFieldInputText

public java.lang.String[] getFieldInputText()
Gets the text from all pre-defined input fields on the screen.

Specified by:
getFieldInputText in interface INativeAccess
Returns:
an array of Strings, one for each field's input text

setFieldInputText

public void setFieldInputText(int fieldIndex,
                              java.lang.String fieldText)
Sets the text in the desired input field.

Specified by:
setFieldInputText in interface INativeAccess
Parameters:
fieldIndex - the index of the field to write to
fieldText - the text to write to the desired field

setFieldInputText

public void setFieldInputText(java.lang.String[] fieldsText)
Sets the text in all input fields.

Specified by:
setFieldInputText in interface INativeAccess
Parameters:
fieldsText - an array of Strings to write to the screen's fields

getCharacterAttr

public long[] getCharacterAttr()
Gets the extended attribute bits for the entire screen.

Specified by:
getCharacterAttr in interface INativeAccess
Returns:
an array of longs representing the extended character attributes
See Also:
INativeAccessConstants

getFieldAttr

public long getFieldAttr(int fieldIndex)
Gets the attribute bits of the desired field.

Specified by:
getFieldAttr in interface INativeAccess
Parameters:
fieldIndex - index of the desired field
Returns:
a long representing the field's attributes
See Also:
INativeAccessConstants

getFieldAttr

public long[] getFieldAttr()
Gets the attribute bits for every field on the screen.

Specified by:
getFieldAttr in interface INativeAccess
Returns:
an array of longs representing the each field's attributes
See Also:
INativeAccessConstants

getFieldStartRow

public int getFieldStartRow(int fieldIndex)
Gets the starting row of the desired field.

Specified by:
getFieldStartRow in interface INativeAccess
Parameters:
fieldIndex - index of the desired field
Returns:
the row that the field begins on

getFieldStartRow

public int[] getFieldStartRow()
Gets the starting row of every field on the screen.

Specified by:
getFieldStartRow in interface INativeAccess
Returns:
an array of integers, one for each starting row

getFieldStartColumn

public int getFieldStartColumn(int fieldIndex)
Gets the starting column of the desired field.

Specified by:
getFieldStartColumn in interface INativeAccess
Parameters:
fieldIndex - index of the desired field
Returns:
the column that the field starts on

getFieldStartColumn

public int[] getFieldStartColumn()
Gets the starting column for each field on the screen.

Specified by:
getFieldStartColumn in interface INativeAccess
Returns:
an array of integers, one for each starting column

getFieldEndRow

public int getFieldEndRow(int fieldIndex)
Gets the ending row of the desired field.

Specified by:
getFieldEndRow in interface INativeAccess
Parameters:
fieldIndex - index for the desired field
Returns:
the row that the field ends on

getFieldEndRow

public int[] getFieldEndRow()
Gets the ending row of each field on the screen.

Specified by:
getFieldEndRow in interface INativeAccess
Returns:
an array of integers, one for each ending row.

getFieldEndColumn

public int getFieldEndColumn(int fieldIndex)
Gets the ending column for the desired field.

Specified by:
getFieldEndColumn in interface INativeAccess
Parameters:
fieldIndex - index for the desired field
Returns:
the column that the field ends on

getFieldEndColumn

public int[] getFieldEndColumn()
Gets the ending column of each field on the screen.

Specified by:
getFieldEndColumn in interface INativeAccess
Returns:
an array of integers, one for each ending column.

getFieldLength

public int getFieldLength(int fieldIndex)
Gets the length of the desired field.

Specified by:
getFieldLength in interface INativeAccess
Parameters:
fieldIndex - index of the desired field
Returns:
the length of the desired field

getFieldLength

public int[] getFieldLength()
Gets the field length for each field on the screen.

Specified by:
getFieldLength in interface INativeAccess
Returns:
an array of integers, one for each field length.

getHostType

public java.lang.String getHostType()
Gets the type of the host connection

Specified by:
getHostType in interface INativeAccess
Returns:
a String that represents the current host type.

setCommand

public void setCommand(int command)
Sets the command to execute on the screen. Does not execute the command. When execute is called, all modified fields are sent to the host, and the command is sent to the screen at the current cursor position. If command is null, execute refreshes the properties to reflect the current host screen. No command or data is sent to the host.

Specified by:
setCommand in interface INativeAccess
Parameters:
command - a string representing a command
See Also:
INativeAccessConstants

getCommand

public int getCommand()
Gets the current execution command

Specified by:
getCommand in interface INativeAccess
Returns:
an integer representing the command to execute on the screen.

setSettleTime

public void setSettleTime(int milliseconds)
Sets the settle time for the screen to become stable.

Specified by:
setSettleTime in interface INativeAccess
Parameters:
milliseconds - the number of milliseconds to wait for the screen to become stable

getSettleTime

public int getSettleTime()
Gets the amount of time that NativeAccess will wait for a screen to settle before the screen data is returned.

Specified by:
getSettleTime in interface INativeAccess
Returns:
the number of milliseconds to wait for the screen to become stable

getPageCount

public int getPageCount()
Gets the number of pages on a multi-page viewer

Specified by:
getPageCount in interface INativeAccess
Returns:
the number of pages on the current screen.

getCurrentPage

public int getCurrentPage()
Gets the current page number

Specified by:
getCurrentPage in interface INativeAccess
Returns:
the currently active page

setCurrentPage

public void setCurrentPage(int newPage)
Sets the currently active page.

Specified by:
setCurrentPage in interface INativeAccess
Parameters:
newPage - the active page

doExecute

protected void doExecute(com.attachmate.common.eai.ITaskServer server)
                  throws com.attachmate.tasks.TaskException
reset the field count to 0 if the count is invalid

Overrides:
doExecute in class com.attachmate.common.eai.tasks.NavTaskBean
com.attachmate.tasks.TaskException

Services Builder for Screens