Package com.iizix.term
Class EmptyHostSession
java.lang.Object
com.iizix.term.EmptyHostSession
- All Implemented Interfaces:
HostSessionPeer
The empty host session peer.
Field Summary
Fields inherited from interface com.iizix.term.HostSessionPeer
STATE_AnyLock, STATE_Connected, STATE_Connecting, STATE_Error, STATE_FieldFullError, STATE_InsertMode, STATE_Lock, STATE_MessageWaiting, STATE_MinusError, STATE_NonNumericError, STATE_OnFieldOrProtected, STATE_ReceiveWait, STATE_Reconnecting, STATE_Secure, STATE_Sending, STATE_SSCPLUOwned, STATE_SystemAvailableMethod Summary
Modifier and TypeMethodDescriptionbooleanconnect()Connects the session to host.booleanDisconnects the session from host.booleandoesFieldHaveExtendedAttributes(HostField hostField) Checks if a host field has extended attributes or not.booleandoesHostNeedFieldExit(int x, int y, int offset, int length, String string) For 5250 only: checks if a field has the attributes that requires this particular string to enter the data followed by a "Field Exit" or "Field Minus" key.Gets the string of characters that can be input by the user using the configured host code page for this session.voidgetCharactersAndAttributes(char[] chars, int[] attrs, int beginPos, int endPos) Gets the characters and attributes between two positions, including the end position.voidgetCharactersAndAttributes(char[] chars, int[] attrs, int beginPos, int endPos, char fieldOrNullChar) Gets the characters and attributes between two positions, including the end position.intgetClientHostFieldFlags(HostField hostField) Gets flags that are required for the client host fields for local editing, etc.getComm()Gets the communication engine.Gets the current host cursor position.Gets the device name of the session.intGets the host address index on the screen.Gets the host session.getLastError(boolean doClear) Gets the last error message of the session.intgetNewCharAttribute(HostField hostField) Gets the attribute to use for new characters in a field that contains extended attributes (always zero for non-3270).intGets the current screen length (width * height).Gets the current screen size.intGets the current session state.booleanis3270()Checks if a session is 3270 or 5250.booleanChecks if the use of auto reconnect session is handled or not.booleanNever in system request mode.booleanChecks if this host screen is field formatted.booleanChecks if this is a printer or not (always false).booleanChecks if the session is currently processing data stream commands to update the screen/cursor, state, etc.voidrefreshHostFields(HostFields fields) Refreshes the host fields of the current session.booleansendCharacterString(String keys) Sends character keystrokes to host.booleansendKey(int key) Sends character keystrokes to host.booleansetCursor(int x, int y) Sets the host cursor position.booleansetHostField(HostField hostField, String data, int[] attrs) Sets a host field fully with text data and perhaps attributes (if these are non-null).booleansetHostString(int x, int y, int originalOffset, int length, String string) Sets a string to a host field.booleansetHostStringAsKeys(int x, int y, int offset, int length, String string) Sets a string to a host field just as if the user typed the characters.booleansetInsertMode(boolean m) Sets the insert mode on or off.voidsetLastError(String errMsg) Sets the last error message of the session.
Method Details
is3270
public boolean is3270()Checks if a session is 3270 or 5250.- Specified by:
is3270in interfaceHostSessionPeer- Returns:
- true is always 3270.
isProcessingDataStream
public boolean isProcessingDataStream()Checks if the session is currently processing data stream commands to update the screen/cursor, state, etc.- Specified by:
isProcessingDataStreamin interfaceHostSessionPeer
connect
public boolean connect()Connects the session to host.- Specified by:
connectin interfaceHostSessionPeer
disconnect
public boolean disconnect()Disconnects the session from host.- Specified by:
disconnectin interfaceHostSessionPeer
sendCharacterString
Sends character keystrokes to host.- Specified by:
sendCharacterStringin interfaceHostSessionPeer
sendKey
public boolean sendKey(int key) Sends character keystrokes to host.- Specified by:
sendKeyin interfaceHostSessionPeer- See Also:
setHostString
Sets a string to a host field.- Specified by:
setHostStringin interfaceHostSessionPeer
setHostStringAsKeys
Sets a string to a host field just as if the user typed the characters. The host field is first cleared with (3270) Clear EOF or (5250) Field Exit or Field Minus (for negative numbers in a numeric field). The string is then entered as a set of keystrokes, followed by a potential Field Exit or Field Minus (for negative numbers in a numeric field), but only for 5250.- Specified by:
setHostStringAsKeysin interfaceHostSessionPeer
doesHostNeedFieldExit
For 5250 only: checks if a field has the attributes that requires this particular string to enter the data followed by a "Field Exit" or "Field Minus" key. For 3270 it's always false.- Specified by:
doesHostNeedFieldExitin interfaceHostSessionPeer- Returns:
- false=field doesn't require field exit, true=field requires field exit.
setCursor
public boolean setCursor(int x, int y) Sets the host cursor position.- Specified by:
setCursorin interfaceHostSessionPeer
getCursor
Gets the current host cursor position.- Specified by:
getCursorin interfaceHostSessionPeer
getScreenSize
Gets the current screen size.- Specified by:
getScreenSizein interfaceHostSessionPeer
getScreenLength
public int getScreenLength()Gets the current screen length (width * height).- Specified by:
getScreenLengthin interfaceHostSessionPeer
getSessionState
public int getSessionState()Gets the current session state.- Specified by:
getSessionStatein interfaceHostSessionPeer- Returns:
- A combination of HostSessionPeer.STATE_* flags is returned.
getCharactersAndAttributes
public void getCharactersAndAttributes(char[] chars, int[] attrs, int beginPos, int endPos) Gets the characters and attributes between two positions, including the end position.- Specified by:
getCharactersAndAttributesin interfaceHostSessionPeer
getCharactersAndAttributes
public void getCharactersAndAttributes(char[] chars, int[] attrs, int beginPos, int endPos, char fieldOrNullChar) Gets the characters and attributes between two positions, including the end position. The character "fieldOrNullChar" is the character that will be used instead of field attributes and null characters.- Specified by:
getCharactersAndAttributesin interfaceHostSessionPeer
refreshHostFields
Refreshes the host fields of the current session. The host session will add all available host fields sorted left to right, top to bottom.- Specified by:
refreshHostFieldsin interfaceHostSessionPeer
setInsertMode
public boolean setInsertMode(boolean m) Sets the insert mode on or off.- Specified by:
setInsertModein interfaceHostSessionPeer- Returns:
- true for success, false for failure.
getLastError
Gets the last error message of the session.- Specified by:
getLastErrorin interfaceHostSessionPeer- Returns:
- null if the session doesn't support it (3270 doesn't).
setLastError
Sets the last error message of the session.- Specified by:
setLastErrorin interfaceHostSessionPeer
getDeviceName
Gets the device name of the session.- Specified by:
getDeviceNamein interfaceHostSessionPeer- Returns:
- null always.
isPrinter
public boolean isPrinter()Checks if this is a printer or not (always false).- Specified by:
isPrinterin interfaceHostSessionPeer
doesFieldHaveExtendedAttributes
Checks if a host field has extended attributes or not. 5250 never has, but 3270 could have, e.g. special highlighting.- Specified by:
doesFieldHaveExtendedAttributesin interfaceHostSessionPeer
getNewCharAttribute
Gets the attribute to use for new characters in a field that contains extended attributes (always zero for non-3270).- Specified by:
getNewCharAttributein interfaceHostSessionPeer
getClientHostFieldFlags
Gets flags that are required for the client host fields for local editing, etc.- Specified by:
getClientHostFieldFlagsin interfaceHostSessionPeer
isAutoReconnectSessionEnabled
public boolean isAutoReconnectSessionEnabled()Checks if the use of auto reconnect session is handled or not.- Specified by:
isAutoReconnectSessionEnabledin interfaceHostSessionPeer
getHomeAddress
public int getHomeAddress()Gets the host address index on the screen.- Specified by:
getHomeAddressin interfaceHostSessionPeer
setHostField
Sets a host field fully with text data and perhaps attributes (if these are non-null).- Specified by:
setHostFieldin interfaceHostSessionPeer- Returns:
- true for success, false for failure.
getAllowedCharacters
Gets the string of characters that can be input by the user using the configured host code page for this session.If the return string is empty, for the EE package for example, all characters are "input'able".
- Specified by:
getAllowedCharactersin interfaceHostSessionPeer
isFieldFormatted
public boolean isFieldFormatted()Checks if this host screen is field formatted. This method is not like the one in HostScreen, this one checks directly to see if any fields are present.- Specified by:
isFieldFormattedin interfaceHostSessionPeer
isDisplayInSystemRequestMode
public boolean isDisplayInSystemRequestMode()Never in system request mode.- Specified by:
isDisplayInSystemRequestModein interfaceHostSessionPeer
getComm
Gets the communication engine.- Specified by:
getCommin interfaceHostSessionPeer- Returns:
- The NIO instance.
getHostSession
Gets the host session.- Specified by:
getHostSessionin interfaceHostSessionPeer