Interface Session

All Superinterfaces:
BareSession, Defined

public interface Session extends BareSession, Defined
A Session expands on the more basic BareSession, adding named screens and named user-defined fields and 'controls'.
Version:
$Id$
  • Method Details

    • getScreen

      Screen getScreen()
      Returns the currently visible screen.
      Specified by:
      getScreen in interface BareSession
      Returns:
      the currently visible screen.
    • getScreenName

      String getScreenName()
      Returns the name of the currently visible screen.
      Returns:
      the name of the currently visible screen.
    • sendKey

      void sendKey(String fieldName, String key) throws NoSuchFieldException
      Position the cursor to the given user-defined field, then send a key to the host. The list of possible keys is in Keys, specifically Keys.Ibm5250, Keys.Ibm3270, and Keys.AnsiVT.
      Parameters:
      fieldName - the field to position the cursor in before sending the key.
      key - the key to send to the host. See Keys.
      Throws:
      NoSuchFieldException - if the field does not exist.
    • sendKey

      void sendKey(String fieldName, int index, String key) throws NoSuchFieldException
      Position the cursor to the given user-defined field, then send a key to the host. The list of possible keys is in Keys, specifically Keys.Ibm5250, Keys.Ibm3270, and Keys.AnsiVT. For multi-part fields, e.g. continued or column, position to the index'th part (zero-based indexing).
      Parameters:
      fieldName - the field to position the cursor in before sending the key.
      index - the index'th part of the field, zero-based.
      key - the key to send to the host. See Keys.
      Throws:
      NoSuchFieldException - if the field does not exist.
    • getField

      Field getField(String fieldName) throws NoSuchFieldException
      Returns the user-defined field with the given name from the current screen. Note that this does not return the contents of a field, but rather the field itself. To get the contents of a field, @see getText.
      Parameters:
      fieldName - The name of the field.
      Returns:
      the user-defined field with the given name.
      Throws:
      NoSuchFieldException - if the field does not exist.
    • getFields

      List<Field> getFields()
      Returns a list of all the user-defined fields on the current screen.
      Returns:
      a list of all the user-defined fields on the current screen.
    • getText

      String getText(String fieldName) throws NoSuchFieldException
      Returns the text content of the given field. This is a convenience method for session.getField(fieldName).getText();
      Parameters:
      fieldName - The name of the field.
      Returns:
      the text content of the field.
      Throws:
      NoSuchFieldException - if the field does not exist.
    • setText

      void setText(String fieldName, String fieldValue) throws FieldValidationException, NoSuchFieldException
      Set the text content of the given named field. This is a convenience for session.getField(fieldName).setText(fieldValue);
      Parameters:
      fieldName - The name of the field.
      fieldValue - The text content to place into the field. If null or empty, the field is cleared.
      Throws:
      NoSuchFieldException - if the field does not exist.
      FieldValidationException - if the text is not valid for this field.
    • getCursor

      Cursor getCursor()
      Returns the cursor for the current screen. Same as getScreen().getCursor().
      Specified by:
      getCursor in interface BareSession
      Returns:
      the current cursor.
    • getTable

      Table getTable(String tableName) throws NoSuchFieldException
      Returns the user-defined table with the given name from the current screen.
      Parameters:
      tableName - The name of the table.
      Returns:
      the user-defined table with the given name.
      Throws:
      NoSuchFieldException - if the table does not exist.