Interface HostSessionPeer

All Known Implementing Classes:
EmptyHostSession, HostSession3270, HostSession5250, HostSessionEE

public interface HostSessionPeer
The interface for 3270 or 5250 host sessions.

It is also a collection of host session states.

Author:
Christopher Mindus
  • Field Details Link icon

  • Method Details Link icon

    • connect Link icon

      boolean connect()
      Connects the session to host.
    • disconnect Link icon

      boolean disconnect()
      Disconnects the session from host.
    • getScreenSize Link icon

      Size getScreenSize()
      Gets the current screen size.
    • getScreenLength Link icon

      int getScreenLength()
      Gets the current screen length (width * height).
    • sendCharacterString Link icon

      boolean sendCharacterString(String keys)
      Sends character keystrokes to host.
    • sendKey Link icon

      boolean sendKey(int key)
      Sends keystrokes to host.
      See Also:
    • setHostString Link icon

      boolean setHostString(int x, int y, int offset, int length, String string)
      Sets a string to a host field.
    • setHostStringAsKeys Link icon

      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. The host field is first cleared with (3270) Clear EOF or (5250) Field Exit or Field Minus (for negative numbers in a numeric field). The string is then entered as a set of keystrokes, followed by a potential Field Exit or Field Minus (for negative numbers in a numeric field), but only for 5250.
    • doesHostNeedFieldExit Link icon

      boolean doesHostNeedFieldExit(int x, int y, int offset, int length, String string)
      For 5250: 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.
      Returns:
      false=field doesn't require field exit, true=field requires field exit.
    • setCursor Link icon

      boolean setCursor(int x, int y)
      Sets the host cursor position.
    • getCursor Link icon

      Position getCursor()
      Gets the current host cursor position.
    • getCharactersAndAttributes Link icon

      void getCharactersAndAttributes(char[] chars, int[] attrbs, int beginPos, int endPos)
      Gets the characters and attributes between two positions, including the end position.
    • getCharactersAndAttributes Link icon

      void getCharactersAndAttributes(char[] chars, int[] attrbs, int beginPos, int endPos, char fieldOrNullChar)
      Gets the characters and attributes between two positions, including the end position. The character "fieldOrNullChar" is the character that will be used instead of field attributes and null characters.
    • getSessionState Link icon

      int getSessionState()
      Gets the current session state.
      Returns:
      A combination of HostSessionPeer.STATE_* flags is returned.
    • getComm Link icon

      SocketCommNIO getComm()
      Gets the communication engine.
      Returns:
      The NIO instance.
    • refreshHostFields Link icon

      void refreshHostFields(HostFields fields)
      Refreshes the host fields of the current session. The host session will add all available host fields sorted left to right, top to bottom.
    • is3270 Link icon

      boolean is3270()
      Checks if a session is 3270 or 5250.
      Returns:
      false if 5250,
      true if 3270.
    • isPrinter Link icon

      boolean isPrinter()
      Checks if this is a printer or not.
    • getLastError Link icon

      String getLastError(boolean doClear)
      Gets the last error message of the session.
      Returns:
      null if the session doesn't support it (3270 doesn't).
    • setLastError Link icon

      void setLastError(String errMsg)
      Sets the last error message of the session.
    • getDeviceName Link icon

      String getDeviceName()
      Gets the device name of the session.
      Returns:
      null if no device name exists.
    • isProcessingDataStream Link icon

      boolean isProcessingDataStream()
      Checks if the session is currently processing data stream commands to update the screen/cursor, state, etc.
    • setInsertMode Link icon

      boolean setInsertMode(boolean on)
      Sets the insert mode.
      Returns:
      true for success, false for failure.
    • doesFieldHaveExtendedAttributes Link icon

      boolean doesFieldHaveExtendedAttributes(HostField hostField)
      Checks if a host field has extended attributes or not. 5250 never has, but 3270 could have, e.g. special highlighting.
    • getNewCharAttribute Link icon

      int getNewCharAttribute(HostField hostField)
      Gets the attribute to use for new characters in a field that contains extended attributes (always zero for non-3270).
    • getClientHostFieldFlags Link icon

      int getClientHostFieldFlags(HostField hostField)
      Gets flags that are required for the client host fields for local editing, etc.
    • isAutoReconnectSessionEnabled Link icon

      boolean isAutoReconnectSessionEnabled()
      Checks if the use of auto reconnect session is handled or not.
    • getHomeAddress Link icon

      int getHomeAddress()
      Gets the host address index on the screen.
    • setHostField Link icon

      boolean setHostField(HostField hostField, String data, int[] attrs)
      Sets a host field fully with text data and perhaps attributes (if these are non-null).
      Returns:
      true for success, false for failure.
    • getAllowedCharacters Link icon

      String getAllowedCharacters()
      Gets the string of characters that can be input by the user using the configured host code page for this session.

      If the return string is empty, for the EE package for example, all characters are "inputable".

    • isFieldFormatted Link icon

      boolean isFieldFormatted()
      Checks if this host screen is field formatted. This method is not like the one in HostScreen, this one checks directly to see if any fields are present.
    • isDisplayInSystemRequestMode Link icon

      boolean isDisplayInSystemRequestMode()
      Checks if the display (5250 only) is in System Request mode.
    • getHostSession Link icon

      HostSession getHostSession()
      Gets the HostSession, i.e. the owner of the peer.