Package com.puppetlabs.geppetto.forge.v3

Examples of com.puppetlabs.geppetto.forge.v3.NullProgressMonitor


   */
  @Override
  public void accept(Query<T> query, SortBy<T> sortBy, boolean includeDeleted, Visitor<T> visitor,
      ProgressMonitor progressMonitor) throws IOException, InvocationTargetException {
    if(progressMonitor == null)
      progressMonitor = new NullProgressMonitor();

    currentMonitor = progressMonitor;
    try {
      PaginatedResult<T> page = list(query, sortBy, null, includeDeleted);
      progressMonitor.beginTask(page.getTotal());
View Full Code Here


    return client.get(getEndpointSegment(), params, getPaginatedResultType());
  }

  @Override
  public List<T> listAll(Query<T> query, SortBy<T> sortBy, boolean includeDeleted) throws IOException {
    ProgressMonitor monitor = new NullProgressMonitor();
    currentMonitor = monitor;
    try {
      PaginatedResult<T> page = list(query, sortBy, null, includeDeleted);
      monitor.beginTask(page.getTotal());

      int total = page.getTotal();
      if(total == 0)
        return Collections.emptyList();
View Full Code Here

    currentMonitor = progressMonitor;
    try {
      PaginatedResult<T> page = list(query, sortBy, null, includeDeleted);
      progressMonitor.beginTask(page.getTotal());

      PaginationInfo pi = visitPage(page, visitor, progressMonitor);
      while(pi != null)
        pi = visitPage(list(query, sortBy, pi, includeDeleted), visitor, progressMonitor);

      if(!progressMonitor.isCanceled())
        progressMonitor.endTask();
View Full Code Here

          result.add(entity);
        }
      };

      try {
        PaginationInfo pi = visitPage(page, visitor, monitor);
        while(pi != null)
          pi = visitPage(list(query, sortBy, pi, includeDeleted), visitor, monitor);
      }
      catch(InvocationTargetException e) {
        // The visitor never throws that
View Full Code Here

  }

  protected void testList(ForgeService.Compare<T> query) throws IOException {
    PaginatedResult<T> result = getService().list(query, null, null, false);
    assertNotNull("Null result", result);
    PaginationInfo nxt = result.getNext();
    assertNotNull("Null pagination for next page", nxt);
    List<T> entries = result.getResults();
    assertNotNull("Null result list", entries);
    assertFalse("Empty list", entries.isEmpty());
View Full Code Here

    if(left <= 0)
      return null;
    if(limit > left)
      limit = left;

    return new PaginationInfo(last, limit);
  }
View Full Code Here

      return null;
    int limit = pagination.getLimit();
    if(limit > offset)
      limit = offset;
    offset -= limit;
    return new PaginationInfo(offset - limit, limit);
  }
View Full Code Here

  private ProgressMonitor currentMonitor;

  @Override
  public void abortCurrentRequest() {
    ProgressMonitor monitor = currentMonitor;
    if(monitor != null)
      monitor.cancel();
    client.abortCurrentRequest();
  }
View Full Code Here

    return client.get(getEndpointSegment(), params, getPaginatedResultType());
  }

  @Override
  public List<T> listAll(Query<T> query, SortBy<T> sortBy, boolean includeDeleted) throws IOException {
    ProgressMonitor monitor = new NullProgressMonitor();
    currentMonitor = monitor;
    try {
      PaginatedResult<T> page = list(query, sortBy, null, includeDeleted);
      monitor.beginTask(page.getTotal());

      int total = page.getTotal();
      if(total == 0)
        return Collections.emptyList();
View Full Code Here

  @Override
  protected void configure() {
    bind(ForgeClient.class).to(ForgeHttpClient.class);
    install(new V1Module());
    install(new V2Module());
    install(new V3Module());
    bind(MetadataRepository.class).to(MetadataRepositoryImpl.class);
  }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.forge.v3.NullProgressMonitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.