Package com.google.gdata.data.batch

Examples of com.google.gdata.data.batch.BatchStatus


    boolean isSuccess = true;
    for (CalendarEventEntry entry : batchResponse.getEntries()) {
      String batchId = BatchUtils.getBatchId(entry);
      if (!BatchUtils.isSuccess(entry)) {
        isSuccess = false;
        BatchStatus status = BatchUtils.getBatchStatus(entry);
        log.warning("\n" + batchId + " failed (" + status.getReason() + ") " + status.getContent());
      }
    }
    if (isSuccess) {
      log.info("Successfully executed all events via batch request.");
    }
View Full Code Here


      boolean isSuccess = true;
      for (CellEntry entry : batchResponse.getEntries()) {
        String batchId = BatchUtils.getBatchId(entry);
        if (!BatchUtils.isSuccess(entry)) {
          isSuccess = false;
          BatchStatus status = BatchUtils.getBatchStatus(entry);
          log.warning("\n" + batchId + " failed (" + status.getReason() + ") " + status.getContent());
        }
      }
      if (isSuccess) {
        log.info("Successfully executed all events via batch request.");
      }
View Full Code Here

                    CellFeed batchResponse = service.batch(new URL(batchLink.getHref()), batchRequest);
                   
                    for (CellEntry entry : batchResponse.getEntries()) {
                      String batchId = BatchUtils.getBatchId(entry);
                      if (!BatchUtils.isSuccess(entry)) {
                        BatchStatus status = BatchUtils.getBatchStatus(entry);
                        logger.warn(
                            String.format(
                                "Error: %s failed (%s) %s\n",
                                batchId, status.getReason(), status.getContent()));
                        break;
                      }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
View Full Code Here

            .getName();
        System.out.println("The " + operation + " worked!");
      } else {
        System.out.println("Operation " + BatchUtils.getBatchId(entry)
            + "failed!");
        BatchStatus status = BatchUtils.getBatchStatus(entry);
        System.out.println(status.getCode() + " - "
            + status.getContent());
      }
    }
  }
View Full Code Here

    boolean isSuccess = true;
    for (CalendarEventEntry entry : batchResponse.getEntries()) {
      String batchId = BatchUtils.getBatchId(entry);
      if (!BatchUtils.isSuccess(entry)) {
        isSuccess = false;
        BatchStatus status = BatchUtils.getBatchStatus(entry);
        System.out.println("\n" + batchId + " failed (" + status.getReason()
            + ") " + status.getContent());
      }
    }
    if (isSuccess) {
      System.out.println("Successfully deleted all events via batch request.");
    }
View Full Code Here

      BatchResult result = manager.unshareProfiles();

      System.out.println("Success: " + result.getSuccess() + " - Error: " + result.getError());
      for (ContactEntry entry : result.getErrorEntries()) {
        BatchStatus status = BatchUtils.getBatchStatus(entry);

        System.out.println(" > Failed to update " + entry.getId() + ": (" + status.getCode() + ") "
            + status.getReason());
      }
    }
  }
View Full Code Here

            myService.batch(new URL("https://www.google.com/m8/feeds/profiles/domain/"
                + this.domain + "/full/batch?xoauth_requestor_id=" + this.adminEmail), requestFeed);

        // Check the status of each operation.
        for (ContactEntry entry : responseFeed.getEntries()) {
          BatchStatus batchStatus = BatchUtils.getBatchStatus(entry);

          if (batchStatus.getCode() == 200) {
            result.setSuccess(result.getSuccess() + 1);
          } else {
            result.setError(result.getError() + 1);
            result.addErrorEntry(entry);
          }
View Full Code Here

      // Check for failure in the returned entries.
      int failedInsertions = 0, successfulInsertions = 0;
      for (MailItemEntry returnedEntry : feed.getEntries()) {
        if (BatchUtils.isFailure(returnedEntry)) {
          BatchStatus status = BatchUtils.getBatchStatus(returnedEntry);
          LOGGER.log(Level.SEVERE, "Entry "
              + BatchUtils.getBatchId(returnedEntry) + " failed insertion: "
              + status.getCode() + " " + status.getReason());
          failedInsertions++;
        } else {
          successfulInsertions++;
        }
      }
View Full Code Here

      // Check for failure in the returned entries.
      int failedInsertions = 0, successfulInsertions = 0;
      for (GenericEntry returnedEntry : resultFeed.getEntries()) {
        if (BatchUtils.isFailure(returnedEntry)) {
          BatchStatus status = BatchUtils.getBatchStatus(returnedEntry);
          LOGGER.log(Level.SEVERE, "Entry "
              + BatchUtils.getBatchId(returnedEntry) + " failed insertion: "
              + status.getCode() + " " + status.getReason());
          failedInsertions++;
        } else {
          successfulInsertions++;
        }
      }
View Full Code Here

      CellFeed batchResultFeed = spreadsheetService.batch(new URL(batchLink.getHref()), batchFeed);
      // Make sure all the operations were successful.
      for (CellEntry entry : batchResultFeed.getEntries()) {
        if (!BatchUtils.isSuccess(entry)) {
          String batchId = BatchUtils.getBatchId(entry);
          BatchStatus status = BatchUtils.getBatchStatus(entry);
          System.err.println("Failed entry");
          System.err.println("\t" + batchId + " failed (" + status.getReason() + ") ");
          return;
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.batch.BatchStatus

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.