Package com.google.gdata.data.appsforyourdomain.generic

Examples of com.google.gdata.data.appsforyourdomain.generic.GenericFeed


      GenericEntry entry = client.retrieveOutboundGatewaySettings();
      LOGGER.log(Level.INFO, "Outbound gateway settings" + entry.getAllProperties());
      client.updateOutboundGatewaySettings(AdminSettingsConstants.TEST_EMAIL_ROUTE,
          AdminSettingsConstants.TEST_SMTPMODE);

      GenericFeed feed = client.retrieveEmailRoutingSettings();
      List<GenericEntry> entries = feed.getEntries();
      for (GenericEntry genericEntry : entries) {
        LOGGER.log(Level.INFO, "Email Routing Settings" + genericEntry.getAllProperties());
        LOGGER.log(Level.INFO, "Email Routing Settings" + genericEntry.getId());
        // update settings
        LOGGER.log(Level.INFO, "Updating Routing Settings");
View Full Code Here


   */
  private List<GenericEntry> retrieveAllPages(URL feedUrl) throws IOException, ServiceException {
    List<GenericEntry> allEntries = new ArrayList<GenericEntry>();
    try {
      do {
        GenericFeed feed = service.getFeed(feedUrl, GenericFeed.class);
        allEntries.addAll(feed.getEntries());
        feedUrl = (feed.getNextLink() == null) ? null : new URL(feed.getNextLink().getHref());
      } while (feedUrl != null);
    } catch (ServiceException se) {
      AppsForYourDomainException ae = AppsForYourDomainException.narrow(se);
      throw (ae != null) ? ae : se;
    }
View Full Code Here

      OrgManagementSampleClient client =
          new OrgManagementSampleClient(adminEmail, adminPassword, domain, "org-api-sample-"
              + domain);

      GenericEntry entry = null;
      GenericFeed feed = null;

      entry = client.retrieveCustomerId(customerId);
      customerId = entry.getProperty("customerId");
      LOGGER.log(Level.INFO, "Retrieved Customer ID - " + customerId);
View Full Code Here

      service.createMailMonitor(user, monitor);

      // Retrieve all monitors for the user
      LOGGER.log(Level.INFO, "\n-------------retrieveMonitors-------------");
      LOGGER.log(Level.INFO, "\nRetrieving monitors for the user: " + user);
      GenericFeed feed = service.retrieveMonitors(user);

      for (GenericEntry entry : feed.getEntries()) {
        monitor = new MailMonitor(entry);
        LOGGER.log(Level.INFO, "Request Id: " + monitor.getRequestId());
        LOGGER.log(Level.INFO, "Destination User: " + monitor.getDestUserName());
        LOGGER.log(Level.INFO, "Monitor Begin Date: " + monitor.getBeginDate());
        LOGGER.log(Level.INFO, "Monitor End Date: " + monitor.getEndDate());
View Full Code Here

      String applicationName, String domain, String username, String password)
      throws AuthenticationException {
    super(applicationName, Constants.PROTOCOL, Constants.APPS_APIS_DOMAIN);
    this.domain = domain;

    new GenericFeed().declareExtensions(getExtensionProfile());

    this.setUserCredentials(username + "@" + domain, password);
  }
View Full Code Here

      throw new IllegalArgumentException();
    }

    logger.log(Level.INFO, "Getting send-as settings for user " + user + " ...");

    GenericFeed sendAsFeed = retrieveSettingsFeed(user, Constants.SEND_AS);
    if (sendAsFeed != null) {
      List<Map<String, String>> sendAs = new ArrayList<Map<String, String>>();

      List<GenericEntry> sendAsEntries = sendAsFeed.getEntries();
      for (GenericEntry sendAsEntry : sendAsEntries) {
        Map<String, String> sendAsMap = new HashMap<String, String>();
        sendAsMap.put(Constants.ADDRESS, sendAsEntry.getProperty(Constants.ADDRESS));
        sendAsMap.put(Constants.NAME, sendAsEntry.getProperty(Constants.NAME));
        sendAsMap.put(Constants.REPLY_TO, sendAsEntry.getProperty(Constants.REPLY_TO));
View Full Code Here

      throw new IllegalArgumentException();
    }

    logger.log(Level.INFO, "Getting mail labels for user " + user + " ...");

    GenericFeed labelsFeed = retrieveSettingsFeed(user, Constants.LABEL);
    if (labelsFeed != null) {
      List<Map<String, String>> labels = new ArrayList<Map<String, String>>();

      List<GenericEntry> labelEntries = labelsFeed.getEntries();
      for (GenericEntry labelEntry : labelEntries) {
        Map<String, String> labelMap = new HashMap<String, String>();
        labelMap.put(Constants.LABEL, labelEntry.getProperty(Constants.LABEL));
        labelMap.put(Constants.UNREAD_COUNT, labelEntry.getProperty(Constants.UNREAD_COUNT));
        labelMap.put(Constants.VISIBILITY, labelEntry.getProperty(Constants.VISIBILITY));
View Full Code Here

    if (isBlankOrNullString(user)) {
      throw new IllegalArgumentException();
    }

    logger.log(Level.INFO, "Getting email delegation settings for user " + user + " ...");
    GenericFeed delegatesFeed = retrieveSettingsFeed(user, Constants.DELEGATION);
    if (delegatesFeed != null) {
      List<Map<String, String>> delegates = new ArrayList<Map<String, String>>();

      List<GenericEntry> delegateEntries = delegatesFeed.getEntries();
      for (GenericEntry delegateEntry : delegateEntries) {
        Map<String, String> delegateMap = new HashMap<String, String>();
        delegateMap.put(
            Constants.DELEGATION_ID, delegateEntry.getProperty(Constants.DELEGATION_ID));
        delegateMap.put(Constants.DELEGATE, delegateEntry.getProperty(Constants.DELEGATE));
View Full Code Here

      GenericEntry resultEntry = insertGmailFilter(entry);
      LOGGER.log(Level.INFO, "Insert 1 filter succeeded.");

      LOGGER.log(Level.INFO, "Batch inserting " + ITEMS_TO_BATCH +
          " Gmail filters");
      GenericFeed resultFeed = batchInsertGmailFilters(entries);

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

   *         service.
   * @throws ServiceException if the insert request failed due to system error.
   */
  private GenericFeed batchInsertGmailFilters(GenericEntry ... filters)
      throws ServiceException, IOException {
    GenericFeed feed = new GenericFeed();
    for (int i = 0; i < filters.length; i++) {
      BatchUtils.setBatchId(filters[i], Integer.toString(i));
      feed.getEntries().add(filters[i]);
    }
    return gmailFilterService.batch(domain, feed);
  }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.appsforyourdomain.generic.GenericFeed

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.