Class TestDataServiceImpl
java.lang.Object
org.qubership.atp.tdm.service.impl.TestDataServiceImpl
- All Implemented Interfaces:
TestDataService
-
Constructor Summary
ConstructorsConstructorDescriptionTestDataServiceImpl(CatalogRepository catalogRepository, TestDataTableRepository testDataTableRepository, EnvironmentsService environmentsService, CleanupService cleanupService, StatisticsService statisticsService, DataRefreshService dataRefreshService, ColumnService columnService, ImportInfoRepository importInfoRepository, org.qubership.atp.crypt.api.Decryptor decryptor, TestDataFlagsService testDataFlagsService, ProjectInformationRepository projectInformationRepository, org.qubership.atp.common.lock.LockManager lockManager, SchedulerService schedulerService, Integer defaultQueryTimeout, String removingCron, String historyCleanerCron, TdmMdcHelper helper) Constructor for TestDataService. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidbooleanchangeTestDataTitle(String tableName, String tableTitle) voiddeleteProjectFromCatalogue(UUID projectId) deleteTestData(String tableName) voiddeleteTestDataTableRows(String tableName, List<UUID> rows) evaluateQuery(String tableName, String query) voidgetAllColumnNamesBySystemId(UUID systemId) getColumnDistinctValues(String tableName, String columnName, Boolean occupied) getDistinctTablesColumnValues(UUID systemId, UUID environmentId, String columnName) getPreviewLink(UUID projectId, UUID systemId, String endpoint, String columnName, String tableName, Boolean pickUpFullLinkFromTableCell) getTableByCreatedWhen(List<TestDataTableCatalog> catalogList, LocalDate dateFrom, LocalDate dateTo) getTableEnvironments(UUID projectId, String tableTitle) Returns a list of environment IDs that have tables with the requested table title for the specified project.getTableRow(String tableName, String columnName, String searchValue, boolean occupied) getTableRow(UUID projectId, UUID systemId, String tableTitle, String columnName, String searchValue, boolean occupied) getTestData(String tableName) getTestData(String tableName, Integer offset, Integer limit, List<TestDataTableFilter> filters, TestDataTableOrder testDataTableOrder, Boolean isOccupied) getTestData(String tableName, List<String> columnNames, List<TestDataTableFilter> filters) getTestDataTableAsCsvFile(String tableName) Method to convert TestDataTable to csv excel file.getTestDataTableAsExcelFile(String tableName) Method to convert TestDataTable to excel file.getTestDataTablesCatalog(UUID projectId, UUID systemId) getUnoccupiedValidationFlagStatus(String tableName) importExcelTestData(UUID projectId, UUID environmentId, UUID systemId, String tableTitle, Boolean runSqlScriptAfterExcelImport, org.springframework.web.multipart.MultipartFile file) importSqlTestData(UUID projectId, List<UUID> environmentsIds, String systemName, String tableTitle, String query, Integer queryTimeout) voidoccupyTestData(String tableName, String occupiedBy, List<UUID> rows) voidreleaseTestData(String tableName, List<UUID> rows) voidvoidschedule()Schedule.voidsetupColumnLinks(Boolean isAll, UUID projectId, UUID systemId, String tableName, String columnName, String endpoint, Boolean validateUnoccupiedResources, Boolean pickUpFullLinkFromTableCell) tablesToExport(UUID projectId) tablesToExportByEnvironment(UUID projectId, UUID environmentId) truncateDataInTable(String tableName, UUID projectId, UUID systemId) updateTestDataBySql(UUID projectId, UUID environmentId, UUID systemId, String tableName, String query, Integer queryTimeout)
-
Constructor Details
-
TestDataServiceImpl
@Autowired public TestDataServiceImpl(@Nonnull CatalogRepository catalogRepository, @Nonnull TestDataTableRepository testDataTableRepository, @Nonnull EnvironmentsService environmentsService, @Nonnull CleanupService cleanupService, @Nonnull StatisticsService statisticsService, @Nonnull DataRefreshService dataRefreshService, @Nonnull ColumnService columnService, @Nonnull ImportInfoRepository importInfoRepository, @Nonnull org.qubership.atp.crypt.api.Decryptor decryptor, @Nonnull TestDataFlagsService testDataFlagsService, @Nonnull ProjectInformationRepository projectInformationRepository, @Nonnull org.qubership.atp.common.lock.LockManager lockManager, @Nonnull SchedulerService schedulerService, @Value("${external.query.default.timeout:1800}") Integer defaultQueryTimeout, @Value("${table.expiration.cron}") String removingCron, @Value("${clean.removed.tables.history.cron}") String historyCleanerCron, TdmMdcHelper helper) Constructor for TestDataService.
-
-
Method Details
-
getTestDataTablesCatalog
public List<TestDataTableCatalog> getTestDataTablesCatalog(@Nonnull UUID projectId, @Nullable UUID systemId) - Specified by:
getTestDataTablesCatalogin interfaceTestDataService
-
tablesToExport
- Specified by:
tablesToExportin interfaceTestDataService
-
tablesToExportByEnvironment
public Map<String,String> tablesToExportByEnvironment(@Nonnull UUID projectId, @Nonnull UUID environmentId) - Specified by:
tablesToExportByEnvironmentin interfaceTestDataService
-
getTestData
- Specified by:
getTestDatain interfaceTestDataService
-
getTestData
public TestDataTable getTestData(@Nonnull String tableName, @Nullable Integer offset, @Nullable Integer limit, @Nullable List<TestDataTableFilter> filters, @Nullable TestDataTableOrder testDataTableOrder, @Nonnull Boolean isOccupied) - Specified by:
getTestDatain interfaceTestDataService
-
getTestData
public TestDataTable getTestData(@Nonnull String tableName, @Nonnull List<String> columnNames, @Nullable List<TestDataTableFilter> filters) - Specified by:
getTestDatain interfaceTestDataService
-
importExcelTestData
public List<ImportTestDataStatistic> importExcelTestData(@Nonnull UUID projectId, @Nullable UUID environmentId, @Nullable UUID systemId, @Nonnull String tableTitle, @Nonnull Boolean runSqlScriptAfterExcelImport, @Nonnull org.springframework.web.multipart.MultipartFile file) - Specified by:
importExcelTestDatain interfaceTestDataService
-
importSqlTestData
public List<ImportTestDataStatistic> importSqlTestData(@Nonnull UUID projectId, @Nonnull List<UUID> environmentsIds, @Nonnull String systemName, @Nonnull String tableTitle, @Nonnull String query, @Nonnull Integer queryTimeout) - Specified by:
importSqlTestDatain interfaceTestDataService
-
occupyTestData
public void occupyTestData(@Nonnull String tableName, @Nonnull String occupiedBy, @Nonnull List<UUID> rows) - Specified by:
occupyTestDatain interfaceTestDataService
-
releaseTestData
- Specified by:
releaseTestDatain interfaceTestDataService
-
deleteTestData
- Specified by:
deleteTestDatain interfaceTestDataService
-
truncateDataInTable
public DropResults truncateDataInTable(@Nonnull String tableName, @Nonnull UUID projectId, UUID systemId) - Specified by:
truncateDataInTablein interfaceTestDataService
-
deleteTestDataTableRows
- Specified by:
deleteTestDataTableRowsin interfaceTestDataService
-
getTestDataTableAsExcelFile
Method to convert TestDataTable to excel file.- Specified by:
getTestDataTableAsExcelFilein interfaceTestDataService- Parameters:
tableName- table name.- Returns:
- Excel file.
-
getTestDataTableAsCsvFile
Method to convert TestDataTable to csv excel file.- Specified by:
getTestDataTableAsCsvFilein interfaceTestDataService- Parameters:
tableName- table name.- Returns:
- csv file.
-
getPreviewLink
public String getPreviewLink(@Nonnull UUID projectId, @Nullable UUID systemId, @Nullable String endpoint, @Nonnull String columnName, @Nullable String tableName, @Nonnull Boolean pickUpFullLinkFromTableCell) - Specified by:
getPreviewLinkin interfaceTestDataService
-
getTableEnvironments
Returns a list of environment IDs that have tables with the requested table title for the specified project.- Specified by:
getTableEnvironmentsin interfaceTestDataService- Returns:
- list of environment ids.
-
alterOccupiedByColumn
public void alterOccupiedByColumn()- Specified by:
alterOccupiedByColumnin interfaceTestDataService
-
setupColumnLinks
public void setupColumnLinks(@Nonnull Boolean isAll, @Nonnull UUID projectId, @Nonnull UUID systemId, @Nonnull String tableName, @Nonnull String columnName, @Nonnull String endpoint, @Nonnull Boolean validateUnoccupiedResources, @Nonnull Boolean pickUpFullLinkFromTableCell) - Specified by:
setupColumnLinksin interfaceTestDataService
-
deleteProjectFromCatalogue
- Specified by:
deleteProjectFromCataloguein interfaceTestDataService
-
alterCreatedWhenColumn
public void alterCreatedWhenColumn()- Specified by:
alterCreatedWhenColumnin interfaceTestDataService
-
fillEnvIdColumn
public void fillEnvIdColumn()- Specified by:
fillEnvIdColumnin interfaceTestDataService
-
evaluateQuery
- Specified by:
evaluateQueryin interfaceTestDataService
-
getColumnDistinctValues
public ColumnValues getColumnDistinctValues(@Nonnull String tableName, @Nonnull String columnName, Boolean occupied) - Specified by:
getColumnDistinctValuesin interfaceTestDataService
-
getTableByCreatedWhen
public DateStatistics getTableByCreatedWhen(@Nonnull List<TestDataTableCatalog> catalogList, @Nonnull LocalDate dateFrom, @Nonnull LocalDate dateTo) - Specified by:
getTableByCreatedWhenin interfaceTestDataService
-
getTableRow
public Map<String,Object> getTableRow(@Nonnull UUID projectId, @Nullable UUID systemId, @Nonnull String tableTitle, @Nonnull String columnName, @Nonnull String searchValue, boolean occupied) - Specified by:
getTableRowin interfaceTestDataService
-
getTableRow
public Map<String,Object> getTableRow(@Nonnull String tableName, @Nonnull String columnName, @Nonnull String searchValue, boolean occupied) - Specified by:
getTableRowin interfaceTestDataService
-
changeTestDataTitle
- Specified by:
changeTestDataTitlein interfaceTestDataService
-
alterOccupyStatistic
public void alterOccupyStatistic()- Specified by:
alterOccupyStatisticin interfaceTestDataService
-
updateTestDataBySql
public ImportTestDataStatistic updateTestDataBySql(@Nonnull UUID projectId, @Nonnull UUID environmentId, @Nonnull UUID systemId, @Nonnull String tableName, @Nonnull String query, @Nonnull Integer queryTimeout) - Specified by:
updateTestDataBySqlin interfaceTestDataService
-
getUnoccupiedValidationFlagStatus
- Specified by:
getUnoccupiedValidationFlagStatusin interfaceTestDataService
-
resolveDiscrepancyTestDataFlagsTableAndTestDataTableCatalog
public void resolveDiscrepancyTestDataFlagsTableAndTestDataTableCatalog()- Specified by:
resolveDiscrepancyTestDataFlagsTableAndTestDataTableCatalogin interfaceTestDataService
-
schedule
public void schedule()Schedule. -
getDistinctTablesColumnValues
public List<TableColumnValues> getDistinctTablesColumnValues(@Nonnull UUID systemId, @Nonnull UUID environmentId, @Nonnull String columnName) - Specified by:
getDistinctTablesColumnValuesin interfaceTestDataService
-
getAllColumnNamesBySystemId
- Specified by:
getAllColumnNamesBySystemIdin interfaceTestDataService
-