@Override protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) { Page<DistributionSet> distBeans; final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .build(); if (startIndex == 0 && firstPageDistributionSets != null) { distBeans = firstPageDistributionSets; } else { distBeans = getDistributionSetManagement().findByDistributionSetFilter( new PageRequest(startIndex / count, count, sort), distributionSetFilter); } return createProxyDistributions(distBeans); }
@Override protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) { Page<DistributionSet> distBeans; final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .build(); if (startIndex == 0 && firstPageDistributionSets != null) { distBeans = firstPageDistributionSets; } else { distBeans = getDistributionSetManagement().findByDistributionSetFilter( PageRequest.of(startIndex / count, count, sort), distributionSetFilter); } return createProxyDistributions(distBeans); }
@Override public int size() { final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .setIsComplete(true).build(); firstPageDistributionSets = getDistributionSetManagement().findByDistributionSetFilter( new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), distributionSetFilter); final long size = firstPageDistributionSets.getTotalElements(); if (size > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } return (int) size; }
@Override public int size() { final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .setIsComplete(true).build(); firstPageDistributionSets = getDistributionSetManagement() .findByDistributionSetFilter(PageRequest.of(0, SPUIDefinitions.PAGE_SIZE, sort), distributionSetFilter); final long size = firstPageDistributionSets.getTotalElements(); if (size > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } return (int) size; }
@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 (StringUtils.isEmpty(searchText)) { // if no search filters available distBeans = getDistributionSetManagement() .findByCompleted(new OffsetBasedPageRequest(startIndex, count, sort), dsComplete); } else { final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .setIsComplete(dsComplete).setSearchText(searchText).setSelectDSWithNoTag(Boolean.FALSE) .setType(distributionSetType).build(); distBeans = getDistributionSetManagement().findByDistributionSetFilter( PageRequest.of(startIndex / count, count, sort), distributionSetFilter); } for (final DistributionSet distributionSet : distBeans) { proxyDistributions.add(new ProxyDistribution(distributionSet)); } return proxyDistributions; }
@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 (StringUtils.isEmpty(searchText)) { // if no search filters available distBeans = getDistributionSetManagement() .findByCompleted(new OffsetBasedPageRequest(startIndex, count, sort), dsComplete); } else { final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .setIsComplete(dsComplete).setSearchText(searchText).setSelectDSWithNoTag(Boolean.FALSE) .setType(distributionSetType).build(); distBeans = getDistributionSetManagement().findByDistributionSetFilter( new PageRequest(startIndex / count, count, sort), distributionSetFilter); } for (final DistributionSet distributionSet : distBeans) { proxyDistributions.add(new ProxyDistribution(distributionSet)); } return proxyDistributions; }
@Override public int size() { if (StringUtils.isEmpty(searchText) && distributionSetType == null) { // if no search filters available firstPageDistributionSets = getDistributionSetManagement() .findByCompleted(new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), dsComplete); } else { final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .setIsComplete(dsComplete).setSearchText(searchText).setSelectDSWithNoTag(Boolean.FALSE) .setType(distributionSetType).build(); firstPageDistributionSets = getDistributionSetManagement().findByDistributionSetFilter( new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), distributionSetFilter); } final long size = firstPageDistributionSets.getTotalElements(); if (size > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } return (int) size; }
@Override public int size() { if (StringUtils.isEmpty(searchText) && distributionSetType == null) { // if no search filters available firstPageDistributionSets = getDistributionSetManagement() .findByCompleted(PageRequest.of(0, SPUIDefinitions.PAGE_SIZE, sort), dsComplete); } else { final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .setIsComplete(dsComplete).setSearchText(searchText).setSelectDSWithNoTag(Boolean.FALSE) .setType(distributionSetType).build(); firstPageDistributionSets = getDistributionSetManagement().findByDistributionSetFilter( PageRequest.of(0, SPUIDefinitions.PAGE_SIZE, sort), distributionSetFilter); } final long size = firstPageDistributionSets.getTotalElements(); if (size > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } return (int) size; }
@Override public int size() { if (pinnedTarget != null) { final DistributionSetFilterBuilder distributionSetFilterBuilder = new DistributionSetFilterBuilder() .setIsDeleted(false).setIsComplete(true).setSearchText(searchText) .setSelectDSWithNoTag(noTagClicked).setTagNames(distributionTags); firstPageDistributionSets = getDistributionSetManagement() .findByFilterAndAssignedInstalledDsOrderedByLinkTarget( new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), distributionSetFilterBuilder, pinnedTarget.getControllerId()); } else if (distributionTags.isEmpty() && StringUtils.isEmpty(searchText) && !noTagClicked) { // if no search filters available firstPageDistributionSets = getDistributionSetManagement() .findByCompleted(new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), true); } else { final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .setIsComplete(true).setSearchText(searchText).setSelectDSWithNoTag(noTagClicked) .setTagNames(distributionTags).build(); firstPageDistributionSets = getDistributionSetManagement().findByDistributionSetFilter( new PageRequest(0, SPUIDefinitions.PAGE_SIZE, sort), distributionSetFilter); } final long size = firstPageDistributionSets.getTotalElements(); if (size > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } return (int) size; }
@Override public int size() { if (pinnedTarget != null) { final DistributionSetFilterBuilder distributionSetFilterBuilder = new DistributionSetFilterBuilder() .setIsDeleted(false).setIsComplete(true).setSearchText(searchText) .setSelectDSWithNoTag(noTagClicked).setTagNames(distributionTags); firstPageDistributionSets = getDistributionSetManagement() .findByFilterAndAssignedInstalledDsOrderedByLinkTarget( PageRequest.of(0, SPUIDefinitions.PAGE_SIZE, sort), distributionSetFilterBuilder, pinnedTarget.getControllerId()); } else if (distributionTags.isEmpty() && StringUtils.isEmpty(searchText) && !noTagClicked) { // if no search filters available firstPageDistributionSets = getDistributionSetManagement() .findByCompleted(PageRequest.of(0, SPUIDefinitions.PAGE_SIZE, sort), true); } else { final DistributionSetFilter distributionSetFilter = new DistributionSetFilterBuilder().setIsDeleted(false) .setIsComplete(true).setSearchText(searchText).setSelectDSWithNoTag(noTagClicked) .setTagNames(distributionTags).build(); firstPageDistributionSets = getDistributionSetManagement().findByDistributionSetFilter( PageRequest.of(0, SPUIDefinitions.PAGE_SIZE, sort), distributionSetFilter); } final long size = firstPageDistributionSets.getTotalElements(); if (size > Integer.MAX_VALUE) { return Integer.MAX_VALUE; } return (int) size; }
.setIsComplete(true).setSearchText(searchText).setSelectDSWithNoTag(noTagClicked) .setTagNames(distributionTags).build(); distBeans = getDistributionSetManagement().findByDistributionSetFilter( new OffsetBasedPageRequest(startIndex, count, sort), distributionSetFilter);
.setIsComplete(true).setSearchText(searchText).setSelectDSWithNoTag(noTagClicked) .setTagNames(distributionTags).build(); distBeans = getDistributionSetManagement().findByDistributionSetFilter( new OffsetBasedPageRequest(startIndex, count, sort), distributionSetFilter);