Package dev.galasa.textscan
Interface ITextScannable
public interface ITextScannable
This interface provides a access to a text resource that can be repeatedly updated and scanned for text.
Examples with be a running batch job, docker container log or a linux server log.
It is the intention that other Managers will provide IScannable objects for use within the Text Scan Manager
-
Method Summary
Modifier and TypeMethodDescriptionFetch the InputStream for the scannableA name so the this scannable can be identified in exceptions or warning messagesFetch the latest scannable textboolean
Is the scannable object fetched by inputstream, used when the text file can be so large that it may exceed the JVM heap.boolean
Used for normal logs that fit easily in a standard StringUpdate/Refresh the scannable text, likely to be a no-op if this is an inputstream scannable.
-
Method Details
-
isScannableInputStream
boolean isScannableInputStream()Is the scannable object fetched by inputstream, used when the text file can be so large that it may exceed the JVM heap.- Returns:
- true if is an inputstream
-
isScannableString
boolean isScannableString()Used for normal logs that fit easily in a standard String- Returns:
- true if it is a simple String object
-
getScannableName
String getScannableName()A name so the this scannable can be identified in exceptions or warning messages- Returns:
- a string to uniquely identify the scannable
-
updateScannable
Update/Refresh the scannable text, likely to be a no-op if this is an inputstream scannable.- Returns:
- this scannable for fluent use
- Throws:
TextScanException
- If the update fails
-
getScannableInputStream
Fetch the InputStream for the scannable- Returns:
- The latest inputstream
- Throws:
TextScanException
- If there is an error fetching the inputstream or it is not an inputstream
-
getScannableString
Fetch the latest scannable text- Returns:
- The latest scannable text
- Throws:
TextScanException
- if there is an error retrieving the text
-