Package com.iizix.term
Interface HostSessionPeer
- All Known Implementing Classes:
- EmptyHostSession,- HostSession3270,- HostSession5250,- HostSessionEE
public interface HostSessionPeer
The interface for 3270 or 5250 host sessions.
It is also a collection of host session states.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final intIf one of these bits are set, a lock state is present.- static final intConnected.- static final intConnecting.- static final intGeneral error flag.- static final int3270: X-stickman>- static final intGeneral insert mode flag.- static final intGeneral lock flag.- static final int5250: MW.- static final int3270: X-f.- static final int3270.- static final int3270.- static final intWaiting for data.- static final intReconnecting.- static final intSecured with SSL communication.- static final intSending data pending.- static final int3270: 4Bstickman.- static final intGeneral system availability.
- Method SummaryModifier and TypeMethodDescription- boolean- connect()Connects the session to host.- booleanDisconnects the session from host.- boolean- doesFieldHaveExtendedAttributes- (HostField hostField) Checks if a host field has extended attributes or not.- boolean- doesHostNeedFieldExit- (int x, int y, int offset, int length, String string) For 5250: 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.- void- getCharactersAndAttributes- (char[] chars, int[] attrbs, int beginPos, int endPos) Gets the characters and attributes between two positions, including the end position.- void- getCharactersAndAttributes- (char[] chars, int[] attrbs, int beginPos, int endPos, char fieldOrNullChar) Gets the characters and attributes between two positions, including the end position.- int- getClientHostFieldFlags- (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 HostSession, i.e.- getLastError- (boolean doClear) Gets the last error message of the session.- int- getNewCharAttribute- (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.- boolean- is3270()Checks if a session is 3270 or 5250.- booleanChecks if the use of auto reconnect session is handled or not.- booleanChecks if the display (5250 only) is in System Request mode.- booleanChecks if this host screen is field formatted.- booleanChecks if this is a printer or not.- booleanChecks if the session is currently processing data stream commands to update the screen/cursor, state, etc.- void- refreshHostFields- (HostFields fields) Refreshes the host fields of the current session.- boolean- sendCharacterString- (String keys) Sends character keystrokes to host.- boolean- sendKey- (int key) Sends keystrokes to host.- boolean- setCursor- (int x, int y) Sets the host cursor position.- boolean- setHostField- (HostField hostField, String data, int[] attrs) Sets a host field fully with text data and perhaps attributes (if these are non-null).- boolean- setHostString- (int x, int y, int offset, int length, String string) Sets a string to a host field.- boolean- setHostStringAsKeys- (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.- boolean- setInsertMode- (boolean on) Sets the insert mode.- void- setLastError- (String errMsg) Sets the last error message of the session.
- Field Details- STATE_Lockstatic final int STATE_LockGeneral lock flag.- See Also:
 
- STATE_Errorstatic final int STATE_ErrorGeneral error flag.- See Also:
 
- STATE_SystemAvailablestatic final int STATE_SystemAvailableGeneral system availability.- See Also:
 
- STATE_InsertModestatic final int STATE_InsertModeGeneral insert mode flag.- See Also:
 
- STATE_Sendingstatic final int STATE_SendingSending data pending.- See Also:
 
- STATE_ReceiveWaitstatic final int STATE_ReceiveWaitWaiting for data.- See Also:
 
- STATE_Securestatic final int STATE_SecureSecured with SSL communication.- See Also:
 
- STATE_MessageWaitingstatic final int STATE_MessageWaiting5250: MW.- See Also:
 
- STATE_SSCPLUOwnedstatic final int STATE_SSCPLUOwned3270: 4Bstickman.- See Also:
 
- STATE_FieldFullErrorstatic final int STATE_FieldFullError3270: X-stickman>- See Also:
 
- STATE_MinusErrorstatic final int STATE_MinusError3270: X-f.- See Also:
 
- STATE_OnFieldOrProtectedstatic final int STATE_OnFieldOrProtected3270.- See Also:
 
- STATE_NonNumericErrorstatic final int STATE_NonNumericError3270.- See Also:
 
- STATE_Connectingstatic final int STATE_ConnectingConnecting.- See Also:
 
- STATE_Reconnectingstatic final int STATE_ReconnectingReconnecting.- See Also:
 
- STATE_Connectedstatic final int STATE_ConnectedConnected.- See Also:
 
- STATE_AnyLockstatic final int STATE_AnyLockIf one of these bits are set, a lock state is present.- See Also:
 
 
- Method Details- connectboolean connect()Connects the session to host.
- disconnectboolean disconnect()Disconnects the session from host.
- getScreenSizeSize getScreenSize()Gets the current screen size.
- getScreenLengthint getScreenLength()Gets the current screen length (width * height).
- sendCharacterStringSends character keystrokes to host.
- sendKeyboolean sendKey- (int key) Sends keystrokes to host.- See Also:
 
- setHostStringSets a string to a host field.
- setHostStringAsKeysSets 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.
- doesHostNeedFieldExitFor 5250: 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.- Returns:
- false=field doesn't require field exit, true=field requires field exit.
 
- setCursorboolean setCursor- (int x, int y) Sets the host cursor position.
- getCursorPosition getCursor()Gets the current host cursor position.
- getCharactersAndAttributesvoid getCharactersAndAttributes- (char[] chars, int[] attrbs, int beginPos, int endPos) Gets the characters and attributes between two positions, including the end position.
- getCharactersAndAttributesvoid getCharactersAndAttributes- (char[] chars, int[] attrbs, 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.
- getSessionStateint getSessionState()Gets the current session state.- Returns:
- A combination of HostSessionPeer.STATE_* flags is returned.
 
- getCommSocketCommNIO getComm()Gets the communication engine.- Returns:
- The NIO instance.
 
- refreshHostFieldsRefreshes the host fields of the current session. The host session will add all available host fields sorted left to right, top to bottom.
- is3270boolean is3270()Checks if a session is 3270 or 5250.- Returns:
- false if 5250,
 true if 3270.
 
- isPrinterboolean isPrinter()Checks if this is a printer or not.
- getLastErrorGets the last error message of the session.- Returns:
- null if the session doesn't support it (3270 doesn't).
 
- setLastErrorSets the last error message of the session.
- getDeviceNameString getDeviceName()Gets the device name of the session.- Returns:
- null if no device name exists.
 
- isProcessingDataStreamboolean isProcessingDataStream()Checks if the session is currently processing data stream commands to update the screen/cursor, state, etc.
- setInsertModeboolean setInsertMode- (boolean on) Sets the insert mode.- Returns:
- true for success, false for failure.
 
- doesFieldHaveExtendedAttributesChecks if a host field has extended attributes or not. 5250 never has, but 3270 could have, e.g. special highlighting.
- getNewCharAttributeGets the attribute to use for new characters in a field that contains extended attributes (always zero for non-3270).
- getClientHostFieldFlagsGets flags that are required for the client host fields for local editing, etc.
- isAutoReconnectSessionEnabledboolean isAutoReconnectSessionEnabled()Checks if the use of auto reconnect session is handled or not.
- getHomeAddressint getHomeAddress()Gets the host address index on the screen.
- setHostFieldSets a host field fully with text data and perhaps attributes (if these are non-null).- Returns:
- true for success, false for failure.
 
- getAllowedCharactersString 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 "inputable". 
- isFieldFormattedboolean 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.
- isDisplayInSystemRequestModeboolean isDisplayInSystemRequestMode()Checks if the display (5250 only) is in System Request mode.
- getHostSessionHostSession getHostSession()Gets the HostSession, i.e. the owner of the peer.