Package org.pgcodekeeper.core.reporter
Interface IProgressReporter
- All Superinterfaces:
AutoCloseable
Interface for reporting progress, warnings, errors, and query results during database operations.
Implementations of this interface are used to provide feedback during potentially long-running
database operations. The interface extends AutoCloseable to ensure proper resource cleanup.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Closes the progress reporter by callingterminate().voidreportErrorLocation(int start, int length) Reports the location of an error within a SQL statement.voidDisplays query results in the progress report.voidTerminates the progress reporting session.voidWrites the current database name being processed to the progress report.voidwriteError(String message) Writes an error message to the progress report.voidwriteMessage(String message) Writes an informational message to the progress report.voidwriteWarning(String message) Writes a warning message to the progress report.
-
Method Details
-
writeDbName
void writeDbName()Writes the current database name being processed to the progress report. -
writeMessage
Writes an informational message to the progress report.- Parameters:
message- the informational message to display
-
writeWarning
Writes a warning message to the progress report.- Parameters:
message- the warning message to display
-
writeError
Writes an error message to the progress report.- Parameters:
message- the error message to display
-
terminate
void terminate()Terminates the progress reporting session. -
showData
Displays query results in the progress report.- Parameters:
query- the SQL query that was executedobject- the result set data to display (as rows of objects)
-
reportErrorLocation
void reportErrorLocation(int start, int length) Reports the location of an error within a SQL statement.- Parameters:
start- the starting position of the error in the SQL textlength- the length of the erroneous section
-
close
default void close()Closes the progress reporter by callingterminate().This default implementation ensures the reporter is properly terminated when used in try-with-resources blocks.
- Specified by:
closein interfaceAutoCloseable
-