Class CodeScanStatisticsService
java.lang.Object
com.persequor.saga.modules.dpp.service.CodeScanStatisticsService
- All Implemented Interfaces:
ICodeScanStatisticsService
@Singleton
public class CodeScanStatisticsService
extends Object
implements ICodeScanStatisticsService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.persequor.saga.modules.dpp.sdk.ICodeScanStatisticsService
ICodeScanStatisticsService.CodeScanStatisticsResult
-
Constructor Summary
ConstructorsConstructorDescriptionCodeScanStatisticsService
(CodeScanStatisticsRepository codeScanStatisticsRepository, DppQueryService dppDataService) -
Method Summary
Modifier and TypeMethodDescriptionGet statistics for a specific code.Get statistics for all scanned codes without any filtering.void
incrementByCode
(String code) Increment the scan count for the given code.search
(CodeScanStatisticsSearchRequest request) Search for code scan statistics using a search request.
-
Constructor Details
-
CodeScanStatisticsService
@Inject public CodeScanStatisticsService(CodeScanStatisticsRepository codeScanStatisticsRepository, DppQueryService dppDataService)
-
-
Method Details
-
incrementByCode
Description copied from interface:ICodeScanStatisticsService
Increment the scan count for the given code.If the code does not exist in the statistics, it will be added.
- Specified by:
incrementByCode
in interfaceICodeScanStatisticsService
- Parameters:
code
- The code to increment the scan count for
-
getByCode
Description copied from interface:ICodeScanStatisticsService
Get statistics for a specific code.If the code has item data, the item data will be included in the result, and the
knownCode
flag set to true.- Specified by:
getByCode
in interfaceICodeScanStatisticsService
- Parameters:
code
- The code to get statistics for- Returns:
- Statistics for the given code, if it exists,
Optional.empty()
otherwise
-
getStatistics
Description copied from interface:ICodeScanStatisticsService
Get statistics for all scanned codes without any filtering.Any item code which has item data will have the item data included in the result, and the
knownCode
flag set to true.- Specified by:
getStatistics
in interfaceICodeScanStatisticsService
- Returns:
- List of statistics for all scanned codes
-
search
public ICodeScanStatisticsService.CodeScanStatisticsResult search(CodeScanStatisticsSearchRequest request) Description copied from interface:ICodeScanStatisticsService
Search for code scan statistics using a search request.- Specified by:
search
in interfaceICodeScanStatisticsService
- Parameters:
request
- The search request containing the search parameters- Returns:
- The result of the search containing a stream of
CodeScanReportResult
and the total count of items in the result, ignoring the offset and limit
-