+ request.getPackageUuid() + ")" );
long start = System.currentTimeMillis();
PackageItem packageItem = getRulesRepository().loadPackageByUUID( request.getPackageUuid() );
AssetItemIterator iterator;
if ( request.getFormatInList() != null ) {
if ( request.getFormatIsRegistered() != null ) {
throw new IllegalArgumentException( "Combining formatInList and formatIsRegistered is not yet supported." );
}
iterator = packageItem.listAssetsByFormat( request.getFormatInList() );
} else {
if ( request.getFormatIsRegistered() != null && request.getFormatIsRegistered().equals( Boolean.FALSE ) ) {
iterator = packageItem.listAssetsNotOfFormat( registeredFormats );
} else {
iterator = packageItem.queryAssets( "" );
}
}
// Populate response
long totalRowsCount = iterator.getSize();
List<AssetPageRow> rowList = new AssetPageRowBuilder()
.withPageRequest( request )
.withContent( iterator )
.build();
PageResponse<AssetPageRow> response = new PageResponseBuilder<AssetPageRow>()
.withStartRowIndex( request.getStartRowIndex() )
.withPageRowList( rowList )
.withLastPage( !iterator.hasNext() )
.buildWithTotalRowCount( totalRowsCount );
long methodDuration = System.currentTimeMillis() - start;
log.debug( "Found asset page of packageUuid ("
+ request.getPackageUuid() + ") in " + methodDuration + " ms." );
return response;