Package com.iizix.term.server
Class TerminalHost
java.lang.Object
com.iizix.term.server.TerminalHost
- All Implemented Interfaces:
- HostSessionListener,- HostSessionOwner
The terminal host implementation running a terminal of 3270, 5020 or EE type.
- Author:
- Christopher Mindus
- Constructor SummaryConstructorsConstructorDescription- TerminalHost- (TerminalProps terminalProps, AppSessionGyro appGyro) The constructor.
- Method SummaryModifier and TypeMethodDescription- boolean- addListener- (ITerminalStateListener listener) Adds a new listeners.Creates a HostSession if not already created.- void- dispose()Dispose.Gets the host session instance.Gets the matching screens.Gets the SessionInfo.Gets the worker of the session.- booleanChecks if session is connectable.- booleanChecks if session is disconnectable.- booleanChecks if session can be resumed.- booleanChecks if session can be suspended.- void- onConnectChange- (HostSessionPeer peer, boolean connected) Notifies the session of a connect state change.- void- onCursorPositionChange- (HostSessionPeer peer, int x, int y) Notifies the session that the cursor position has changed.- void- onFieldChange- (HostSessionPeer peer) Notifies the session that fields have changed.- int- onHostDataStreamProcessing- (HostSessionPeer peer, boolean isEntering) Called when the datastream enters or exits processing.- void- onHostDataStreamProcessing- (HostSessionPeer peer, boolean isEntering, int updates) Data stream processing notification method.- voidCalled when a host printer needs printing of a new page.- void- onScreenChange- (HostSessionPeer peer, int beginPos, int endPos) Notifies the session of a screen change.- void- onScreenChanged- (ScreenProp screen, boolean isRemoved) Method to refresh the matching screens when one has been changed.- void- onScreenSizeChange- (HostSessionPeer peer, int cx, int cy) Notifies the session that the screen size has changed.- void- onSessionFailure- (HostSessionPeer peer, Throwable exception) Called when a session has had a failure.- void- onStateChange- (HostSessionPeer peer) Notifies the session of a state change (such as insert mode, lock state, error state).- boolean- printSession- (HostSessionPeer peer) Called when the host (mainframe) has issued a Print Session (Print Local Copy).- boolean- removeListener- (ITerminalStateListener listener) Removes a listener.- void- soundAlarm- (HostSessionPeer peer) Sound alarm on the client.
- Constructor Details- TerminalHostThe constructor.- Parameters:
- terminalProps- The terminal properties.
- appGyro- The application session gyro.
 
 
- Method Details- disposepublic void dispose()Dispose.
- addListenerAdds a new listeners. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeListenerRemoves a listener.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- createHostSessionCreates a HostSession if not already created.- Returns:
- Thew new or existing host session, never null.
- Throws:
- IOException- For failures when creating SSL engine.
 
- getHostSessionGets the host session instance.- Returns:
- The host session, null if none is created.
 
- getMatchingScreensGets the matching screens.- Returns:
- Matching screens array, never null.
 
- onScreenChangedMethod to refresh the matching screens when one has been changed.- Parameters:
- screen- The changed screen or null for all.
- isRemoved- Flag for removed.
 
- onHostDataStreamProcessingCalled when the datastream enters or exits processing. This enables the owner to "group" multiple notification events together.- Specified by:
- onHostDataStreamProcessingin interface- HostSessionOwner
- Parameters:
- peer- The peer.
- isEntering- Flag for entering or exiting.
- Returns:
- Bit flags 0x01 = characters changed, 0x02=fields changed.
 
- onHostPrintPageCalled when a host printer needs printing of a new page.- Specified by:
- onHostPrintPagein interface- HostSessionOwner
- Parameters:
- peer- The peer.
 
- printSessionCalled when the host (mainframe) has issued a Print Session (Print Local Copy).- Specified by:
- printSessionin interface- HostSessionOwner
- Parameters:
- peer- The peer.
- Returns:
- true for success, false for cancel.
 
- getWorkerGets the worker of the session.- Specified by:
- getWorkerin interface- HostSessionOwner
- Returns:
- The worker.
- Throws:
- IOException- For error when getting the worker.
 
- getSessionInfoGets the SessionInfo.- Specified by:
- getSessionInfoin interface- HostSessionOwner
- Returns:
- The session info, never null.
 
- onScreenChangeNotifies the session of a screen change.- Specified by:
- onScreenChangein interface- HostSessionListener
 
- onFieldChangeNotifies the session that fields have changed.- Specified by:
- onFieldChangein interface- HostSessionListener
 
- onScreenSizeChangeNotifies the session that the screen size has changed.- Specified by:
- onScreenSizeChangein interface- HostSessionListener
 
- onCursorPositionChangeNotifies the session that the cursor position has changed.- Specified by:
- onCursorPositionChangein interface- HostSessionListener
 
- onConnectChangeNotifies the session of a connect state change.- Specified by:
- onConnectChangein interface- HostSessionListener
 
- onStateChangeNotifies the session of a state change (such as insert mode, lock state, error state).- Specified by:
- onStateChangein interface- HostSessionListener
 
- onSessionFailureCalled when a session has had a failure.- Specified by:
- onSessionFailurein interface- HostSessionListener
 
- onHostDataStreamProcessingData stream processing notification method.- Specified by:
- onHostDataStreamProcessingin interface- HostSessionListener
- Parameters:
- peer- The peer.
- isEntering- The state of processing (true=before, false=after).
- updates- What has been updated on screen (bit flag: 0x01=characters, 0x02=fields).
 
- soundAlarmSound alarm on the client.- Specified by:
- soundAlarmin interface- HostSessionListener
 
- isConnectEnabledpublic boolean isConnectEnabled()Checks if session is connectable.- Returns:
- true if connectable.
 
- isSuspendEnabledpublic boolean isSuspendEnabled()Checks if session can be suspended.- Returns:
- true if suspendable.
 
- isResumeEnabledpublic boolean isResumeEnabled()Checks if session can be resumed.- Returns:
- true if resumeable.
 
- isDisconnectEnabledpublic boolean isDisconnectEnabled()Checks if session is disconnectable.- Returns:
- true if disconnectable.