private Map < PackageUrl , ComponentReport > requestReports ( final Dependency [ ] dependencies ) throws Exception { log . debug ( "Requesting component-reports for {} dependencies" , dependencies . length ) ; // create requests for each dependency which has a PURL identifier List < PackageUrl > packages = new ArrayList <> ( ) ; for ( Dependency dependency : dependencies ) { for ( Identifier id : dependency . getSoftwareIdentifiers ( ) ) { if ( id instanceof PurlIdentifier ) { PackageUrl purl = parsePackageUrl ( id . getValue ( ) ) ; if ( purl != null ) { packages . add ( purl ) ; } } } } // only attempt if we have been able to collect some packages if ( ! packages . isEmpty ( ) ) { return client . requestComponentReports ( packages ) ; } log . warn ( "Unable to determine Package-URL identifiers for {} dependencies" , dependencies . length ) ; return Collections . emptyMap ( ) ; }
Batch request component - reports for all dependencies .