@ Override protected List < ProxyDistribution > loadBeans ( final int startIndex , final int count ) { Page < DistributionSet > distBeans ; final List < ProxyDistribution > proxyDistributions = new ArrayList <> ( ) ; if ( startIndex == 0 && firstPageDistributionSets != null ) { distBeans = firstPageDistributionSets ; } else if ( pinnedTarget != null ) { final DistributionSetFilterBuilder distributionSetFilterBuilder = new DistributionSetFilterBuilder ( ) . setIsDeleted ( false ) . setIsComplete ( true ) . setSearchText ( searchText ) . setSelectDSWithNoTag ( noTagClicked ) . setTagNames ( distributionTags ) ; distBeans = getDistributionSetManagement ( ) . findByFilterAndAssignedInstalledDsOrderedByLinkTarget ( new OffsetBasedPageRequest ( startIndex , count , sort ) , distributionSetFilterBuilder , pinnedTarget . getControllerId ( ) ) ; } else if ( distributionTags . isEmpty ( ) && StringUtils . isEmpty ( searchText ) && ! noTagClicked ) { // if no search filters available distBeans = getDistributionSetManagement ( ) . findByCompleted ( new OffsetBasedPageRequest ( startIndex , count , sort ) , true ) ; } else { final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder ( ) . setIsDeleted ( false ) . setIsComplete ( true ) . setSearchText ( searchText ) . setSelectDSWithNoTag ( noTagClicked ) . setTagNames ( distributionTags ) . build ( ) ; distBeans = getDistributionSetManagement ( ) . findByDistributionSetFilter ( new OffsetBasedPageRequest ( startIndex , count , sort ) , distributionSetFilter ) ; } for ( final DistributionSet distributionSet : distBeans ) { final ProxyDistribution proxyDistribution = new ProxyDistribution ( ) ; proxyDistribution . setName ( distributionSet . getName ( ) ) ; proxyDistribution . setDescription ( distributionSet . getDescription ( ) ) ; proxyDistribution . setId ( distributionSet . getId ( ) ) ; proxyDistribution . setDistId ( distributionSet . getId ( ) ) ; proxyDistribution . setVersion ( distributionSet . getVersion ( ) ) ; proxyDistribution . setCreatedDate ( SPDateTimeUtil . getFormattedDate ( distributionSet . getCreatedAt ( ) ) ) ; proxyDistribution . setLastModifiedDate ( SPDateTimeUtil . getFormattedDate ( distributionSet . getLastModifiedAt ( ) ) ) ; proxyDistribution . setCreatedByUser ( UserDetailsFormatter . loadAndFormatCreatedBy ( distributionSet ) ) ; proxyDistribution . setModifiedByUser ( UserDetailsFormatter . loadAndFormatLastModifiedBy ( distributionSet ) ) ; proxyDistribution . setNameVersion ( HawkbitCommonUtil . getFormattedNameVersion ( distributionSet . getName ( ) , distributionSet . getVersion ( ) ) ) ; proxyDistributions . add ( proxyDistribution ) ; } return proxyDistributions ; }
Load all the Distribution set .