Codota Logo
PageList.getTotalSize
Code IndexAdd Codota to your IDE (free)

How to use
getTotalSize
method
in
org.rhq.core.domain.util.PageList

Best Java code snippets using org.rhq.core.domain.util.PageList.getTotalSize (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: org.rhq/rhq-core-gui

/**
 * @see javax.faces.model.DataModel#getRowCount()
 */
@Override
public int getRowCount() {
  if (this.currentPage == null) {
    loadDataPage(this.defaultPageControl);
  }
  return this.currentPage.getTotalSize();
}
origin: org.rhq/rhq-core-gui

/**
 * Return the total number of rows of data available (not just the number of rows in the current page!).
 *
 * @return number of rows in the full dataset
 */
@Override
public int getRowCount() {
  return getCurrentPage().getTotalSize();
}
origin: org.rhq/rhq-core-gui

/**
 * Return <code>true</code> if the {@link #getRowIndex()} value is currently set to a value that matches some
 * element in the dataset. Note that it may match a row that is not in the currently cached PageList; if so then
 * when {@link #getRowData()} is called the required PageList will be fetched by calling
 * {@link #getDataPage()}.
 *
 * @return <code>true</code> if the row is available
 */
@Override
public boolean isRowAvailable() {
  getCurrentPage();
  return (this.pageList != null &&
      this.currentRowIndex >= 0 &&
      this.currentRowIndex < pageList.getTotalSize());
}
origin: org.rhq/rhq-core-domain

/**
 * If you can a {@link PageList} that is inconsistent with this page control object, it is recommended you try
 * calling the method you obtained the page list from again. Maybe the database have "settled down" from the
 * activity that caused that inconsistency.
 * <p/>
 * This is a convenience function that is equivalent to calling:
 * <p>
 * <code>isConsistentWith(pageList, pageList.getTotalSize())</code>
 * </p>
 *
 * @see #isConsistentWith(java.util.Collection, int)
 *
 * @param pageList the page list to check the consistency with this page control
 * @return true if the page list is consistent, false otherwise.
 */
public boolean isConsistentWith(PageList<?> pageList) {
  return isConsistentWith(pageList, pageList.getTotalSize());
}
origin: org.rhq/rhq-enterprise-server

public PhantomReadMaxAttemptsExceededException(int numberOfAttempts, PageList<?> list,
  long millisecondsSpentTrying) {
  super(initMessage(numberOfAttempts, list.size(), list.getTotalSize(), millisecondsSpentTrying));
  this.numberOfAttempts = numberOfAttempts;
  this.list = list;
  this.millisecondsSpentTrying = millisecondsSpentTrying;
}
origin: org.rhq/rhq-enterprise-server

public PhantomReadMaxAttemptsExceededException(int numberOfAttempts, PageList<?> list,
  long millisecondsSpentTrying, Throwable cause) {
  super(initMessage(numberOfAttempts, list.size(), list.getTotalSize(), millisecondsSpentTrying), cause);
  this.numberOfAttempts = numberOfAttempts;
  this.list = list;
  this.millisecondsSpentTrying = millisecondsSpentTrying;
}
origin: org.rhq/rhq-enterprise-server

if (results.getTotalSize() <= maxResources) {
  return results;
origin: org.rhq/rhq-enterprise-server

criteria.setRestriction(Criteria.Restriction.COUNT_ONLY);
PageList<Resource> resList = resourceManager.findResourcesByCriteria(caller,criteria);
result.put("PlatformCount",String.valueOf(resList.getTotalSize()));
criteria = new ResourceCriteria();
criteria.addFilterResourceCategories(ResourceCategory.SERVER);
criteria.setRestriction(Criteria.Restriction.COUNT_ONLY);
resList = resourceManager.findResourcesByCriteria(caller,criteria);
result.put("ServerCount",String.valueOf(resList.getTotalSize()));
criteria = new ResourceCriteria();
criteria.addFilterResourceCategories(ResourceCategory.SERVICE);
criteria.setRestriction(Criteria.Restriction.COUNT_ONLY);
resList = resourceManager.findResourcesByCriteria(caller,criteria);
result.put("ServiceCount",String.valueOf(resList.getTotalSize()));
result.put("AlertCount",String.valueOf(alertList.getTotalSize()));
result.put("AlertDefinitionCount",String.valueOf(defList.getTotalSize()));
origin: org.rhq/rhq-enterprise-server

      + CriteriaUtil.toString(criteria) + ". After " + e.getNumberOfAttempts()
      + " attempts, the collection size" + " is " + e.getList().size()
      + ", while the count query reports " + e.getList().getTotalSize() + " for " + pageControl
      + ". The discrepancy has not cleared up in " + e.getMillisecondsSpentTrying()
      + "ms so we're giving up, "
if (LOG.isDebugEnabled()) {
  LOG.debug("restriction=" + criteriaRestriction + ", resultSize=" + results.size() + ", resultCount="
    + results.getTotalSize());
results = new PageList<T>(getCount(), pageControl);
if (LOG.isDebugEnabled()) {
  LOG.debug("restriction=" + criteriaRestriction + ", resultCount=" + results.getTotalSize());
origin: org.rhq/rhq-enterprise-server

int page = pc.getPageNumber();
if (resultList.getTotalSize()> (pc.getPageNumber() +1 ) * pc.getPageSize()) {
  int nextPage = page+1;
  int lastPage = (resultList.getTotalSize() / pc.getPageSize() ) -1;
builder.header("X-collection-size",resultList.getTotalSize());
origin: org.rhq/rhq-enterprise-server

@Override
public PageList<Resource> findGroupMemberCandidateResources(Subject subject, ResourceCriteria criteria,
  int[] alreadySelectedResourceIds) {
  PageControl originalPageControl = getPageControl(criteria);
  if (originalPageControl.isUnlimited()) {
    throw new UnsupportedOperationException("Supplied criteria has an unlimited PageControl");
  }
  Set<Integer> alreadySelectedResourceIdSet = new HashSet<Integer>(
    ArrayUtils.wrapInList(alreadySelectedResourceIds == null ? new int[0] : alreadySelectedResourceIds));
  PageControl pageControl = (PageControl) originalPageControl.clone();
  criteria.setPageControl(pageControl);
  int requiredPageSize = pageControl.getPageSize();
  criteria.setRestriction(COUNT_ONLY);
  int totalSize = findResourcesByCriteria(subject, criteria).getTotalSize();
  int totalPages = (totalSize / requiredPageSize) + (((totalSize % requiredPageSize) > 0) ? 1 : 0);
  criteria.setRestriction(COLLECTION_ONLY);
  List<Resource> candidates = new LinkedList<Resource>();
  for (int pageNumber = 0; candidates.size() < requiredPageSize && pageNumber < totalPages; pageNumber++) {
    pageControl.setPageNumber(pageNumber);
    PageList<Resource> foundResources = findResourcesByCriteria(subject, criteria);
    Collection<Resource> filteredResources = filterOutAlreadySelectedResources(foundResources,
      alreadySelectedResourceIdSet);
    candidates.addAll(filteredResources);
  }
  if (candidates.size() > requiredPageSize) {
    candidates = candidates.subList(0, requiredPageSize);
  }
  return new PageList<Resource>(candidates, totalSize, originalPageControl);
}
origin: org.rhq/rhq-enterprise-server

if (rowsProcessed >= alertConditions.getTotalSize()) {
  break; // we've processed all data, we can stop now
origin: org.rhq/rhq-enterprise-server

if (rowsProcessed >= alertConditions.getTotalSize()) {
  break; // we've processed all data, we can stop now
origin: org.rhq/rhq-enterprise-server

if (results != null && processResults(next, results.getTotalSize())) {
  updated++;
origin: org.rhq/rhq-enterprise-server

pColl.setTotalSize(originalList.getTotalSize());
PageControl pageControl = originalList.getPageControl();
pColl.setPageSize(pageControl.getPageSize());
int page = pageControl.getPageNumber();
pColl.setCurrentPage(page);
int lastPage = (originalList.getTotalSize() / pageControl.getPageSize()) -1 ; // -1 as page # is 0 based
pColl.setLastPage(lastPage);
if (originalList.getTotalSize() > (page +1 ) * pageControl.getPageSize()) {
  int nextPage = page +1;
origin: org.rhq/rhq-enterprise-server

@GET
@Path("count")
@ApiOperation("Return a count of alerts in the system depending on criteria")
public IntegerValue countAlerts(@ApiParam(value = "If non-null only send alerts that have fired after this time, time is millisecond since epoch")
          @QueryParam("since") Long since) {
  AlertCriteria criteria = new AlertCriteria();
  criteria.setPageControl(PageControl.getUnlimitedInstance());
  criteria.fetchAlertDefinition(false);
  criteria.fetchConditionLogs(false);
  criteria.fetchRecoveryAlertDefinition(false);
  criteria.fetchNotificationLogs(false);
  criteria.setRestriction(Criteria.Restriction.COUNT_ONLY);
  if (since!=null) {
    criteria.addFilterStartTime(since);
  }
  PageList<Alert> alerts = alertManager.findAlertsByCriteria(caller,criteria);
  int count = alerts.getTotalSize();
  return new IntegerValue(count);
}
origin: org.rhq/rhq-enterprise-server

@Override
public PageList<PackageAndLatestVersionComposite> findPackagesWithLatestVersion(Subject subject,
  PackageCriteria criteria) {
  if (criteria.getFilterRepoId() == null) {
    throw new IllegalArgumentException("The criteria query has to have a filter for a specific repo.");
  }
  criteria.fetchVersions(true);
  PageList<Package> packages = findPackagesByCriteria(subject, criteria);
  PageList<PackageAndLatestVersionComposite> ret = new PageList<PackageAndLatestVersionComposite>(
    packages.getTotalSize(), packages.getPageControl());
  for (Package p : packages) {
    PackageVersion latest = repoManager.getLatestPackageVersion(subject, p.getId(), criteria.getFilterRepoId());
    ret.add(new PackageAndLatestVersionComposite(p, latest));
  }
  return ret;
}
origin: org.rhq/rhq-enterprise-server

if (bundles.getTotalSize() == 0) {
  bundle = createBundle(subject, bundleName, bundleDescription, bundleTypeId, bundleGroupIds);
} else {
origin: org.rhq/rhq-enterprise-server

private int getResourceTypeCount(Plugin plugin) {
  // this will get all types, even those deleted and ignored
  ResourceTypeCriteria criteria = new ResourceTypeCriteria();
  criteria.addFilterPluginName(plugin.getName());
  criteria.setRestriction(Criteria.Restriction.COUNT_ONLY);
  criteria.addFilterDeleted(null);
  criteria.addFilterIgnored(null);
  criteria.setStrict(true);
  PageList<ResourceType> types = resourceTypeMgr.findResourceTypesByCriteria(subjectMgr.getOverlord(), criteria);
  return types.getTotalSize();
}
origin: org.rhq/rhq-enterprise-server

private int getResourceCount(EntityContext context) {
  if (context.type == EntityContext.Type.Resource) {
    return 1;
  } else if (context.type == EntityContext.Type.ResourceGroup) {
    return resourceGroupManager.getExplicitGroupMemberCount(context.groupId);
  } else if (context.type == EntityContext.Type.AutoGroup) {
    ResourceCriteria criteria = new ResourceCriteria();
    criteria.addFilterParentResourceId(context.parentResourceId);
    criteria.addFilterResourceTypeId(context.resourceTypeId);
    criteria.setPageControl(PageControl.getSingleRowInstance()); // get one record, then extract totalSize
    PageList<Resource> results = resourceManager
      .findResourcesByCriteria(subjectManager.getOverlord(), criteria);
    return results.getTotalSize();
  }
  return 0;
}
org.rhq.core.domain.utilPageListgetTotalSize

Javadoc

Returns the total size of the "master list" that this page is a subset of.

Note: This method merely returns the size of this list if it is #isUnbounded().

Popular methods of PageList

  • size
  • <init>
    Using this constructor one obtains a PageList instance that contains no data but it has an associate
  • get
  • addAll
  • clear
  • getPageControl
  • isEmpty
  • add
  • contains
  • containsAll
  • indexOf
  • iterator
  • indexOf,
  • iterator,
  • remove,
  • setTotalSize

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • ImageIO (javax.imageio)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now