Services Builder for Screens

com.attachmate.common.eai.tasks
Class ScreenNativeAccessEx

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

public class ScreenNativeAccessEx
extends ScreenNativeAccess
implements INativeAccessEx

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

See Also:
com.attachmate.eai.tasks.INativeAccessEx, 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
ScreenNativeAccessEx()
          Configure the task bean for NativeAccess and settings to the defaults.
 
Method Summary
 void addHostUpdateListener(IHostUpdateListener listener)
          Register class for host update events Tries to connect on every ip address for machine (if multiple network cards)
 void executeSync()
          Synchronously executes the task using the current property settings.
 long[] getCharacterAttr()
          Gets the extended attribute bits for the entire screen
 long getFieldAttr(java.lang.String fieldName)
          Gets the attribute bit for the desired field.
 int getFieldEndColumn(java.lang.String fieldName)
          Gets the ending column for the desired field
 int getFieldEndRow(java.lang.String fieldName)
          Gets the ending row for the desired field
 int getFieldIndex(java.lang.String fieldName)
          Gets the field index for the named field.
 java.lang.String getFieldInputText(int fieldIndex)
          Gets the field input text from the desired field
 java.lang.String getFieldInputText(java.lang.String fieldName)
          Gets the field input text from the desired field
 int getFieldLength(java.lang.String fieldName)
          Gets the length for the desired field
 java.lang.String getFieldName(int fieldIndex)
          Gets the name of the field from the index
 java.lang.String[] getFieldNames()
          Gets an array containing field names.
 int getFieldPage(java.lang.String fieldName)
          Gets the screen page of the desired field
 int getFieldStartColumn(java.lang.String fieldName)
          Gets the starting column for the desired field
 int getFieldStartRow(java.lang.String fieldName)
          Gets the starting row for the desired field
 java.lang.String getFieldText(java.lang.String fieldName)
          Gets the visible text from the desired field
 java.lang.String getPoolName()
          Gets the name of the pool that the bean is accessing
 int getScreenCount()
          gets the number of Screen Changes (TN3270 EORs) before the screen is returned
 java.lang.String getVersion()
          Retrieves the version of the Attachmate tool used to generate this bean.
 void removeHostUpdateListener()
          Deprecated. As of 7.1, replaced by removeHostUpdateListener( listener )
 boolean removeHostUpdateListener(IHostUpdateListener listener)
          Unregisters the supplied listener
 void setCommand(int command)
          Sets the command to execute on the screen.
 void setFieldInputText(java.lang.String fieldName, java.lang.String fieldText)
          Sets the text in the desired input field.
 void setHostUpdateListenerHostAddress(java.lang.String strOverridingHostAddress)
          Set host address that overrides value(s) retrieved from the system Use if you machine has multiple network cards
 void setHostUpdateListenerPort(int iDefaultPort)
          Change default port the socket will listen on
 void setHostUpdateListenerTimeout(long lDefaultTimeout)
          Change default timeout on socket connections and reads
 void setScreenCount(int screenCount)
          sets the number of screen changes (TN3270 EORs) processed before the screen is returned
 
Methods inherited from class com.attachmate.common.eai.tasks.ScreenNativeAccess
doExecute, getColumns, getCommand, getCurrentPage, getCursorColumn, getCursorRow, getFieldAttr, getFieldAttr, getFieldCount, getFieldEndColumn, getFieldEndColumn, getFieldEndRow, getFieldEndRow, getFieldInputText, getFieldLength, getFieldLength, getFieldPage, getFieldPage, getFieldStartColumn, getFieldStartColumn, getFieldStartRow, getFieldStartRow, getFieldText, getFieldText, getHostFlags, getHostMessage, getHostType, getPageCount, getRows, getScreenName, getSettleTime, getShare, setConfiguration, setCurrentPage, setCursorColumn, setCursorRow, setFieldInputText, setFieldInputText, setSettleTime, setShare
 
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, freeTaskServer, getInstanceName, getJobName, getLocale, getPreserveContext, getResourceName, getStatus, getTimeout, 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
 
Methods inherited from interface com.attachmate.common.eai.tasks.INativeAccess
getColumns, getCommand, getCurrentPage, getCursorColumn, getCursorRow, getFieldAttr, getFieldAttr, getFieldCount, getFieldEndColumn, getFieldEndColumn, getFieldEndRow, getFieldEndRow, getFieldInputText, getFieldLength, getFieldLength, getFieldPage, getFieldPage, getFieldStartColumn, getFieldStartColumn, getFieldStartRow, getFieldStartRow, getFieldText, getFieldText, getHostFlags, getHostMessage, getHostType, getPageCount, getRows, getScreenName, getSettleTime, getShare, setCurrentPage, setCursorColumn, setCursorRow, setFieldInputText, setFieldInputText, setSettleTime, setShare
 
Methods inherited from interface com.attachmate.tasks.ITask
addTaskListener, cancel, clearContext, copyContext, executeAsync, getInstanceName, getJobName, getLocale, getPreserveContext, getResourceName, getStatus, getTimeout, removeTaskListener, setInstanceName, setJobName, setLocale, setPreserveContext, setResourceName, setTimeout, transferContext
 

Constructor Detail

ScreenNativeAccessEx

public ScreenNativeAccessEx()
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:
executeSync(), com.attachmate.common.tasks.ITask.PRESERVE_ALWAYS
Method Detail

getFieldInputText

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

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

getCharacterAttr

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

Specified by:
getCharacterAttr in interface INativeAccess
Overrides:
getCharacterAttr in class ScreenNativeAccess
Returns:
array of int representing character attributes
See Also:
INativeAccessConstants

getScreenCount

public int getScreenCount()
gets the number of Screen Changes (TN3270 EORs) before the screen is returned

Specified by:
getScreenCount in interface INativeAccessEx
Returns:
the EOR count

setScreenCount

public void setScreenCount(int screenCount)
sets the number of screen changes (TN3270 EORs) processed before the screen is returned

Specified by:
setScreenCount in interface INativeAccessEx
Parameters:
screenCount - the screen count

setHostUpdateListenerTimeout

public void setHostUpdateListenerTimeout(long lDefaultTimeout)
Change default timeout on socket connections and reads

Specified by:
setHostUpdateListenerTimeout in interface INativeAccessEx
Parameters:
lDefaultTimeout - timeout in milliseconds, 0 for infinite

setHostUpdateListenerPort

public void setHostUpdateListenerPort(int iDefaultPort)
Change default port the socket will listen on

Specified by:
setHostUpdateListenerPort in interface INativeAccessEx
Parameters:
iDefaultPort - port, 0 for any free port. Note: ports < 1024 are reserved

setHostUpdateListenerHostAddress

public void setHostUpdateListenerHostAddress(java.lang.String strOverridingHostAddress)
Set host address that overrides value(s) retrieved from the system Use if you machine has multiple network cards

Specified by:
setHostUpdateListenerHostAddress in interface INativeAccessEx
Parameters:
strOverridingHostAddress - only host address to use

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, exec1ute refreshes the properties to reflect the current host screen. No command or data is sent to the host.

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

addHostUpdateListener

public void addHostUpdateListener(IHostUpdateListener listener)
                           throws java.lang.Exception
Register class for host update events Tries to connect on every ip address for machine (if multiple network cards)

Specified by:
addHostUpdateListener in interface INativeAccessEx
Parameters:
listener - class that implements the host update listener interface
java.lang.Exception
See Also:
ScreenChangedEvent, ScreenShapeChangeEvent, ScreenTypeChangeEvent

removeHostUpdateListener

public void removeHostUpdateListener()
Deprecated. As of 7.1, replaced by removeHostUpdateListener( listener )

Unregister all host update listeners.

Specified by:
removeHostUpdateListener in interface INativeAccessEx
See Also:
removeHostUpdateListener( IHostUpdateListener )

removeHostUpdateListener

public boolean removeHostUpdateListener(IHostUpdateListener listener)
Unregisters the supplied listener

Specified by:
removeHostUpdateListener in interface INativeAccessEx
Parameters:
listener - the listener to remove from the list
Returns:
true if the listener was removed successfully, false otherwise

getFieldText

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

Specified by:
getFieldText in interface INativeAccessEx
Parameters:
fieldName - the name of the field to retrieve text from
Returns:
the visible text from the field

getFieldPage

public int getFieldPage(java.lang.String fieldName)
Gets the screen page of the desired field

Specified by:
getFieldPage in interface INativeAccessEx
Parameters:
fieldName - the name of the field to retrieve page from
Returns:
screen page of the field

getFieldInputText

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

Specified by:
getFieldInputText in interface INativeAccessEx
Parameters:
fieldName - the name of the field to retrieve text from
Returns:
the field input text from the field

setFieldInputText

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

Specified by:
setFieldInputText in interface INativeAccessEx
Parameters:
fieldName - the name of the field to write to
fieldText - the text to write to the desired field

getFieldAttr

public long getFieldAttr(java.lang.String fieldName)
Gets the attribute bit for the desired field.

Specified by:
getFieldAttr in interface INativeAccessEx
Parameters:
fieldName - name of the desired field
Returns:
int representing the field's attributes
See Also:
INativeAccessConstants

getFieldStartRow

public int getFieldStartRow(java.lang.String fieldName)
Gets the starting row for the desired field

Specified by:
getFieldStartRow in interface INativeAccessEx
Parameters:
fieldName - name of the desired field
Returns:
the row that the field begins on

getFieldStartColumn

public int getFieldStartColumn(java.lang.String fieldName)
Gets the starting column for the desired field

Specified by:
getFieldStartColumn in interface INativeAccessEx
Parameters:
fieldName - name of the desired field
Returns:
the column that the field starts on

getFieldEndRow

public int getFieldEndRow(java.lang.String fieldName)
Gets the ending row for the desired field

Specified by:
getFieldEndRow in interface INativeAccessEx
Parameters:
fieldName - name of the desired field
Returns:
the row that the field ends on

getFieldEndColumn

public int getFieldEndColumn(java.lang.String fieldName)
Gets the ending column for the desired field

Specified by:
getFieldEndColumn in interface INativeAccessEx
Parameters:
fieldName - name of the desired field
Returns:
the column that the field ends on

getFieldLength

public int getFieldLength(java.lang.String fieldName)
Gets the length for the desired field

Specified by:
getFieldLength in interface INativeAccessEx
Parameters:
fieldName - name of the desired field
Returns:
the length of the desired field

getFieldName

public java.lang.String getFieldName(int fieldIndex)
Gets the name of the field from the index

Specified by:
getFieldName in interface INativeAccessEx
Parameters:
fieldIndex - index of the field
Returns:
the name of the field

getFieldNames

public java.lang.String[] getFieldNames()
Gets an array containing field names.

Specified by:
getFieldNames in interface INativeAccessEx
Returns:
a String array containing all the fields' names

getFieldIndex

public int getFieldIndex(java.lang.String fieldName)
Description copied from interface: INativeAccessEx
Gets the field index for the named field.

Specified by:
getFieldIndex in interface INativeAccessEx
Returns:
the field index or -1 if not found

getVersion

public java.lang.String getVersion()
Retrieves the version of the Attachmate tool used to generate this bean. This information is either a bean generator input parameter or else it is contained in the input task data.

Specified by:
getVersion in interface ITask
Overrides:
getVersion in class com.attachmate.common.eai.tasks.BaseTaskBean
Returns:
version number

getPoolName

public java.lang.String getPoolName()
Gets the name of the pool that the bean is accessing

Specified by:
getPoolName in interface INativeAccess
Overrides:
getPoolName in class ScreenNativeAccess
Returns:
the pool name

executeSync

public void executeSync()
                 throws ResourceInUseException
Synchronously executes the task using the current property settings. Fires task status change events to track the task execution progress. Does not return until the task completes, times out or is canceled. Uses the currently owned context, or creates one if none has been set.

Specified by:
executeSync in interface ITask
Overrides:
executeSync in class com.attachmate.common.eai.tasks.BaseTaskBean
Throws:
NoAvailableResourceException - if no resource can be obtained for execution
ResourceInUseException - if task is already executing
See Also:
BaseTaskBean.executeAsync( ), BaseTaskBean.cancel( ), ITaskListener, TaskStatusChangeEvent

Services Builder for Screens