Package com.epam.ta.reportportal.dao
Class LogRepositoryCustomImpl
- java.lang.Object
-
- com.epam.ta.reportportal.dao.LogRepositoryCustomImpl
-
- All Implemented Interfaces:
FilterableRepository<Log>,LogRepositoryCustom
@Repository public class LogRepositoryCustomImpl extends java.lang.Object implements LogRepositoryCustom
-
-
Constructor Summary
Constructors Constructor Description LogRepositoryCustomImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdeleteByPeriodAndTestItemIds(java.time.Duration period, java.util.Collection<java.lang.Long> testItemIds)java.util.List<Log>findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(java.lang.Long launchId, java.util.List<java.lang.Long> itemIds, int logLevel)java.util.List<Log>findByFilter(Queryable filter)Executes query built for given filterorg.springframework.data.domain.Page<Log>findByFilter(Queryable filter, org.springframework.data.domain.Pageable pageable)Executes query built for given filter and maps result for given pagejava.util.List<Log>findByTestItemId(java.lang.Long itemId)Load specified number of last logs for specified test item.java.util.List<Log>findByTestItemId(java.lang.Long itemId, int limit)Load specified number of last logs for specified test item.java.util.List<java.lang.Long>findIdsByFilter(Queryable filter)java.util.List<java.lang.Long>findIdsByTestItemId(java.lang.Long testItemId)java.util.List<java.lang.Long>findIdsByTestItemIdsAndLogLevelGte(java.util.List<java.lang.Long> itemIds, int logLevel)java.util.List<java.lang.Long>findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(java.lang.Long launchId, java.util.List<java.lang.Long> itemIds, int logLevel)java.util.List<java.lang.Long>findItemLogIdsByLaunchIdAndLogLevelGte(java.lang.Long launchId, int logLevel)java.util.List<java.lang.Long>findItemLogIdsByLaunchIdsAndLogLevelGte(java.util.List<java.lang.Long> launchIds, int logLevel)java.util.List<java.lang.String>findMessagesByItemIdAndLevelGte(java.lang.Long itemId, java.lang.Integer level)Retrieves log message of specified test item with log level greather or equals thanlevelorg.springframework.data.domain.Page<NestedItem>findNestedItems(java.lang.Long parentId, boolean excludeEmptySteps, boolean excludeLogs, Queryable filter, org.springframework.data.domain.Pageable pageable)java.lang.IntegergetPageNumber(java.lang.Long id, Filter filter, org.springframework.data.domain.Pageable pageable)Get the specified log's page numberbooleanhasLogs(java.lang.Long itemId)Checks if the test item has any logs.booleanhasLogsAddedLately(java.time.Duration period, java.lang.Long launchId, StatusEnum... statuses)True if theTestItemwith matching 'status' and 'launchId' hasLog's withLog.lastModifiedup to the current point of time minus provided 'period'voidsetDsl(org.jooq.DSLContext dsl)
-
-
-
Method Detail
-
setDsl
@Autowired public void setDsl(org.jooq.DSLContext dsl)
-
hasLogs
public boolean hasLogs(java.lang.Long itemId)
Description copied from interface:LogRepositoryCustomChecks if the test item has any logs.- Specified by:
hasLogsin interfaceLogRepositoryCustom- Parameters:
itemId- Item id- Returns:
- true if logs were found
-
findByTestItemId
public java.util.List<Log> findByTestItemId(java.lang.Long itemId, int limit)
Description copied from interface:LogRepositoryCustomLoad specified number of last logs for specified test item. binaryData field will be loaded if it specified in appropriate input parameter, all other fields will be fully loaded.- Specified by:
findByTestItemIdin interfaceLogRepositoryCustom- Parameters:
itemId- Test Item log belongs tolimit- Max count of logs to be loaded- Returns:
- Found logs
-
findByTestItemId
public java.util.List<Log> findByTestItemId(java.lang.Long itemId)
Description copied from interface:LogRepositoryCustomLoad specified number of last logs for specified test item. binaryData field will be loaded if it specified in appropriate input parameter, all other fields will be fully loaded.- Specified by:
findByTestItemIdin interfaceLogRepositoryCustom- Parameters:
itemId- Test Item log belongs to- Returns:
- Found logs
-
findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte
public java.util.List<Log> findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(java.lang.Long launchId, java.util.List<java.lang.Long> itemIds, int logLevel)
- Specified by:
findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGtein interfaceLogRepositoryCustom- Parameters:
launchId- ID of theLaunchto searchLogunderitemIds-Listof theLog.getTestItem()IDslogLevel-Log.getLogLevel()- Returns:
ListofLogwithoutLog.getAttachment()
-
findIdsByFilter
public java.util.List<java.lang.Long> findIdsByFilter(Queryable filter)
- Specified by:
findIdsByFilterin interfaceLogRepositoryCustom
-
findIdsByTestItemId
public java.util.List<java.lang.Long> findIdsByTestItemId(java.lang.Long testItemId)
- Specified by:
findIdsByTestItemIdin interfaceLogRepositoryCustom
-
findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte
public java.util.List<java.lang.Long> findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(java.lang.Long launchId, java.util.List<java.lang.Long> itemIds, int logLevel)- Specified by:
findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGtein interfaceLogRepositoryCustom- Parameters:
launchId- ID of theLaunchto searchLogunderitemIds-Listof theLog.getTestItem()IDslogLevel-Log.getLogLevel()- Returns:
ListofLog.getId()
-
findItemLogIdsByLaunchIdAndLogLevelGte
public java.util.List<java.lang.Long> findItemLogIdsByLaunchIdAndLogLevelGte(java.lang.Long launchId, int logLevel)- Specified by:
findItemLogIdsByLaunchIdAndLogLevelGtein interfaceLogRepositoryCustom
-
findItemLogIdsByLaunchIdsAndLogLevelGte
public java.util.List<java.lang.Long> findItemLogIdsByLaunchIdsAndLogLevelGte(java.util.List<java.lang.Long> launchIds, int logLevel)- Specified by:
findItemLogIdsByLaunchIdsAndLogLevelGtein interfaceLogRepositoryCustom
-
findIdsByTestItemIdsAndLogLevelGte
public java.util.List<java.lang.Long> findIdsByTestItemIdsAndLogLevelGte(java.util.List<java.lang.Long> itemIds, int logLevel)- Specified by:
findIdsByTestItemIdsAndLogLevelGtein interfaceLogRepositoryCustom
-
findByFilter
public java.util.List<Log> findByFilter(Queryable filter)
Description copied from interface:FilterableRepositoryExecutes query built for given filter- Specified by:
findByFilterin interfaceFilterableRepository<Log>- Parameters:
filter- Filter to build a query- Returns:
- List of mapped entries found
-
findByFilter
public org.springframework.data.domain.Page<Log> findByFilter(Queryable filter, org.springframework.data.domain.Pageable pageable)
Description copied from interface:FilterableRepositoryExecutes query built for given filter and maps result for given page- Specified by:
findByFilterin interfaceFilterableRepository<Log>- Parameters:
filter- Filter to build a querypageable-Pageable- Returns:
- List of mapped entries found
-
getPageNumber
public java.lang.Integer getPageNumber(java.lang.Long id, Filter filter, org.springframework.data.domain.Pageable pageable)Description copied from interface:LogRepositoryCustomGet the specified log's page number- Specified by:
getPageNumberin interfaceLogRepositoryCustom- Parameters:
id- ID of log page should be found offilter- Filterpageable- Page details- Returns:
- Page number log found using specified filter
-
hasLogsAddedLately
public boolean hasLogsAddedLately(java.time.Duration period, java.lang.Long launchId, StatusEnum... statuses)Description copied from interface:LogRepositoryCustomTrue if theTestItemwith matching 'status' and 'launchId' hasLog's withLog.lastModifiedup to the current point of time minus provided 'period'- Specified by:
hasLogsAddedLatelyin interfaceLogRepositoryCustom- Parameters:
period-DurationlaunchId-Launch.idstatuses-StatusEnum- Returns:
- true if logs(the log) exist(exists)
-
deleteByPeriodAndTestItemIds
public int deleteByPeriodAndTestItemIds(java.time.Duration period, java.util.Collection<java.lang.Long> testItemIds)- Specified by:
deleteByPeriodAndTestItemIdsin interfaceLogRepositoryCustom- Parameters:
period-DurationtestItemIds- Collection of theTestItem.itemIdreferenced fromLog.testItem- Returns:
- Count of removed logs
-
findNestedItems
public org.springframework.data.domain.Page<NestedItem> findNestedItems(java.lang.Long parentId, boolean excludeEmptySteps, boolean excludeLogs, Queryable filter, org.springframework.data.domain.Pageable pageable)
Description copied from interface:LogRepositoryCustomRetrieveLogandTestItementities' ids, differentiated by entity typeLogandTestItementities filtered and sorted on the DB level and returned as UNION parsed into theNestedItementity- Specified by:
findNestedItemsin interfaceLogRepositoryCustom- Parameters:
parentId-TestItem.itemIdof the parent itemexcludeEmptySteps- Exclude steps without content (logs and child items)excludeLogs- Exclude logs selectionfilter-Queryablepageable-Pageable- Returns:
PagewithNestedItemas content
-
findMessagesByItemIdAndLevelGte
public java.util.List<java.lang.String> findMessagesByItemIdAndLevelGte(java.lang.Long itemId, java.lang.Integer level)Description copied from interface:LogRepositoryCustomRetrieves log message of specified test item with log level greather or equals thanlevel- Specified by:
findMessagesByItemIdAndLevelGtein interfaceLogRepositoryCustom- Parameters:
itemId- ID ofTestItemlevel- log level- Returns:
ListofStringof log messages
-
-