Search in sources :

Example 1 with BlackDuckResponsesTransformer

use of com.synopsys.integration.blackduck.http.transform.BlackDuckResponsesTransformer in project hub-alert by blackducksoftware.

the class BlackDuckProviderDataAccessor method retrieveBlackDuckPageResponse.

private <T extends BlackDuckResponse> BlackDuckPageResponse<T> retrieveBlackDuckPageResponse(BlackDuckServicesFactory blackDuckServicesFactory, UrlMultipleResponses<T> urlMultipleResponses, int pageNumber, int pageSize, Predicate<T> searchFilter) throws IntegrationException {
    BlackDuckResponsesTransformer blackDuckResponsesTransformer = blackDuckServicesFactory.getBlackDuckResponsesTransformer();
    int offset = pageNumber * pageSize;
    BlackDuckMultipleRequest<T> spec = new BlackDuckRequestBuilder().commonGet().setLimitAndOffset(pageSize, offset).buildBlackDuckRequest(urlMultipleResponses);
    return blackDuckResponsesTransformer.getSomeMatchingResponses(spec, searchFilter, pageSize);
}
Also used : BlackDuckRequestBuilder(com.synopsys.integration.blackduck.http.BlackDuckRequestBuilder) BlackDuckResponsesTransformer(com.synopsys.integration.blackduck.http.transform.BlackDuckResponsesTransformer)

Aggregations

BlackDuckRequestBuilder (com.synopsys.integration.blackduck.http.BlackDuckRequestBuilder)1 BlackDuckResponsesTransformer (com.synopsys.integration.blackduck.http.transform.BlackDuckResponsesTransformer)1