Interface ImportNotificationMonitor
public interface ImportNotificationMonitor
This callback interface can be passed to a
DataStoreConnection
to receive errors and warnings during import.
Importation can take place on multiple worker threads simultaneously, so implementations should be prepared to handle
asynchronous invocations. Moreover, it is possible that multiple sources will be imported simultaneously, so each
source is distinguished by an integer job ID.-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ImportNotificationMonitor.NotificationAction
Determines how to proceed after a notification.static class
ImportNotificationMonitor.NotificationType
Determines the type of a notification. -
Field Summary
Fields Modifier and Type Field Description static ImportNotificationMonitor
s_firstErrorExceptionMonitor
Provides a default implementation of an import monitor that throws an exception upon first error notification.static ImportNotificationMonitor
s_nullMonitor
Provides a default implementation of an import monitor that ignores all notifications. -
Method Summary
Modifier and Type Method Description void
importJobFinished(int jobID)
Called when the importation of a data source finishes.void
importJobStarted(int jobID, java.lang.String inputSourceName)
Called when the importation of a data source starts.ImportNotificationMonitor.NotificationAction
importNotification(int jobID, ImportNotificationMonitor.NotificationType notificationType, long line, long column, java.lang.String description, long totalNotificationsThusFar)
Called when an error or a warning is encountered.void
importProcessFinished(ImportResult importResult)
Called at the end of importation to notify the monitor about the results.void
importProcessStarted()
Called at the beginning of importation to allow the monitor to prepare any data structures it might need.
-
Field Details
-
s_nullMonitor
Provides a default implementation of an import monitor that ignores all notifications. -
s_firstErrorExceptionMonitor
Provides a default implementation of an import monitor that throws an exception upon first error notification.
-
-
Method Details
-
importProcessStarted
void importProcessStarted()Called at the beginning of importation to allow the monitor to prepare any data structures it might need. -
importJobStarted
void importJobStarted(int jobID, java.lang.String inputSourceName)Called when the importation of a data source starts.- Parameters:
jobID
- an identifier identifying an import jobinputSourceName
- the name of the input source that will be imported
-
importNotification
ImportNotificationMonitor.NotificationAction importNotification(int jobID, ImportNotificationMonitor.NotificationType notificationType, long line, long column, java.lang.String description, long totalNotificationsThusFar)Called when an error or a warning is encountered.- Parameters:
jobID
- an identifier identifying an import jobnotificationType
- determines the type of notification (i.e., an error or a warning)line
- the line number in the input source where the error/warning was producedcolumn
- the column number in the input source where the error/warning was produceddescription
- text describing the error/warningtotalNotificationsThusFar
- the total number of errors/notifications encountered thus far across all input sources- Returns:
- determines how the import should proceed after this notification
-
importJobFinished
void importJobFinished(int jobID)Called when the importation of a data source finishes.- Parameters:
jobID
- an identifier identifying an import job
-
importProcessFinished
Called at the end of importation to notify the monitor about the results.- Parameters:
importResult
- contains information about the import
-