Package org.tn5250j
Class Session5250
- java.lang.Object
-
- org.tn5250j.Session5250
-
- All Implemented Interfaces:
SessionInterface
public class Session5250 extends java.lang.Object implements SessionInterface
A host session
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.PropertiessesProps
-
Constructor Summary
Constructors Constructor Description Session5250(java.util.Properties props, java.lang.String configurationResource, java.lang.String sessionName, SessionConfig config)
-
Method Summary
Modifier and Type Method Description voidaddScanListener(ScanListener listener)voidaddSessionListener(SessionListener listener)Add a SessionListener to the listener list.voidconnect()voiddisconnect()voidfireScanned(java.lang.String command, java.lang.String remainder)This is the callback method for the TNVT when sensing the action cmd screen pattern (!voidfireSessionChanged(int state)Notify all registered listeners of the onSessionChanged event.java.lang.StringgetAllocDeviceName()SessionConfiggetConfiguration()java.lang.StringgetConfigurationResource()java.util.PropertiesgetConnectionProperties()SessionPanelgetGUI()java.lang.StringgetHostName()Screen5250getScreen()SessionManagergetSessionManager()java.lang.StringgetSessionName()intgetSessionType()tnvtgetVT()booleanisConnected()booleanisScanningEnabled()Checks whether scanning is enabled.booleanisSendKeepAlive()booleanisSslConfigured()booleanisSslSocket()booleanisUseSystemName()voidremoveScanListener(ScanListener listener)voidremoveSessionListener(SessionListener listener)Remove a SessionListener from the listener list.voidsetGUI(SessionPanel gui)voidsetScanningEnabled(boolean scan)Enables or disables scanning.protected voidsetVT(tnvt v)java.lang.StringshowSystemRequest()Popups a dialog to ask the user for entering a SysReq value.voidsignalBell()Signals the user a sound (or maybe a light flash).
-
-
-
Constructor Detail
-
Session5250
public Session5250(java.util.Properties props, java.lang.String configurationResource, java.lang.String sessionName, SessionConfig config)
-
-
Method Detail
-
getConfigurationResource
public java.lang.String getConfigurationResource()
- Specified by:
getConfigurationResourcein interfaceSessionInterface
-
getConfiguration
public SessionConfig getConfiguration()
-
getSessionManager
public SessionManager getSessionManager()
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceSessionInterface
-
isSslSocket
public boolean isSslSocket()
- Returns:
- true when SSL is used and socket is connected.
-
isSslConfigured
public boolean isSslConfigured()
- Returns:
- true when SSL is configured but not necessary in use
-
isSendKeepAlive
public boolean isSendKeepAlive()
-
isUseSystemName
public boolean isUseSystemName()
- Returns:
- true if configured, that the host name should be
-
getConnectionProperties
public java.util.Properties getConnectionProperties()
-
setGUI
public void setGUI(SessionPanel gui)
-
getGUI
public SessionPanel getGUI()
-
getSessionName
public java.lang.String getSessionName()
- Specified by:
getSessionNamein interfaceSessionInterface
-
getAllocDeviceName
public java.lang.String getAllocDeviceName()
-
getSessionType
public int getSessionType()
- Specified by:
getSessionTypein interfaceSessionInterface
-
getHostName
public java.lang.String getHostName()
-
getScreen
public Screen5250 getScreen()
-
signalBell
public void signalBell()
Description copied from interface:SessionInterfaceSignals the user a sound (or maybe a light flash).- Specified by:
signalBellin interfaceSessionInterface
-
showSystemRequest
public java.lang.String showSystemRequest()
Description copied from interface:SessionInterfacePopups a dialog to ask the user for entering a SysReq value.- Specified by:
showSystemRequestin interfaceSessionInterface- Returns:
- null if nothing to do, else a String containing the users input.
-
connect
public void connect()
- Specified by:
connectin interfaceSessionInterface
-
disconnect
public void disconnect()
- Specified by:
disconnectin interfaceSessionInterface
-
setVT
protected void setVT(tnvt v)
-
getVT
public tnvt getVT()
-
setScanningEnabled
public void setScanningEnabled(boolean scan)
Enables or disables scanning.- Parameters:
scan- enables scanning when true; disables otherwise.
-
isScanningEnabled
public boolean isScanningEnabled()
Checks whether scanning is enabled.- Returns:
- true if command scanning is enabled; false otherwise.
-
fireScanned
public final void fireScanned(java.lang.String command, java.lang.String remainder)This is the callback method for the TNVT when sensing the action cmd screen pattern (!# at position 0,0). This is a thread safe method and will be called from the TNVT read thread!- Parameters:
command- discovered in the 5250 stream.remainder- are all the other characters on the screen.
-
addScanListener
public final void addScanListener(ScanListener listener)
- Parameters:
listener- a listener to add
-
removeScanListener
public final void removeScanListener(ScanListener listener)
- Parameters:
listener- a scan listener
-
fireSessionChanged
public final void fireSessionChanged(int state)
Notify all registered listeners of the onSessionChanged event.- Parameters:
state- The state change property object.
-
addSessionListener
public final void addSessionListener(SessionListener listener)
Add a SessionListener to the listener list.- Specified by:
addSessionListenerin interfaceSessionInterface- Parameters:
listener- The SessionListener to be added
-
removeSessionListener
public final void removeSessionListener(SessionListener listener)
Remove a SessionListener from the listener list.- Specified by:
removeSessionListenerin interfaceSessionInterface- Parameters:
listener- The SessionListener to be removed
-
-