Class DataRefreshServiceImpl
java.lang.Object
org.qubership.atp.tdm.service.impl.DataRefreshServiceImpl
- All Implemented Interfaces:
DataRefreshService
-
Constructor Summary
ConstructorsConstructorDescriptionDataRefreshServiceImpl(EnvironmentsService environmentsService, SchedulerService schedulerService, RefreshConfigRepository repository, TestDataTableRepository testDataTableRepository, ImportInfoRepository importInfoRepository, CatalogRepository catalogRepository, SqlRepository sqlRepository, MetricService metricService, TdmMdcHelper helper) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetNextScheduledRun(String cronExpression) Get next run's date / time details.getRefreshConfig(UUID id) voidSchedule jobs for stored refresh configurations.voidvoidRemoves unused refresh configs.runRefresh(String tableName, boolean saveOccupiedData) runRefresh(String tableName, Integer queryTimeout, boolean allEnv, boolean saveOccupiedData) Run refresh, saving/not saving occupied rows.runRefresh(UUID configId) saveRefreshConfig(String tableName, Integer queryTimeout, TestDataRefreshConfig config)
-
Constructor Details
-
DataRefreshServiceImpl
@Autowired public DataRefreshServiceImpl(@Nonnull EnvironmentsService environmentsService, @Nonnull SchedulerService schedulerService, @Nonnull RefreshConfigRepository repository, @Nonnull TestDataTableRepository testDataTableRepository, @Nonnull ImportInfoRepository importInfoRepository, @Nonnull CatalogRepository catalogRepository, @Nonnull SqlRepository sqlRepository, @Nonnull MetricService metricService, TdmMdcHelper helper) Default constructor.
-
-
Method Details
-
getRefreshConfig
- Specified by:
getRefreshConfigin interfaceDataRefreshService
-
saveRefreshConfig
public TestDataRefreshConfig saveRefreshConfig(@Nonnull String tableName, @Nonnull Integer queryTimeout, @Nonnull TestDataRefreshConfig config) throws Exception - Specified by:
saveRefreshConfigin interfaceDataRefreshService- Throws:
Exception
-
runRefresh
- Specified by:
runRefreshin interfaceDataRefreshService
-
runRefresh
public List<RefreshResults> runRefresh(@Nonnull String tableName, @Nonnull Integer queryTimeout, @Nonnull boolean allEnv, boolean saveOccupiedData) throws Exception Run refresh, saving/not saving occupied rows.- Specified by:
runRefreshin interfaceDataRefreshService- Parameters:
tableName- - table name.saveOccupiedData- - save occupied rows.- Returns:
- refresh results.
- Throws:
Exception- RuntimeException if can't find table by name.
-
runRefresh
@Transactional public RefreshResults runRefresh(@Nonnull String tableName, boolean saveOccupiedData) throws Exception - Specified by:
runRefreshin interfaceDataRefreshService- Throws:
Exception
-
getNextScheduledRun
Get next run's date / time details.- Specified by:
getNextScheduledRunin interfaceDataRefreshService- 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 refresh configs. -
removeJob
- Specified by:
removeJobin interfaceDataRefreshService
-
initSchedules
public void initSchedules()Schedule jobs for stored refresh configurations.
-