Interface LogRepositoryCustom

    • Method Detail

      • hasLogs

        boolean hasLogs​(java.lang.Long itemId)
        Checks if the test item has any logs.
        Parameters:
        itemId - Item id
        Returns:
        true if logs were found
      • findByTestItemId

        java.util.List<Log> findByTestItemId​(java.lang.Long itemId,
                                             int limit)
        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.
        Parameters:
        limit - Max count of logs to be loaded
        itemId - Test Item log belongs to
        Returns:
        Found logs
      • findByTestItemId

        java.util.List<Log> findByTestItemId​(java.lang.Long itemId)
        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.
        Parameters:
        itemId - Test Item log belongs to
        Returns:
        Found logs
      • findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte

        java.util.List<Log> findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte​(java.lang.Long launchId,
                                                                                       java.util.List<java.lang.Long> itemIds,
                                                                                       int logLevel)
        Parameters:
        launchId - ID of the Launch to search Log under
        itemIds - List of the Log.getTestItem() IDs
        logLevel - Log.getLogLevel()
        Returns:
        List of Log
      • findIdsByFilter

        java.util.List<java.lang.Long> findIdsByFilter​(Queryable filter)
      • findIdsByTestItemId

        java.util.List<java.lang.Long> findIdsByTestItemId​(java.lang.Long testItemId)
      • findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte

        java.util.List<java.lang.Long> findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte​(java.lang.Long launchId,
                                                                                                  java.util.List<java.lang.Long> itemIds,
                                                                                                  int logLevel)
        Parameters:
        launchId - ID of the Launch to search Log under
        itemIds - List of the Log.getTestItem() IDs
        logLevel - Log.getLogLevel()
        Returns:
        List of Log.getId()
      • findItemLogIdsByLaunchIdAndLogLevelGte

        java.util.List<java.lang.Long> findItemLogIdsByLaunchIdAndLogLevelGte​(java.lang.Long launchId,
                                                                              int logLevel)
      • findItemLogIdsByLaunchIdsAndLogLevelGte

        java.util.List<java.lang.Long> findItemLogIdsByLaunchIdsAndLogLevelGte​(java.util.List<java.lang.Long> launchIds,
                                                                               int logLevel)
      • findIdsByTestItemIdsAndLogLevelGte

        java.util.List<java.lang.Long> findIdsByTestItemIdsAndLogLevelGte​(java.util.List<java.lang.Long> itemIds,
                                                                          int logLevel)
      • getPageNumber

        java.lang.Integer getPageNumber​(java.lang.Long id,
                                        Filter filter,
                                        org.springframework.data.domain.Pageable pageable)
        Get the specified log's page number
        Parameters:
        id - ID of log page should be found of
        filter - Filter
        pageable - Page details
        Returns:
        Page number log found using specified filter
      • hasLogsAddedLately

        boolean hasLogsAddedLately​(java.time.Duration period,
                                   java.lang.Long launchId,
                                   StatusEnum... statuses)
        True if the TestItem with matching 'status' and 'launchId' has Log's with Log.lastModified up to the current point of time minus provided 'period'
        Parameters:
        period - Duration
        launchId - Launch.id
        statuses - StatusEnum
        Returns:
        true if logs(the log) exist(exists)
      • deleteByPeriodAndTestItemIds

        int deleteByPeriodAndTestItemIds​(java.time.Duration period,
                                         java.util.Collection<java.lang.Long> testItemIds)
        Parameters:
        period - Duration
        testItemIds - Collection of the TestItem.itemId referenced from Log.testItem
        Returns:
        Count of removed logs
      • findNestedItems

        org.springframework.data.domain.Page<NestedItem> findNestedItems​(java.lang.Long parentId,
                                                                         boolean excludeEmptySteps,
                                                                         boolean excludeLogs,
                                                                         Queryable filter,
                                                                         org.springframework.data.domain.Pageable pageable)
        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

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

        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 than level
        Parameters:
        itemId - ID of TestItem
        level - log level
        Returns:
        List of String of log messages