public class HostSession3270 extends Object implements HostSessionPeer, TelnetInterface
| Modifier and Type | Field and Description |
|---|---|
protected String |
address
The host IP address to connect to.
|
DataStream3270 |
dataStream
The 3270 data stream instance.
|
Display3270 |
display
The 3270 display instance.
|
protected boolean |
doTN3270E
Flag indicating usage of TN3270E.
|
CodepageConverter |
ebcdicConverter
The codepage mapper.
|
int |
graphicalCodepage
The graphical code page, zero if not set.
|
HostSessionListener2 |
listener
The host session listener.
|
protected String |
peerData
Stored additional PeerData.
|
protected int |
port
The host port (default is 23 for Mainframe) to connect to.
|
TelnetHost |
telnet
The telnet thread, doing the actual conversation.
|
protected Class<?> |
telnetHostClass
The telnet host class.
|
STATE_CommunicationCheck, STATE_CommunicationsError, STATE_Error, STATE_FieldFullError, STATE_InsertMode, STATE_KeyboardShift, STATE_Lock, STATE_LULUOwned, STATE_MachineCheck, STATE_MessageWaiting, STATE_MinusError, STATE_MinusErrorXfStickman, STATE_NonNumericError, STATE_OnFieldOrProtected, STATE_OnlineNotOwned, STATE_ProgramCheck, STATE_ReceiveWait, STATE_Secure, STATE_Sending, STATE_SSCPLUOwned, STATE_SystemAvailable| Modifier and Type | Method and Description |
|---|---|
boolean |
connect()
Connects the session to host.
|
protected void |
createDataStream()
Create the data stream.
|
boolean |
disconnect()
Disconnects the session from host.
|
void |
displayHiddenText(boolean display)
Informs the session that hidden text should be displayed as bright red
on black background.
|
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.
|
boolean |
doNumericFieldOverride()
Checks for 3270 numeric field override.
|
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 client connection data.
|
int |
getClientHostFieldFlags(HostField hostField)
Gets flags that are required for the client host fields for local editing, etc.
|
Point |
getCursor()
Gets the current host cursor position.
|
String |
getDeviceName()
Gets the device name of the session.
|
int |
getHomeAddress()
Gets the host address index on the screen.
|
String |
getHostAddress()
Returns the host destination address for the session.
|
int |
getHostPort()
Returns the Telnet port number.
|
HostSessionListener2 |
getHostSessionListener()
Gets the host session listener.
|
String |
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).
|
int |
getScreenLength()
Gets the current screen length (width * height).
|
Dimension |
getScreenSize()
Gets the current screen size.
|
int |
getSessionID()
Gets the session ID (or index) of this session.
|
long |
getSessionState()
Gets the current session state.
|
void |
hostAcceptedDataStream(String terminalType)
The host accepted the options for the terminal
type and went into BINARY mode.
|
void |
initiate(HostSessionListener listener,
String address,
int port,
String peerData)
Deprecated.
As of version 3.8, use method using HostSessionListener2.
|
void |
initiate2(HostSessionListener2 listener,
String address,
int port,
String peerData)
Initiates an instance of the host session, but does not
connect to the host.
|
void |
initiateLocalCopy()
Initiates a local copy of the current PS to the printer.
|
boolean |
is3270()
Checks if a session is 3270 or 5250.
|
boolean |
isAutoReconnectSessionEnabled()
Checks if the use of auto reconnect session is handled or not.
|
boolean |
isFieldFormatted()
Checks if this host screen is field formatted.
|
boolean |
isHiddenTextDisplayed()
Checks if hidden text is displayed.
|
boolean |
isPrinter()
Checks if this is a printer or not (always false).
|
boolean |
isProcessingDataStream()
Checks if the session is currently processing data stream commands
to update the screen/cursor, state, etc.
|
void |
onSessionFailure(Throwable t)
Called when a session has had a failure.
|
void |
processInboundDataStream(short[] inputBuf,
int pos,
int inputBufLen)
Processes the inbound 3270 data stream.
|
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.
|
void |
sessionDisconnected(Throwable t)
The session has been disconnected due to link failure or if
the remote host disconnected due to e.g.
|
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.
|
void |
setTerminalType(String terminal)
Sets the terminal type, e.g.
|
public HostSessionListener2 listener
public Display3270 display
public TelnetHost telnet
public DataStream3270 dataStream
public CodepageConverter ebcdicConverter
public int graphicalCodepage
protected String address
protected int port
protected String peerData
protected Class<?> telnetHostClass
protected boolean doTN3270E
@Deprecated public void initiate(HostSessionListener listener, String address, int port, String peerData) throws InternalError
initiate in interface HostSessionPeerInternalError - Always with message "Deprecated and unsupported method".initiate2(HostSessionListener2, String, int, String)public void initiate2(HostSessionListener2 listener, String address, int port, String peerData) throws IOException
initiate2 in interface HostSessionPeerIOException - if an I/O error occurs.public boolean is3270()
is3270 in interface HostSessionPeerpublic boolean isProcessingDataStream()
isProcessingDataStream in interface HostSessionPeerpublic int getSessionID()
getSessionID in interface TelnetInterfacepublic ClientConnectionData getClientConnectionData()
getClientConnectionData in interface TelnetInterfacepublic void setTerminalType(String terminal) throws IOException
IOException - if an I/O error occurs.protected void createDataStream()
public boolean connect()
connect in interface HostSessionPeerpublic boolean disconnect()
disconnect in interface HostSessionPeerpublic boolean sendCharacterString(String keys)
sendCharacterString in interface HostSessionPeerpublic boolean sendKey(int key)
sendKey in interface HostSessionPeerHostSendKeyspublic boolean setHostString(int x,
int y,
int offset,
int length,
String string)
setHostString in interface HostSessionPeerpublic boolean setHostStringAsKeys(int x,
int y,
int offset,
int length,
String string)
setHostStringAsKeys in interface HostSessionPeerpublic boolean doesHostNeedFieldExit(int x,
int y,
int offset,
int length,
String string)
doesHostNeedFieldExit in interface HostSessionPeerpublic boolean setCursor(int x,
int y)
setCursor in interface HostSessionPeerpublic String getLastError(boolean doClear)
getLastError in interface HostSessionPeerpublic void setLastError(String errMsg)
setLastError in interface HostSessionPeerpublic Point getCursor()
getCursor in interface HostSessionPeerpublic Dimension getScreenSize()
getScreenSize in interface HostSessionPeerpublic int getScreenLength()
getScreenLength in interface HostSessionPeerpublic void displayHiddenText(boolean display)
displayHiddenText in interface HostSessionPeerpublic boolean isHiddenTextDisplayed()
isHiddenTextDisplayed in interface HostSessionPeerpublic long getSessionState()
getSessionState in interface HostSessionPeerpublic void getCharactersAndAttributes(char[] chars,
int[] attrbs,
int beginPos,
int endPos)
getCharactersAndAttributes in interface HostSessionPeerpublic void getCharactersAndAttributes(char[] chars,
int[] attrbs,
int beginPos,
int endPos,
char fieldOrNullChar)
getCharactersAndAttributes in interface HostSessionPeerpublic void hostAcceptedDataStream(String terminalType) throws IOException
hostAcceptedDataStream in interface TelnetInterfaceIOException - if an I/O error occurs.public void processInboundDataStream(short[] inputBuf,
int pos,
int inputBufLen)
throws IOException
processInboundDataStream in interface TelnetInterfaceIOException - if an I/O error occurs.public void initiateLocalCopy()
public void sessionDisconnected(Throwable t)
sessionDisconnected in interface TelnetInterfacepublic String getHostAddress()
getHostAddress in interface TelnetInterfacepublic int getHostPort()
getHostPort in interface TelnetInterfacepublic void refreshHostFields(HostFields fields)
refreshHostFields in interface HostSessionPeerpublic void onSessionFailure(Throwable t)
public boolean doNumericFieldOverride()
public String getDeviceName()
getDeviceName in interface HostSessionPeerpublic boolean isPrinter()
isPrinter in interface HostSessionPeerpublic boolean setInsertMode(boolean on)
setInsertMode in interface HostSessionPeerpublic boolean doesFieldHaveExtendedAttributes(HostField hostField)
doesFieldHaveExtendedAttributes in interface HostSessionPeerpublic int getNewCharAttribute(HostField hostField)
getNewCharAttribute in interface HostSessionPeerpublic int getClientHostFieldFlags(HostField hostField)
getClientHostFieldFlags in interface HostSessionPeerpublic HostSessionListener2 getHostSessionListener()
getHostSessionListener in interface HostSessionPeerpublic boolean isAutoReconnectSessionEnabled()
isAutoReconnectSessionEnabled in interface HostSessionPeerpublic int getHomeAddress()
getHomeAddress in interface HostSessionPeerpublic boolean setHostField(HostField hostField, String data, int[] attrs)
setHostField in interface HostSessionPeerpublic String getAllowedCharacters()
If the return string is empty, for the EE package for example, all characters are "inputable".
getAllowedCharacters in interface HostSessionPeerpublic boolean isFieldFormatted()
isFieldFormatted in interface HostSessionPeerpublic HostSession3270Printer getAssociated3270Printer()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.