public class HostSession extends Object implements HostSessionListener2
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_AUTO_RECONNECT_ATTEMPTS
The default attempts count for auto reconnect session (default = 20).
|
static int |
DEFAULT_AUTO_RECONNECT_INTERVAL
The default interval used for auto reconnect session (in seconds, default = 3).
|
static int |
DEFAULT_KEEP_ALIVE_INTERVAL
The default interval used for Keep Alive (in seconds, default = 30).
|
static int |
DEFAULT_RECONNECT_TIMEOUT
The default timeout value for reconnecting a session in seconds (default = 30).
|
Modifier and Type | Method and Description |
---|---|
void |
clearTypeAhead()
Clears the type-ahead buffer.
|
boolean |
connect()
Connects the session.
|
boolean |
disconnect()
Disconnects the session.
|
void |
displayHiddenText(boolean display)
Informs the session that hidden text should be displayed as bright red
on black background.
|
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.
|
String |
getAllowedCharacters()
Gets the string of characters that can be input by the user using
the configured host code page for this session.
|
HostSession3270Printer |
getAssociated3270Printer()
Gets 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.
|
ClientConnectionData |
getClientConnectionData()
Gets the current client session data.
|
ClientSession |
getClientSession()
Gets the client session.
|
Point |
getCursor()
Gets the current host cursor position.
|
String |
getDeviceName()
Gets the device name of the session.
|
int |
getHostScreenLength()
Gets the current screen length (width * height).
|
Dimension |
getHostScreenSize()
Gets the host screen size.
|
int |
getIndex()
Gets the session index.
|
ClientSession |
getJavaClient()
Check if listener is client session and has a java client.
|
String |
getLastError(boolean doClear)
Gets the last error message of the session.
|
String |
getLastFailure()
Gets the last error state (failure, null for none).
|
Object |
getLockObject()
Gets the lock object for thread synchronization.
|
boolean |
getLogonState()
Get the logon state for the session.
|
HostSessionPeer |
getPeer()
Gets the peer.
|
HostScreen |
getScreen()
Gets the current host screen instance.
|
String |
getSessionID()
Gets the String representation of this session "A" to "Z".
|
long |
getSessionState()
Gets the host session state.
|
String |
getStringType()
Gets the type of session as a string (3270, 5250, EE, EE-3270 or EE-5250).
|
int |
getType()
Gets the type of session (0=3270, 1=5250, 2=EE).
|
boolean |
hasError()
Checks if there is an error state.
|
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).
|
boolean |
inInsertMode()
Checks if the keyboard is in insert mode or not.
|
boolean |
is3270()
Checks the session type against 3270.
|
boolean |
isConnected()
Checks for session currently connected.
|
boolean |
isConnecting()
Flag for session is processing a connect request.
|
boolean |
isCurrent()
Checks if this session is the current one.
|
boolean |
isFieldFormatted()
Checks if this host screen is field formatted.
|
boolean |
isHiddenTextDisplayed()
Checks if hidden text is displayed.
|
boolean |
isKeyboardInputAllowed()
Checks if the host session is locked for keyboard input.
|
boolean |
isLocked()
Checks if the host session is locked.
|
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.
|
boolean |
isReconnecting()
Check if the session is current being reconnected (e.g.
|
boolean |
isTypeAheadEnabled()
Checks if type-ahead is enabled for this
session.
|
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.
|
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.
|
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 |
printSession()
Print terminal session.
|
void |
refreshHostFields(HostFields fields)
Refreshes the host fields of the current session.
|
void |
replaceManager(HostSessionManager manager)
Replaces the host session manager for this session.
|
boolean |
sendCharacterString(String keys)
Sends character keystrokes to host.
|
boolean |
sendCharacterString(String keys,
boolean allowTypeAhead)
Sends character keystrokes to host without allowing type-ahead.
|
boolean |
sendKey(int key)
Sends keystrokes to host without allowing type-ahead.
|
boolean |
sendKey(int key,
boolean allowTypeAhead)
Sends keystrokes to host.
|
boolean |
sendString(String keys)
Sends character keystrokes to host.
|
boolean |
sendString(String keys,
boolean allowTypeAhead)
Sends character keystrokes to host.
|
void |
setAsCurrent(boolean current)
Sets or removes this session as the current one.
|
boolean |
setCursor(int x,
int y)
Sets the host cursor position.
|
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.
|
void |
setLogonState(boolean state)
Set the logon state for the session.
|
void |
soundAlarm(HostSessionPeer peer)
Sound alarm on the client.
|
public static final int DEFAULT_KEEP_ALIVE_INTERVAL
public static final int DEFAULT_AUTO_RECONNECT_INTERVAL
public static final int DEFAULT_AUTO_RECONNECT_ATTEMPTS
public static final int DEFAULT_RECONNECT_TIMEOUT
public int getType()
public String getStringType()
public boolean is3270()
public boolean isConnected()
public boolean isConnecting()
public boolean isReconnecting()
isReconnecting
in interface HostSessionListener2
public boolean isCurrent()
public boolean connect()
public boolean disconnect()
public String getLastFailure()
public boolean sendString(String keys)
public boolean sendString(String keys, boolean allowTypeAhead)
public boolean sendCharacterString(String keys)
public boolean sendCharacterString(String keys, boolean allowTypeAhead)
public boolean isTypeAheadEnabled()
public boolean sendKey(int key)
HostSendKeys
public boolean sendKey(int key, boolean allowTypeAhead)
HostSendKeys
public boolean printSession()
public boolean doesHostNeedFieldExit(int x, int y, int offset, int length, String string)
public boolean setHostString(int x, int y, int offset, int length, String string)
public boolean setHostStringAsKeys(int x, int y, int offset, int length, String string)
public boolean setCursor(int x, int y)
public Point getCursor()
public void displayHiddenText(boolean display)
public boolean isHiddenTextDisplayed()
public void getCharactersAndAttributes(char[] chars, int[] attrbs, int beginPos, int endPos)
public void getCharactersAndAttributes(char[] chars, int[] attrbs, int beginPos, int endPos, char fieldOrNullChar)
public void setAsCurrent(boolean current)
public void onScreenChange(HostSessionPeer peer, int beginPos, int endPos)
onScreenChange
in interface HostSessionListener
public void onFieldChange(HostSessionPeer peer)
onFieldChange
in interface HostSessionListener
public void onScreenSizeChange(HostSessionPeer peer, int cx, int cy)
onScreenSizeChange
in interface HostSessionListener
public void onCursorPositionChange(HostSessionPeer peer, int x, int y)
onCursorPositionChange
in interface HostSessionListener
public void onConnectChange(HostSessionPeer peer, boolean connected)
onConnectChange
in interface HostSessionListener
public void onHostError(HostSessionPeer peer, String text)
onHostError
in interface HostSessionListener
public void onStateChange(HostSessionPeer peer)
onStateChange
in interface HostSessionListener
public HostScreen getScreen()
public Dimension getHostScreenSize()
public int getHostScreenLength()
public long getSessionState()
public boolean isLocked()
public boolean isKeyboardInputAllowed()
public boolean hasError()
public boolean inInsertMode()
public void refreshHostFields(HostFields fields)
public ClientConnectionData getClientConnectionData()
getClientConnectionData
in interface HostSessionListener
public int getIndex()
getIndex
in interface HostSessionListener
public String getSessionID()
public boolean getLogonState()
public void setLogonState(boolean state)
public void soundAlarm(HostSessionPeer peer)
soundAlarm
in interface HostSessionListener
@Deprecated public void onSessionFailure(HostSessionPeer peer, String description)
onSessionFailure
in interface HostSessionListener
public void onSessionFailure(HostSessionPeer peer, Throwable exception)
onSessionFailure
in interface HostSessionListener2
public String getLastError(boolean doClear)
public void setLastError(String errMsg)
public Object getLockObject()
getLockObject
in interface HostSessionListener
public String getDeviceName()
public boolean isPrinter()
public void onHostPrintPage(HostSessionPeer peer)
onHostPrintPage
in interface HostSessionListener
public HostSessionPeer getPeer()
Note that manipulation of the peer directly needs synchronization of that object.
public boolean hasFullDuplexClient()
hasFullDuplexClient
in interface HostSessionListener
public boolean hasJavaClient()
hasJavaClient
in interface HostSessionListener
public ClientSession getJavaClient()
public ClientSession getClientSession()
public void clearTypeAhead()
public boolean setInsertMode(boolean on)
public void replaceManager(HostSessionManager manager)
public boolean isProcessingDataStream()
public void onHostDataStreamProcessing(HostSessionPeer peer, boolean isEntering)
onHostDataStreamProcessing
in interface HostSessionListener
public boolean isUser3270BoxDrawingEnabled()
isUser3270BoxDrawingEnabled
in interface HostSessionListener
public boolean isUserSmartInsertModeEnabled()
isUserSmartInsertModeEnabled
in interface HostSessionListener
public boolean isUserPCInsertModeEnabled()
isUserPCInsertModeEnabled
in interface HostSessionListener
public String getAllowedCharacters()
If the return string is empty, for the EE package for example, all characters are "inputable".
public boolean isFieldFormatted()
public HostSession3270Printer getAssociated3270Printer()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.