Package com.iizix.term.tn3270e
Class HostSession3270
java.lang.Object
com.iizix.term.tn3270e.HostSession3270
- All Implemented Interfaces:
- TelnetCommListener,- HostSessionPeer
The 3270 host session peer.
- Field SummaryFields- 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_SystemAvailable
- Constructor SummaryConstructorsConstructorDescription- HostSession3270- (HostSession owner, TerminalProps properties) Constructor only from this package.
- 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 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.- com.iizix.term.tn3270e.HostSession3270PrinterGets the 3270 printer session "associated" with this terminal session, null if no printer is associated.- 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).Gets the owner (terminal) host session for the printer session.- intGets the current screen length (width * height).Gets the current screen size.- intGets the current session state.- void- hostAcceptedDataStream- (TelnetComm comm, String terminalType) The host accepted the options for the terminal type and went into BINARY mode.- 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 is in System Request mode for 5250 only.- 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.- void- onCommClosed- (TelnetComm comm) Called when the communication link is closed.- void- onCommConnected- (TelnetComm comm) Called when the communication link is connected.- void- onCommError- (TelnetComm comm, IOException e) Called when the communication link is closed.- void- onCommOpen- (TelnetComm comm) Called when the communication link is opened.- void- onCommState- (SocketCommNIO comm) Called when the state changes.- void- processInboundDataStream- (TelnetComm comm, byte[] inputBuf, int pos, int inputBufLen) Processes the inbound 3270 or 5250 data stream.- void- processInboundSCSDataStream- (TelnetComm comm, byte[] inputBuf, int inputBufLen) Processes the inbound 3270 printer data stream.- void- processInboundSSCPLUDataStream- (TelnetComm comm, byte[] inputBuf, int pos, int inputBufLen) Processes the inbound 3270 SSCP-LU data stream.- void- processPrintEOJ- (TelnetComm comm) Processes a Print End-of-Job for 3270 printers.- 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 character 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- displayThe 3270 display instance.
 
- Constructor Details- HostSession3270Constructor only from this package.- Parameters:
- owner- Owner of session.
- properties- The terminal and communication properties.
- Throws:
- IOException- for errors.
 
 
- Method Details- getHostSessionGets the HostSession, i.e. the owner of the peer.- Specified by:
- getHostSessionin interface- HostSessionPeer
 
- is3270public boolean is3270()Checks if a session is 3270 or 5250.- Specified by:
- is3270in interface- HostSessionPeer
- Returns:
- true is always 3270.
 
- isProcessingDataStreampublic boolean isProcessingDataStream()Checks if the session is currently processing data stream commands to update the screen/cursor, state, etc.- Specified by:
- isProcessingDataStreamin interface- HostSessionPeer
 
- connectpublic boolean connect()Connects the session to host.- Specified by:
- connectin interface- HostSessionPeer
 
- disconnectpublic boolean disconnect()Disconnects the session from host.- Specified by:
- disconnectin interface- HostSessionPeer
 
- sendCharacterStringSends character keystrokes to host.- Specified by:
- sendCharacterStringin interface- HostSessionPeer
 
- sendKeypublic boolean sendKey- (int key) Sends character keystrokes to host.- Specified by:
- sendKeyin interface- HostSessionPeer
- See Also:
 
- setHostStringSets a string to a host field.- Specified by:
- setHostStringin interface- HostSessionPeer
 
- 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.- Specified by:
- setHostStringAsKeysin interface- HostSessionPeer
 
- doesHostNeedFieldExitFor 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 interface- HostSessionPeer
- Returns:
- false=field doesn't require field exit, true=field requires field exit.
 
- setCursorpublic boolean setCursor- (int x, int y) Sets the host cursor position.- Specified by:
- setCursorin interface- HostSessionPeer
 
- getLastErrorGets the last error message of the session.- Specified by:
- getLastErrorin interface- HostSessionPeer
- Returns:
- null if the session doesn't support it (3270 doesn't).
 
- setLastErrorSets the last error message of the session.- Specified by:
- setLastErrorin interface- HostSessionPeer
 
- getCursorGets the current host cursor position.- Specified by:
- getCursorin interface- HostSessionPeer
 
- getScreenSizeGets the current screen size.- Specified by:
- getScreenSizein interface- HostSessionPeer
 
- getScreenLengthpublic int getScreenLength()Gets the current screen length (width * height).- Specified by:
- getScreenLengthin interface- HostSessionPeer
 
- getSessionStatepublic int getSessionState()Gets the current session state.- Specified by:
- getSessionStatein interface- HostSessionPeer
- Returns:
- A combination of HostSessionPeer.STATE_* flags is returned.
 
- getCharactersAndAttributespublic void getCharactersAndAttributes- (char[] chars, int[] attrbs, int beginPos, int endPos) Gets the characters and attributes between two positions, including the end position.- Specified by:
- getCharactersAndAttributesin interface- HostSessionPeer
 
- getCharactersAndAttributespublic 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.- Specified by:
- getCharactersAndAttributesin interface- HostSessionPeer
 
- refreshHostFieldsRefreshes 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 interface- HostSessionPeer
 
- getDeviceNameGets the device name of the session.- Specified by:
- getDeviceNamein interface- HostSessionPeer
- Returns:
- null if no device name exists.
 
- isPrinterpublic boolean isPrinter()Checks if this is a printer or not (always false).- Specified by:
- isPrinterin interface- HostSessionPeer
 
- setInsertModepublic boolean setInsertMode- (boolean on) Sets the insert mode.- Specified by:
- setInsertModein interface- HostSessionPeer
- 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.- Specified by:
- doesFieldHaveExtendedAttributesin interface- HostSessionPeer
 
- getNewCharAttributeGets the attribute to use for new characters in a field that contains extended attributes (always zero for non-3270).- Specified by:
- getNewCharAttributein interface- HostSessionPeer
 
- getClientHostFieldFlagsGets flags that are required for the client host fields for local editing, etc.- Specified by:
- getClientHostFieldFlagsin interface- HostSessionPeer
 
- isAutoReconnectSessionEnabledpublic boolean isAutoReconnectSessionEnabled()Checks if the use of auto reconnect session is handled or not.- Specified by:
- isAutoReconnectSessionEnabledin interface- HostSessionPeer
 
- getHomeAddresspublic int getHomeAddress()Gets the host address index on the screen.- Specified by:
- getHomeAddressin interface- HostSessionPeer
- Returns:
- -1 if none is available.
 
- setHostFieldSets a host field fully with text data and perhaps attributes (if these are non-null).- Specified by:
- setHostFieldin interface- HostSessionPeer
- Returns:
- true for success, false for failure.
 
- getAllowedCharactersGets 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". - Specified by:
- getAllowedCharactersin interface- HostSessionPeer
 
- isFieldFormattedpublic 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 interface- HostSessionPeer
 
- getAssociated3270Printerpublic com.iizix.term.tn3270e.HostSession3270Printer getAssociated3270Printer()Gets the 3270 printer session "associated" with this terminal session, null if no printer is associated.- Returns:
- The associated 3270 printer, null for none.
 
- getOwnerHostSessionGets the owner (terminal) host session for the printer session.- Returns:
- null for no printer session or printer is not yet associated with a session.
 
- isDisplayInSystemRequestModepublic boolean isDisplayInSystemRequestMode()Checks if the display is in System Request mode for 5250 only.- Specified by:
- isDisplayInSystemRequestModein interface- HostSessionPeer
 
- onCommOpenDescription copied from interface:- TelnetCommListenerCalled when the communication link is opened.- Specified by:
- onCommOpenin interface- TelnetCommListener
- Parameters:
- comm- The telnet communication instance.
 
- onCommConnectedDescription copied from interface:- TelnetCommListenerCalled when the communication link is connected.- Specified by:
- onCommConnectedin interface- TelnetCommListener
- Parameters:
- comm- The telnet communication instance.
 
- hostAcceptedDataStreamDescription copied from interface:- TelnetCommListenerThe host accepted the options for the terminal type and went into BINARY mode. This means that 3270/5250 data stream will follow. Inform the host session listener of a connect change.- Specified by:
- hostAcceptedDataStreamin interface- TelnetCommListener
- Parameters:
- comm- The telnet communication instance.
- terminalType- The terminal type accepted by the host at Telnet terminal negotiation.
 
- processInboundDataStreampublic void processInboundDataStream- (TelnetComm comm, byte[] inputBuf, int pos, int inputBufLen) throws IOException Description copied from interface:- TelnetCommListenerProcesses the inbound 3270 or 5250 data stream.- Specified by:
- processInboundDataStreamin interface- TelnetCommListener
- Parameters:
- comm- The telnet communication instance.
- inputBuf- The input buffer.
- pos- Start position in buffer.
- inputBufLen- Length of input buffer.
- Throws:
- IOException- If an I/O error occurs.
 
- processInboundSCSDataStreampublic void processInboundSCSDataStream- (TelnetComm comm, byte[] inputBuf, int inputBufLen) throws IOException Description copied from interface:- TelnetCommListenerProcesses the inbound 3270 printer data stream. Processing of the buffer always starts at position 0.- Specified by:
- processInboundSCSDataStreamin interface- TelnetCommListener
- Parameters:
- comm- The telnet communication instance.
- inputBuf- The input buffer.
- inputBufLen- Length of input buffer.
- Throws:
- IOException- If an I/O error occurs.
 
- processInboundSSCPLUDataStreampublic void processInboundSSCPLUDataStream- (TelnetComm comm, byte[] inputBuf, int pos, int inputBufLen) throws IOException Description copied from interface:- TelnetCommListenerProcesses the inbound 3270 SSCP-LU data stream.- Specified by:
- processInboundSSCPLUDataStreamin interface- TelnetCommListener
- Parameters:
- comm- The telnet communication instance.
- inputBuf- The input buffer.
- pos- Start position in buffer.
- inputBufLen- Length of input buffer.
- Throws:
- IOException- If an I/O error occurs.
 
- processPrintEOJDescription copied from interface:- TelnetCommListenerProcesses a Print End-of-Job for 3270 printers.- Specified by:
- processPrintEOJin interface- TelnetCommListener
- Parameters:
- comm- The telnet communication instance.
- Throws:
- IOException- If an I/O error occurs.
 
- onCommErrorDescription copied from interface:- TelnetCommListenerCalled when the communication link is closed.- Specified by:
- onCommErrorin interface- TelnetCommListener
- Parameters:
- comm- The telnet communication instance.
- e- The exception.
 
- getCommGets the communication engine.- Specified by:
- getCommin interface- HostSessionPeer
- Returns:
- The NIO instance.
 
- onCommStateCalled when the state changes.- Specified by:
- onCommStatein interface- TelnetCommListener
- Parameters:
- comm- Socket communication instance.
 
- onCommClosedDescription copied from interface:- TelnetCommListenerCalled when the communication link is closed.- Specified by:
- onCommClosedin interface- TelnetCommListener
- Parameters:
- comm- The telnet communication instance.