public class HostSessionManager extends Object implements HostSessionListener2, TerminalWindowListener
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SESSION_COUNT
The maximum host session count per client session.
|
APPEND, CONTINUE_PASTE, COPY, CUT, PASTE, REMOVE_MARK, SELECT_ALL, SET_MARK, UNDO| Modifier and Type | Method and Description |
|---|---|
void |
addListener(HostSessionManagerListener listener)
Adds a listener for the session.
|
void |
appendHostColorTransaction(Transaction trans)
This method will append the colors for the current session index
to a transaction so that the client will use that color scheme.
|
static void |
appendHostColorTransactionData(Transaction trans)
This method appends all possible color conversion tables for all
session to a transaction.
|
static boolean |
areAppsAllowed(int hostID,
String[] apps)
Checks if runtime applications are allowed with certain host session.
|
void |
autoResetSession()
Resets the session for auto-reset if
in error.
|
void |
bindHostSessionManagerListener(HostSessionManagerListener listener)
Binds a client session to this host session manager.
|
void |
changeClientLanguage(String language)
Changes the language according to "ClientConnectionData.language".
|
boolean |
checkPrintWindow(KeyEvent e)
Checks for Print Window keystroke.
|
void |
disconnectAll()
Disconnects all started sessions.
|
static boolean |
doSendFieldsForPageKeys()
Flag indicating 5250 modified field should be sent to host when the
page up/down keys are pressed.
|
boolean |
doUserKeyboardAutoReset()
Checks if Auto reset is enabled.
|
boolean |
freeze(boolean on)
Freeze the current session.
|
static String |
getAddress(int index)
Gets the host address string for a session index.
|
Color |
getBackground(Color background,
int x,
int y)
Gets the background color when drawing a character.
|
ClientConnectionData |
getClientConnectionData()
Gets the current client session data.
|
ClientSession |
getClientSession()
Gets the client session.
|
Class<?> |
getCurrentApplicationClass()
Gets the class for the runtime application associated with this
session.
|
HostColors |
getCurrentHostColors()
Gets the host colors for a session.
|
VirtualRuntime |
getCurrentRuntime()
Gets the runtime application associated with this session.
|
HostSession |
getCurrentSession()
Gets the current session.
|
PhantomRuntime |
getDefaultRuntime()
Gets the default runtime.
|
static String |
getDescription(int index)
Gets the descriptive string for a session index.
|
ClientSession |
getFullDuplexClient()
Check if listener is client session and has a full duplex client.
|
static HostColors |
getHostColors(int index)
Gets the host colors for a session.
|
int |
getIndex()
Gets the index of the current host session.
|
ClientSession |
getJavaClient()
Check if listener is client session and has a java client.
|
Object |
getLockObject()
Gets the lock object for thread synchronization.
|
static int |
getPort(int index)
Gets the host address string for a session index.
|
static int |
getReconnectAttempts(int index)
The auto-reconnect attempts count for auto reconnect session.
|
static int |
getReconnectInterval(int index)
Gets the auto-reconnect interval for this session index.
|
HostScreen |
getScreen()
Get the virtual screen for the host session.
|
HostSession |
getSession(int index)
Gets a session from an index.
|
String |
getStateString()
Gets string the state from a value.
|
static String |
getStringType(int index)
Gets the type string for a session index (3270, 5250 or EE).
|
static TerminalSettings |
getTerminalSettings()
Gets the default terminal settings of the server.
|
static String |
getTextID(Hashtable<String,String> t,
String id)
Gets a text ID from a text file.
|
boolean |
hasFullDuplexClient()
Checks if the session has a full duplex Client (Java or JavaScript).
|
boolean |
hasJavaClient()
Checks if the session has a Java Client (used by printer sessions -- a printer
session is not started for non-Java Clients).
|
static void |
initialize(IniFile ini,
Hashtable<String,String> textFile,
boolean isEditor)
This static method initializes the host session data from the server.ini
file.
|
void |
initializeClientTerminalData()
Initializes the data for the current client connection for terminal runtimes.
|
boolean |
initializeSession(int index)
Initializes a session index if not already done.
|
boolean |
isBlockModeEnabled()
Checks if client emulator block mode is enabled.
|
static boolean |
isDefaultBlockModeEnabled()
Checks if client-local field editing mode is enabled.
|
boolean |
isEditor()
Checks if this host session manager belongs to the editor.
|
boolean |
isFrozen()
Checks if the current session is frozen.
|
static boolean |
isHostSessionValid(int id)
Checks if a host session ID is valid ('A' to 'Z' and defined in [host] in server.ini).
|
boolean |
isReconnecting()
Check if the current session is current being reconnected (e.g.
|
boolean |
isUser3270BoxDrawingEnabled()
Checks if 3270 box drawing is enabled.
|
boolean |
isUserPCInsertModeEnabled()
Checks if PC Insert mode is enabled.
|
boolean |
isUserSmartInsertModeEnabled()
Checks if Smart Insert mode is enabled.
|
boolean |
onActivateMenu(boolean isPopup)
Handles display of the pop-up window or activation
of the menu bar.
|
boolean |
onActivateMenu(char ch)
Handles activation of the menu bar and selection
of the mnemonic character.
|
void |
onClipboard(int operation,
Rectangle r)
Performs a clipboard function.
|
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.
|
void |
onHostDataStreamProcessing(HostSessionPeer peer,
boolean isEntering)
Called when entering or exiting data stream
processing.
|
void |
onHostError(HostSessionPeer peer,
String text)
Notifies the session of an error condition.
|
void |
onHostPrintPage(HostSessionPeer peer)
Called when a host printer needs printing of a new page.
|
boolean |
onPopup(MouseEvent e)
Handles display of the pop-up window.
|
void |
onScreenChange(HostSessionPeer peer,
int beginPos,
int endPos)
Notifies the session of a screen change.
|
void |
onScreenSizeChange(HostSessionPeer peer,
int cx,
int cy)
Notifies the session that the screen size has changed.
|
void |
onSessionFailure(HostSessionPeer peer,
String description)
Deprecated.
as of NetPhantom Version 3.8
|
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 |
removeListener(HostSessionManagerListener listener)
Removes a listener for the session.
|
static boolean |
saveHostColors(HostColors hostColors,
int index)
Saves a color scheme for a terminal session index.
|
static boolean |
saveHostColorsToFile()
Saves the color schemes for all terminal sessions.
|
void |
sendCharacter(char ch)
Sends a character string to the terminal.
|
void |
sendHostKey(int key)
Sends a key to the terminal.
|
void |
sendKey(KeyEvent e,
boolean isRightCtrlDown)
Sends a key to the terminal from the terminal window.
|
boolean |
setCurrentSession(int index)
Get the virtual screen for the host session.
|
boolean |
setCurrentSession(int index,
boolean doConnect)
Get the virtual screen for the host session.
|
boolean |
setCursor(int x,
int y)
Sets the cursor position to X/Y.
|
static void |
setDefaultBlockMode(boolean on)
Sets client-local field editing mode enabled or not.
|
void |
soundAlarm(HostSessionPeer peer)
Sound alarm on the client.
|
void |
transferHostSessions(HostSessionManager from)
Moves the host sessions from one manager to this one.
|
public static final int MAX_SESSION_COUNT
public static TerminalSettings getTerminalSettings()
public static void initialize(IniFile ini, Hashtable<String,String> textFile, boolean isEditor) throws IOException
The host section in server.ini should have the following format:
[Host] ; ; Specifies the EBCDIC host codepage. ; Valid host EBCDIC codepages: see Java class CodepageMapper: ; codePageEBCDIC=Cp278 ; ; ; - ID Short session ID (A-Z) ; - Type 3270 or 5250 ; - HostAddress IP address or name ; - HostPort value (optional: default is 23) ; - PeerData User data used by the emulator peer (optional) ; ID=Type HostAddress [ HostPort [ PeerData ] ] ; ; e.g. A=3270 193.12.212.200 23 3 ; e.g. B=5250 entra2.se ;
IOException - if initialization failed.CodepageMapperpublic static String getDescription(int index)
public static String getAddress(int index)
public static int getPort(int index)
public static String getStringType(int index)
public static String getTextID(Hashtable<String,String> t, String id)
public static boolean isHostSessionValid(int id)
public static boolean areAppsAllowed(int hostID,
String[] apps)
public static int getReconnectInterval(int index)
index - the session ID index (zero based).public static int getReconnectAttempts(int index)
index - the session ID index (zero based).public static boolean doSendFieldsForPageKeys()
public boolean initializeSession(int index)
public Object getLockObject()
getLockObject in interface HostSessionListenerpublic ClientConnectionData getClientConnectionData()
getClientConnectionData in interface HostSessionListenerpublic void transferHostSessions(HostSessionManager from)
public void bindHostSessionManagerListener(HostSessionManagerListener listener)
public void addListener(HostSessionManagerListener listener)
public boolean removeListener(HostSessionManagerListener listener)
public HostSession getSession(int index)
public boolean setCurrentSession(int index)
public void initializeClientTerminalData()
public boolean setCurrentSession(int index,
boolean doConnect)
public VirtualRuntime getCurrentRuntime()
public Class<?> getCurrentApplicationClass()
public void disconnectAll()
public HostSession getCurrentSession()
public PhantomRuntime getDefaultRuntime()
public HostScreen getScreen()
public void onScreenChange(HostSessionPeer peer, int beginPos, int endPos)
onScreenChange in interface HostSessionListenerpublic void onFieldChange(HostSessionPeer peer)
onFieldChange in interface HostSessionListenerpublic void onScreenSizeChange(HostSessionPeer peer, int cx, int cy)
onScreenSizeChange in interface HostSessionListenerpublic void onCursorPositionChange(HostSessionPeer peer, int x, int y)
onCursorPositionChange in interface HostSessionListenerpublic void onConnectChange(HostSessionPeer peer, boolean connected)
onConnectChange in interface HostSessionListenerpublic void onHostError(HostSessionPeer peer, String text)
onHostError in interface HostSessionListenerpublic String getStateString()
public final boolean freeze(boolean on)
public final boolean isFrozen()
public final void onStateChange(HostSessionPeer peer)
onStateChange in interface HostSessionListenerpublic final int getIndex()
getIndex in interface HostSessionListenerpublic final boolean isReconnecting()
isReconnecting in interface HostSessionListener2public void soundAlarm(HostSessionPeer peer)
soundAlarm in interface HostSessionListener@Deprecated public void onSessionFailure(HostSessionPeer peer, String description)
onSessionFailure in interface HostSessionListenerpublic void onSessionFailure(HostSessionPeer peer, Throwable exception)
onSessionFailure in interface HostSessionListener2public void onHostPrintPage(HostSessionPeer peer)
onHostPrintPage in interface HostSessionListenerpublic void autoResetSession()
public void sendKey(KeyEvent e, boolean isRightCtrlDown)
sendKey in interface TerminalWindowListenerpublic void sendHostKey(int key)
sendHostKey in interface TerminalWindowListenerkey - The host key to send.public void sendCharacter(char ch)
sendCharacter in interface TerminalWindowListenerpublic boolean setCursor(int x,
int y)
setCursor in interface TerminalWindowListenerpublic void appendHostColorTransaction(Transaction trans)
public static void appendHostColorTransactionData(Transaction trans)
public static HostColors getHostColors(int index)
public HostColors getCurrentHostColors()
public static boolean saveHostColors(HostColors hostColors, int index)
public static boolean saveHostColorsToFile()
public boolean hasFullDuplexClient()
hasFullDuplexClient in interface HostSessionListenerpublic boolean hasJavaClient()
hasJavaClient in interface HostSessionListenerpublic ClientSession getFullDuplexClient()
public ClientSession getJavaClient()
public ClientSession getClientSession()
public static void setDefaultBlockMode(boolean on)
public static boolean isDefaultBlockModeEnabled()
public void onClipboard(int operation,
Rectangle r)
See the se.entra.phantom.common.TerminalWindow class for the clipboard operations.
onClipboard in interface TerminalWindowListenerpublic boolean onPopup(MouseEvent e)
onPopup in interface TerminalWindowListenerpublic boolean checkPrintWindow(KeyEvent e)
checkPrintWindow in interface TerminalWindowListenerpublic boolean onActivateMenu(boolean isPopup)
onActivateMenu in interface TerminalWindowListenerpublic boolean onActivateMenu(char ch)
onActivateMenu in interface TerminalWindowListenerpublic void changeClientLanguage(String language)
public boolean isBlockModeEnabled()
public void onHostDataStreamProcessing(HostSessionPeer peer, boolean isEntering)
onHostDataStreamProcessing in interface HostSessionListenerpublic boolean isUser3270BoxDrawingEnabled()
isUser3270BoxDrawingEnabled in interface HostSessionListenerpublic boolean isUserSmartInsertModeEnabled()
isUserSmartInsertModeEnabled in interface HostSessionListenerpublic boolean isUserPCInsertModeEnabled()
isUserPCInsertModeEnabled in interface HostSessionListenerpublic boolean doUserKeyboardAutoReset()
public Color getBackground(Color background, int x, int y)
getBackground in interface TerminalWindowListenerpublic boolean isEditor()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.