Class CleanupServiceImpl
java.lang.Object
org.qubership.atp.tdm.service.impl.CleanupServiceImpl
- All Implemented Interfaces:
CleanupService
-
Constructor Summary
ConstructorsConstructorDescriptionCleanupServiceImpl(EnvironmentsService environmentsService, SchedulerService schedulerService, CleanupConfigRepository repository, TestDataTableRepository testDataTableRepository, CatalogRepository catalogRepository, SqlRepository sqlRepository, DataSource dataSource, ImportInfoRepository importInfoRepository, MetricService metricService, TdmMdcHelper helper, List<TestDataCleaner> implementations) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidFilling cleanup search type column.getCleanupConfig(UUID id) Get cleanup configuration object for specified dataset / table.getNextScheduledRun(String cronExpression) Get next run's date / time details.getTablesByTableNameAndEnvironmentsListWithSameSystemName(List<UUID> environmentsList, String tableName) voidSchedule jobs for stored cleanup configurations.voidRemoves unused cleanup job.voidRemoves unused cleanup configs.runCleanup(String tableName, TestDataCleanupConfig config) Force run data cleanup for specified dataset / table ID.runCleanup(UUID configId) runCleanup(CleanupSettings cleanupSettings) saveCleanupConfig(CleanupSettings cleanupSettings)
-
Constructor Details
-
CleanupServiceImpl
@Autowired public CleanupServiceImpl(@Nonnull EnvironmentsService environmentsService, @Nonnull SchedulerService schedulerService, @Nonnull CleanupConfigRepository repository, @Nonnull TestDataTableRepository testDataTableRepository, @Nonnull CatalogRepository catalogRepository, @Nonnull SqlRepository sqlRepository, @Nonnull DataSource dataSource, @Nonnull ImportInfoRepository importInfoRepository, @Nonnull MetricService metricService, TdmMdcHelper helper, List<TestDataCleaner> implementations) Default constructor.
-
-
Method Details
-
getCleanupConfig
Get cleanup configuration object for specified dataset / table.- Specified by:
getCleanupConfigin interfaceCleanupService- Parameters:
id- - cleanup config name- Returns:
- cleanup configuration object
-
getCleanupSettings
- Specified by:
getCleanupSettingsin interfaceCleanupService
-
saveCleanupConfig
- Specified by:
saveCleanupConfigin interfaceCleanupService- Throws:
Exception
-
runCleanup
- Specified by:
runCleanupin interfaceCleanupService- Throws:
Exception
-
runCleanup
- Specified by:
runCleanupin interfaceCleanupService
-
runCleanup
public CleanupResults runCleanup(@Nonnull String tableName, @Nonnull TestDataCleanupConfig config) throws Exception Force run data cleanup for specified dataset / table ID.- Specified by:
runCleanupin interfaceCleanupService- Parameters:
config- - cleanup config- Throws:
Exception
-
getNextScheduledRun
Get next run's date / time details.- Specified by:
getNextScheduledRunin interfaceCleanupService- Parameters:
cronExpression- cron expression to calculate next run based on- Returns:
- ResponseMessage that contains the details
- Throws:
ParseException- Thrown in case if invalid cron expression was provided
-
removeUnused
public void removeUnused()Removes unused cleanup configs.- Specified by:
removeUnusedin interfaceCleanupService
-
removeJob
Removes unused cleanup job. -
fillCleanupTypeColumn
public void fillCleanupTypeColumn()Filling cleanup search type column.- Specified by:
fillCleanupTypeColumnin interfaceCleanupService
-
initSchedules
public void initSchedules()Schedule jobs for stored cleanup configurations. -
getTablesByTableNameAndEnvironmentsListWithSameSystemName
public List<String> getTablesByTableNameAndEnvironmentsListWithSameSystemName(@Nonnull List<UUID> environmentsList, @Nonnull String tableName) - Specified by:
getTablesByTableNameAndEnvironmentsListWithSameSystemNamein interfaceCleanupService
-