Class PollingAutomationPerTableRunner
java.lang.Object
com.kingsrook.qqq.backend.core.actions.automation.polling.PollingAutomationPerTableRunner
- All Implemented Interfaces:
Runnable
Runnable for the Polling Automation Provider, that looks for records that
need automations, and executes them.
An instance of this class should be created for each table/automation-status
- see the TableActions inner record for that definition, and the static
getTableActions method that helps someone who wants to start these threads
figure out which ones are needed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
extended version of TableAction, for sharding use-case - adds the shard details.static final record
Wrapper for a pair of (tableName, automationStatus)static interface
Interface to be used by 2 records in this class - normal TableActions, and ShardedTableActions. -
Constructor Summary
ConstructorsConstructorDescriptionPollingAutomationPerTableRunner
(QInstance instance, String providerName, Supplier<QSession> sessionSupplier, PollingAutomationPerTableRunner.TableActionsInterface tableActions) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyActionToMatchingRecords
(QTableMetaData table, List<QRecord> records, TableAutomationAction action) Finally, actually run action code against a list of known matching records.protected boolean
applyActionToRecords
(QTableMetaData table, List<QRecord> records, TableAutomationAction action) Run one action over a list of records (if they match the action's filter).getName()
Getter for namegetTableActions
(QInstance instance, String providerName) basically just get a list of tables which at least *could* have automations run - either meta-data automations, or table-triggers (data/user defined).void
processTableInsertOrUpdate
(QTableMetaData table, AutomationStatus automationStatus) Query for and process records that have a PENDING_INSERT or PENDING_UPDATE status on a given table.void
run()
-
Constructor Details
-
PollingAutomationPerTableRunner
public PollingAutomationPerTableRunner(QInstance instance, String providerName, Supplier<QSession> sessionSupplier, PollingAutomationPerTableRunner.TableActionsInterface tableActions)
-
-
Method Details
-
getTableActions
public static List<PollingAutomationPerTableRunner.TableActionsInterface> getTableActions(QInstance instance, String providerName) basically just get a list of tables which at least *could* have automations run - either meta-data automations, or table-triggers (data/user defined). -
run
-
processTableInsertOrUpdate
public void processTableInsertOrUpdate(QTableMetaData table, AutomationStatus automationStatus) throws QException Query for and process records that have a PENDING_INSERT or PENDING_UPDATE status on a given table.- Throws:
QException
-
applyActionToRecords
protected boolean applyActionToRecords(QTableMetaData table, List<QRecord> records, TableAutomationAction action) Run one action over a list of records (if they match the action's filter).- Returns:
- hadError - true if an exception was caught; false if all OK.
-
applyActionToMatchingRecords
public static void applyActionToMatchingRecords(QTableMetaData table, List<QRecord> records, TableAutomationAction action) throws Exception Finally, actually run action code against a list of known matching records.- Throws:
Exception
-
getName
Getter for name
-