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 Summary
Fields Modifier and Type Field Description static int
STATE_AnyLock
If one of these bits are set, a lock state is present.static int
STATE_Connected
Connected.static int
STATE_Connecting
Connecting.static int
STATE_Error
General error flag.static int
STATE_FieldFullError
3270: X-stickman>static int
STATE_InsertMode
General insert mode flag.static int
STATE_Lock
General lock flag.static int
STATE_MessageWaiting
5250: MW.static int
STATE_MinusError
3270: X-f.static int
STATE_NonNumericError
3270.static int
STATE_OnFieldOrProtected
3270.static int
STATE_ReceiveWait
Waiting for data.static int
STATE_Reconnecting
Reconnecting.static int
STATE_Secure
Secured with SSL communication.static int
STATE_Sending
Sending data pending.static int
STATE_SSCPLUOwned
3270: 4Bstickman.static int
STATE_SystemAvailable
General system availability.
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
connect()
Connects the session to host.boolean
disconnect()
Disconnects 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, java.lang.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.java.lang.String
getAllowedCharacters()
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.SocketCommNIO
getComm()
Gets the communication engine.Position
getCursor()
Gets the current host cursor position.java.lang.String
getDeviceName()
Gets the device name of the session.int
getHomeAddress()
Gets the host address index on the screen.HostSession
getHostSession()
Gets the HostSession, i.e.java.lang.String
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).int
getScreenLength()
Gets the current screen length (width * height).Size
getScreenSize()
Gets the current screen size.int
getSessionState()
Gets the current session state.boolean
is3270()
Checks if a session is 3270 or 5250.boolean
isAutoReconnectSessionEnabled()
Checks if the use of auto reconnect session is handled or not.boolean
isDisplayInSystemRequestMode()
Checks if the display (5250 only) is in System Request mode.boolean
isFieldFormatted()
Checks if this host screen is field formatted.boolean
isPrinter()
Checks if this is a printer or not.boolean
isProcessingDataStream()
Checks 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(java.lang.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, java.lang.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, java.lang.String string)
Sets a string to a host field.boolean
setHostStringAsKeys(int x, int y, int offset, int length, java.lang.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(java.lang.String errMsg)
Sets the last error message of the session.
Field Detail
STATE_Lock
static final int STATE_Lock
General lock flag.- See Also:
- Constant Field Values
STATE_Error
static final int STATE_Error
General error flag.- See Also:
- Constant Field Values
STATE_SystemAvailable
static final int STATE_SystemAvailable
General system availability.- See Also:
- Constant Field Values
STATE_InsertMode
static final int STATE_InsertMode
General insert mode flag.- See Also:
- Constant Field Values
STATE_Sending
static final int STATE_Sending
Sending data pending.- See Also:
- Constant Field Values
STATE_ReceiveWait
static final int STATE_ReceiveWait
Waiting for data.- See Also:
- Constant Field Values
STATE_Secure
static final int STATE_Secure
Secured with SSL communication.- See Also:
- Constant Field Values
STATE_MessageWaiting
static final int STATE_MessageWaiting
5250: MW.- See Also:
- Constant Field Values
STATE_SSCPLUOwned
static final int STATE_SSCPLUOwned
3270: 4Bstickman.- See Also:
- Constant Field Values
STATE_FieldFullError
static final int STATE_FieldFullError
3270: X-stickman>- See Also:
- Constant Field Values
STATE_MinusError
static final int STATE_MinusError
3270: X-f.- See Also:
- Constant Field Values
STATE_OnFieldOrProtected
static final int STATE_OnFieldOrProtected
3270.- See Also:
- Constant Field Values
STATE_NonNumericError
static final int STATE_NonNumericError
3270.- See Also:
- Constant Field Values
STATE_Connecting
static final int STATE_Connecting
Connecting.- See Also:
- Constant Field Values
STATE_Reconnecting
static final int STATE_Reconnecting
Reconnecting.- See Also:
- Constant Field Values
STATE_Connected
static final int STATE_Connected
Connected.- See Also:
- Constant Field Values
STATE_AnyLock
static final int STATE_AnyLock
If one of these bits are set, a lock state is present.- See Also:
- Constant Field Values
Method Detail
connect
boolean connect()
Connects the session to host.
disconnect
boolean disconnect()
Disconnects the session from host.
getScreenSize
Size getScreenSize()
Gets the current screen size.
getScreenLength
int getScreenLength()
Gets the current screen length (width * height).
sendCharacterString
boolean sendCharacterString(java.lang.String keys)
Sends character keystrokes to host.
sendKey
boolean sendKey(int key)
Sends keystrokes to host.- See Also:
HostSendKeys
setHostString
boolean setHostString(int x, int y, int offset, int length, java.lang.String string)
Sets a string to a host field.
setHostStringAsKeys
boolean setHostStringAsKeys(int x, int y, int offset, int length, java.lang.String string)
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.
doesHostNeedFieldExit
boolean doesHostNeedFieldExit(int x, int y, int offset, int length, java.lang.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.- Returns:
- false=field doesn't require field exit, true=field requires field exit.
setCursor
boolean setCursor(int x, int y)
Sets the host cursor position.
getCursor
Position getCursor()
Gets the current host cursor position.
getCharactersAndAttributes
void getCharactersAndAttributes(char[] chars, int[] attrbs, int beginPos, int endPos)
Gets the characters and attributes between two positions, including the end position.
getCharactersAndAttributes
void 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.
getSessionState
int getSessionState()
Gets the current session state.- Returns:
- A combination of HostSessionPeer.STATE_* flags is returned.
getComm
SocketCommNIO getComm()
Gets the communication engine.- Returns:
- The NIO instance.
refreshHostFields
void refreshHostFields(HostFields fields)
Refreshes the host fields of the current session. The host session will add all available host fields sorted left to right, top to bottom.
is3270
boolean is3270()
Checks if a session is 3270 or 5250.- Returns:
- false if 5250,
true if 3270.
isPrinter
boolean isPrinter()
Checks if this is a printer or not.
getLastError
java.lang.String getLastError(boolean doClear)
Gets the last error message of the session.- Returns:
- null if the session doesn't support it (3270 doesn't).
setLastError
void setLastError(java.lang.String errMsg)
Sets the last error message of the session.
getDeviceName
java.lang.String getDeviceName()
Gets the device name of the session.- Returns:
- null if no device name exists.
isProcessingDataStream
boolean isProcessingDataStream()
Checks if the session is currently processing data stream commands to update the screen/cursor, state, etc.
setInsertMode
boolean setInsertMode(boolean on)
Sets the insert mode.- Returns:
- true for success, false for failure.
doesFieldHaveExtendedAttributes
boolean doesFieldHaveExtendedAttributes(HostField hostField)
Checks if a host field has extended attributes or not. 5250 never has, but 3270 could have, e.g. special highlighting.
getNewCharAttribute
int getNewCharAttribute(HostField hostField)
Gets the attribute to use for new characters in a field that contains extended attributes (always zero for non-3270).
getClientHostFieldFlags
int getClientHostFieldFlags(HostField hostField)
Gets flags that are required for the client host fields for local editing, etc.
isAutoReconnectSessionEnabled
boolean isAutoReconnectSessionEnabled()
Checks if the use of auto reconnect session is handled or not.
getHomeAddress
int getHomeAddress()
Gets the host address index on the screen.
setHostField
boolean setHostField(HostField hostField, java.lang.String data, int[] attrs)
Sets a host field fully with text data and perhaps attributes (if these are non-null).- Returns:
- true for success, false for failure.
getAllowedCharacters
java.lang.String 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".
isFieldFormatted
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.
isDisplayInSystemRequestMode
boolean isDisplayInSystemRequestMode()
Checks if the display (5250 only) is in System Request mode.
getHostSession
HostSession getHostSession()
Gets the HostSession, i.e. the owner of the peer.