Package dev.galasa.zos3270
Interface ITerminal
- All Known Subinterfaces:
ICicsTerminal
- All Known Implementing Classes:
CicsTerminalImpl
,Terminal
,Zos3270TerminalImpl
public interface ITerminal
-
Method Summary
Modifier and TypeMethodDescriptionbackTab()
clear()
void
connect()
cursorUp()
void
enter()
eraseEof()
getId()
home()
boolean
boolean
boolean
boolean
isTextInField
(String string) boolean
isTextInField
(String string, long timeoutInMilliseconds) newLine()
pa1()
pa2()
pa3()
pf1()
pf10()
pf11()
pf12()
pf13()
pf14()
pf15()
pf16()
pf17()
pf18()
pf19()
pf2()
pf20()
pf21()
pf22()
pf23()
pf24()
pf3()
pf4()
pf5()
pf6()
pf7()
pf8()
pf9()
positionCursorToFieldContaining
(@NotNull String searchText) void
reportExtendedScreen
(boolean printCursor, boolean printColour, boolean printHighlight, boolean printIntensity, boolean printProtected, boolean printNumeric, boolean printModified) Report to the log the current state of the terminal with optional extended datastream settingsTemporary Print to consoleReturn the colour of the character at the cursor positionretrieveColourAtPosition
(int row, int col) Return the colour of the character at the cursor positionRetrieve the contents of the field under the current cursor position.Retrieve the contents of the field which is immediately after a field containing the string provided.Return the highlighting of the character at the cursor positionretrieveHighlightAtPosition
(int row, int col) Return the highlighting of the character at the cursor positionretrieveText
(int row, int col, int length) Retrieve text from the screen.retrieveTextAtCursor
(int length) Retrieve text from the screen.boolean
searchText
(String text) Perform a search on a String to check whether or not it is on the terminal screen.boolean
searchText
(String text, int occurrences) Perform a search on a String to check whether or not it is on the terminal screen.boolean
searchText
(String text, int occurrences, long milliTimeout) Perform a search on a String to check whether or not it is on the terminal screen.boolean
searchText
(String text, long milliTimeout) Perform a search on a String to check whether or not it is on the terminal screen.void
setCursorPosition
(int row, int col) Set the position of the Cursorvoid
setDoStartTls
(boolean doStartTls) tab()
void
verifyTextInField
(String string) waitForTextInField
(String string) int
waitForTextInField
(String[] ok, String[] error) int
waitForTextInField
(String[] ok, String[] error, long timeoutInMilliseconds) wfk()
-
Method Details
-
isConnected
boolean isConnected() -
connect
- Throws:
NetworkException
-
disconnect
- Throws:
TerminalInterruptedException
-
isSwitchedSSL
boolean isSwitchedSSL() -
setDoStartTls
void setDoStartTls(boolean doStartTls) -
waitForKeyboard
ITerminal waitForKeyboard() throws TimeoutException, KeyboardLockedException, TerminalInterruptedException -
wfk
-
positionCursorToFieldContaining
ITerminal positionCursorToFieldContaining(@NotNull @NotNull String searchText) throws TextNotFoundException, KeyboardLockedException -
isClearScreen
boolean isClearScreen() -
searchText
Perform a search on a String to check whether or not it is on the terminal screen. If after a timeout the String is not found on the terminal with at least the amount of occurrences input the method will return false to the caller.- Parameters:
text
-occurrences
-milliTimeout
-- Returns:
- if the text was found
-
searchText
Perform a search on a String to check whether or not it is on the terminal screen. If after a timeout the String is not found on the terminal, the method will return false to the caller.- Parameters:
text
-milliTimeout
-- Returns:
- if the text was found
-
searchText
Perform a search on a String to check whether or not it is on the terminal screen. If after a timeout the String is not found on the terminal, the method will return false to the caller. The returned boolean will depend on if the amount of occurrences is found.- Parameters:
text
-occurrences
-- Returns:
- if the text was found
-
searchText
Perform a search on a String to check whether or not it is on the terminal screen. If after a timeout the String is not found on the terminal, the method will return false to the caller.- Parameters:
text
-- Returns:
- if the text was found
-
waitForTextInField
ITerminal waitForTextInField(String string) throws TerminalInterruptedException, TextNotFoundException, ErrorTextFoundException, Zos3270Exception - Parameters:
string
-- Returns:
- Throws:
TerminalInterruptedException
TextNotFoundException
ErrorTextFoundException
Zos3270Exception
-
waitForTextInField
int waitForTextInField(String[] ok, String[] error) throws TerminalInterruptedException, TextNotFoundException, ErrorTextFoundException, Zos3270Exception - Parameters:
ok
- - An array of text strings to find on the screenerror
- - An array of text strings deemed to be errors- Returns:
- the index of the ok string that was found
- Throws:
TerminalInterruptedException
- - If the wait was interrupted for some reasonTextNotFoundException
- - None of the ok or error strings were found before the timeoutErrorTextFoundException
- - One of the error strings were found, index of which is in the exceptionZos3270Exception
- - general zos 3270 error
-
waitForTextInField
int waitForTextInField(String[] ok, String[] error, long timeoutInMilliseconds) throws TerminalInterruptedException, TextNotFoundException, ErrorTextFoundException, Zos3270Exception - Parameters:
ok
- - An array of text strings to find on the screenerror
- - An array of text strings deemed to be errorstimeoutInMilliseconds
- - timeout- Returns:
- the index of the ok string that was found
- Throws:
TerminalInterruptedException
- - If the wait was interrupted for some reasonTextNotFoundException
- - None of the ok or error strings were found before the timeoutErrorTextFoundException
- - One of the error strings were foundZos3270Exception
- - general zos 3270 error
-
verifyTextInField
- Throws:
TextNotFoundException
-
isTextInField
-
isTextInField
boolean isTextInField(String string, long timeoutInMilliseconds) throws TerminalInterruptedException - Throws:
TerminalInterruptedException
-
type
-
eraseEof
-
eraseInput
-
tab
-
backTab
-
cursorUp
-
cursorDown
-
cursorLeft
-
cursorRight
-
backSpace
-
home
-
newLine
-
enter
-
clear
-
pf1
-
pf2
-
pf3
-
pf4
-
pf5
-
pf6
-
pf7
-
pf8
-
pf9
-
pf10
-
pf11
-
pf12
-
pf13
-
pf14
-
pf15
-
pf16
-
pf17
-
pf18
-
pf19
-
pf20
-
pf21
-
pf22
-
pf23
-
pf24
-
pa1
-
pa2
-
pa3
-
reportScreen
ITerminal reportScreen()Temporary Print to console- Returns:
- ITerminal for chaining
-
reportScreenWithCursor
ITerminal reportScreenWithCursor() -
reportExtendedScreen
ITerminal reportExtendedScreen(boolean printCursor, boolean printColour, boolean printHighlight, boolean printIntensity, boolean printProtected, boolean printNumeric, boolean printModified) throws Zos3270Exception Report to the log the current state of the terminal with optional extended datastream settings- Parameters:
printCursor
- - report cursor positionprintColour
- - report the colourprintHighlight
- - report highlightingprintIntensity
- - report intensityprintProtected
- - report field protectionprintNumeric
- - report numeric restrictionsprintModified
- - report field modification- Returns:
- the ITerminal for fluent API
- Throws:
Zos3270Exception
-
retrieveScreen
String retrieveScreen() -
retrieveFieldAtCursor
String retrieveFieldAtCursor()Retrieve the contents of the field under the current cursor position. If the field contains nulls, the string returned will be compressed as it would be when sent back to the server.- Returns:
- The contents of the screen in the field
-
retrieveFieldTextAfterFieldWithString
Retrieve the contents of the field which is immediately after a field containing the string provided. Used to obtain the contents of a labelled field. If the field contains nulls, the string returned will be compressed as it would be when sent back to the server.- Returns:
- The contents of the screen in the field
- Throws:
TextNotFoundException
-
getId
String getId() -
registerDatastreamListener
-
unregisterDatastreamListener
-
setCursorPosition
Set the position of the Cursor- Parameters:
row
- - The row on the screen to set the cursorcol
- - the column on the screen to set the cursor- Throws:
KeyboardLockedException
- - If an attempt is made to move the cursor whilst the screen is lockedZos3270Exception
- - If the position exceeds the boundaries of the screen
-
retrieveText
Retrieve text from the screen. Null characters and field attribute positions are replaced with spaces. If there are not enough characters on the row to satisfy the length requirement, the retrieve will wrap to the next row, unless it is the last row, in which case an exception will be thrown.- Parameters:
row
- - The row on the screen to start the extractcol
- - The column on the screen to start the extractlength
- - The number of characters to extract- Returns:
- The contents extracted
- Throws:
Zos3270Exception
- - If the position exceeds the boundaries of the screen or the length causes the extract to overflow the end of the screen buffer
-
retrieveTextAtCursor
Retrieve text from the screen. Null characters and field attribute positions are replaced with spaces. If there are not enough characters on the row to satisfy the length requirement, the retrieve will wrap to the next row, unless it is the last row, in which case an exception will be thrown.- Parameters:
length
- - The number of characters to extract- Returns:
- The contents extracted
- Throws:
Zos3270Exception
- - If the length causes the extract to overflow the end of the screen buffer
-
retrieveColourAtCursor
Colour retrieveColourAtCursor()Return the colour of the character at the cursor position- Returns:
- - if position is not in an extended field, null us returned
-
retrieveColourAtPosition
Return the colour of the character at the cursor position- Parameters:
row
- of the screen, index 1 basedcol
- of the screen, index 1 based- Returns:
- - if position is not in an extended field, null us returned
- Throws:
Zos3270Exception
-
retrieveHighlightAtCursor
Highlight retrieveHighlightAtCursor()Return the highlighting of the character at the cursor position- Returns:
- - if position is not in an extended field, null us returned
-
retrieveHighlightAtPosition
Return the highlighting of the character at the cursor position- Parameters:
row
- of the screen, index 1 basedcol
- of the screen, index 1 based- Returns:
- - if position is not in an extended field, null us returned
- Throws:
Zos3270Exception
-