Class LogRepositoryCustomImpl

    • Constructor Detail

      • LogRepositoryCustomImpl

        public LogRepositoryCustomImpl()
    • Method Detail

      • setDsl

        @Autowired
        public void setDsl​(org.jooq.DSLContext dsl)
      • hasLogs

        public boolean hasLogs​(java.lang.Long itemId)
        Description copied from interface: LogRepositoryCustom
        Checks if the test item has any logs.
        Specified by:
        hasLogs in interface LogRepositoryCustom
        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: LogRepositoryCustom
        Load 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:
        findByTestItemId in interface LogRepositoryCustom
        Parameters:
        itemId - Test Item log belongs to
        limit - 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: LogRepositoryCustom
        Load 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:
        findByTestItemId in interface LogRepositoryCustom
        Parameters:
        itemId - Test Item log belongs to
        Returns:
        Found logs
      • findByFilter

        public org.springframework.data.domain.Page<Log> findByFilter​(Queryable filter,
                                                                      org.springframework.data.domain.Pageable pageable)
        Description copied from interface: FilterableRepository
        Executes query built for given filter and maps result for given page
        Specified by:
        findByFilter in interface FilterableRepository<Log>
        Parameters:
        filter - Filter to build a query
        pageable - 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: LogRepositoryCustom
        Get the specified log's page number
        Specified by:
        getPageNumber in interface LogRepositoryCustom
        Parameters:
        id - ID of log page should be found of
        filter - Filter
        pageable - Page details
        Returns:
        Page number log found using specified filter
      • deleteByPeriodAndTestItemIds

        public int deleteByPeriodAndTestItemIds​(java.time.Duration period,
                                                java.util.Collection<java.lang.Long> testItemIds)
        Specified by:
        deleteByPeriodAndTestItemIds in interface LogRepositoryCustom
        Parameters:
        period - Duration
        testItemIds - Collection of the TestItem.itemId referenced from Log.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: LogRepositoryCustom
        Retrieve Log and TestItem entities' ids, differentiated by entity type

        Log and TestItem entities filtered and sorted on the DB level and returned as UNION parsed into the NestedItem entity

        Specified by:
        findNestedItems in interface LogRepositoryCustom
        Parameters:
        parentId - TestItem.itemId of the parent item
        excludeEmptySteps - Exclude steps without content (logs and child items)
        excludeLogs - Exclude logs selection
        filter - Queryable
        pageable - Pageable
        Returns:
        Page with NestedItem as content
      • findMessagesByItemIdAndLevelGte

        public java.util.List<java.lang.String> findMessagesByItemIdAndLevelGte​(java.lang.Long itemId,
                                                                                java.lang.Integer level)
        Description copied from interface: LogRepositoryCustom
        Retrieves log message of specified test item with log level greather or equals than level
        Specified by:
        findMessagesByItemIdAndLevelGte in interface LogRepositoryCustom
        Parameters:
        itemId - ID of TestItem
        level - log level
        Returns:
        List of String of log messages