Package com.google.gdata.data.appsforyourdomain.migration

Examples of com.google.gdata.data.appsforyourdomain.migration.MailItemFeed


    // Send several emails in a batch.
    LOGGER.log(Level.INFO, "Inserting " + Integer.toString(ITEMS_TO_BATCH)
        + " mail items in a batch.");
    try {
      MailItemFeed feed = batchInsertMailItems(entries);

      // 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());
View Full Code Here


  private MailItemFeed batchInsertMailItems(MailItemEntry ... mailItems)
      throws ServiceException, IOException {
    LOGGER.log(Level.INFO, "Batch inserting " + Integer.toString(
        mailItems.length) + " mailItems");
   
    MailItemFeed feed = new MailItemFeed();
    for (int i = 0; i < mailItems.length; i++) {
      BatchUtils.setBatchId(mailItems[i], Integer.toString(i));
      feed.getEntries().add(mailItems[i]);
    }
   
    return mailItemService.batch(domain, destinationUser, feed);
  }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.appsforyourdomain.migration.MailItemFeed

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.