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

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


  /*
   * convert an AccountInfo instance into a GenericEntry instance
   */
  public GenericEntry toGenericEntry() {
    GenericEntry entry = new GenericEntry();
    entry.addProperty("requestId", requestId);
    if (completedDate != null) {
      entry.addProperty("completedDate", DATE_FORMAT.format(completedDate));
    }
    if (requestDate != null) {
      entry.addProperty("beginDate", DATE_FORMAT.format(requestDate));
    }
    if (numberOfFiles != 0) {
      entry.addProperty("numberOfFiles", String.valueOf(numberOfFiles));
    }
    entry.addProperty("userEmailAddress", userEmailAddress);
    entry.addProperty("adminEmailAddress", adminEmailAddress);
    entry.addProperty("status", status);
    return entry;
  }
View Full Code Here


   */
  public boolean doesEntityExist(String feedUrlSuffix)
      throws AppsForYourDomainException, MalformedURLException, IOException,
      ServiceException {
    try {
      GenericEntry entry = getEntry(new URL(baseDomainUrl + feedUrlSuffix),
          GenericEntry.class);
      return (entry.getAllProperties().size() > 0);
    } catch (AppsForYourDomainException e) {
      if (e.getErrorCode() == AppsForYourDomainErrorCode.EntityDoesNotExist) {
        return false;
      } else {
        throw e;
View Full Code Here

  public GenericEntry createGroup(String groupId, String groupName,
      String groupDescription, String emailPermission)
      throws AppsForYourDomainException, MalformedURLException, IOException,
      ServiceException {

    GenericEntry entry = new GenericEntry();
    entry.addProperty(APPS_PROP_GROUP_ID, groupId);
    entry.addProperty(APPS_PROP_GROUP_NAME, groupName);
    entry.addProperty(APPS_PROP_GROUP_DESC, groupDescription);
    entry.addProperty(APPS_PROP_GROUP_PERMISSION, emailPermission);
    return insert(new URL(baseDomainUrl), entry);
  }
View Full Code Here

   */
  public GenericEntry updateGroup(String groupId, String groupName,
      String groupDescription, String emailPermission)
      throws AppsForYourDomainException, MalformedURLException, IOException,
      ServiceException {
    GenericEntry entry = new GenericEntry();
    if (!(groupName == null || groupName.equals(""))) {
      entry.addProperty(APPS_PROP_GROUP_NAME, groupName);
    }
    if (!(groupDescription == null || groupDescription.equals(""))) {
      entry.addProperty(APPS_PROP_GROUP_DESC, groupDescription);
    }
    if (!(emailPermission == null || emailPermission.equals(""))) {
      entry.addProperty(APPS_PROP_GROUP_PERMISSION, emailPermission);
    }
    if (entry.getAllProperties().size() == 0) {
      // All null or empty values. Nothing will be updated.
      return retrieveGroup(groupId);
    }
    return update(new URL(baseDomainUrl + groupId), entry);
  }
View Full Code Here

   * @throws ServiceException If the API service fails
   */
  public GenericEntry addMemberToGroup(String groupId, String memberName)
      throws AppsForYourDomainException, MalformedURLException, IOException,
      ServiceException {
    GenericEntry entry = new GenericEntry();
    entry.addProperty(APPS_PROP_GROUP_MEMBER_ID, memberName);
    return insert(new URL(baseDomainUrl + groupId + "/member"), entry);
  }
View Full Code Here

   * @throws ServiceException If the API service fails
   */
  public GenericEntry addOwnerToGroup(String groupId, String ownerName)
      throws AppsForYourDomainException, MalformedURLException, IOException,
      ServiceException {
    GenericEntry entry = new GenericEntry();
    entry.addProperty("email", ownerName);
    return insert(new URL(baseDomainUrl + groupId + "/owner"), entry);
  }
View Full Code Here

   * @throws IOException
   * @throws ServiceException
   */
  public GenericEntry retrieveCustomerId(String domain) throws AppsForYourDomainException,
      MalformedURLException, IOException, ServiceException {
    GenericEntry entry =
        service.getEntry(new URL("https://apps-apis.google.com/a/feeds/customer/2.0/customerId"),
            GenericEntry.class);
    return entry;
  }
View Full Code Here

   * @throws ServiceException
   */
  public GenericEntry createOrganizationUnit(String customerId, String orgUnitName,
      String parentOrgUnitPath, String description, boolean blockInheritance)
      throws AppsForYourDomainException, MalformedURLException, IOException, ServiceException {
    GenericEntry entry = new GenericEntry();
    entry.addProperty("parentOrgUnitPath", parentOrgUnitPath);
    entry.addProperty("description", description);
    entry.addProperty("name", orgUnitName);
    entry.addProperty("blockInheritance", String.valueOf(blockInheritance));
    entry =
        service.insert(new URL("https://apps-apis.google.com/a/feeds/orgunit/2.0/" + customerId),
            entry);
    return entry;
  }
View Full Code Here

   * @throws IOException
   * @throws ServiceException
   */
  public GenericEntry retrieveOrganizationUnit(String customerId, String orgUnitPath)
      throws AppsForYourDomainException, MalformedURLException, IOException, ServiceException {
    GenericEntry entry =
        service.getEntry(new URL("https://apps-apis.google.com/a/feeds/orgunit/2.0/" + customerId
            + "/" + orgUnitPath), GenericEntry.class);
    return entry;

  }
View Full Code Here

   * @throws ServiceException
   */
  public GenericEntry updateOrganizationUnit(String customerId, String orgUnitPath,
      Map<OrgUnitProperty, String> attributes) throws AppsForYourDomainException,
      MalformedURLException, IOException, ServiceException {
    GenericEntry entry = new GenericEntry();
    for (Map.Entry<OrgUnitProperty, String> mapEntry : attributes.entrySet()) {
      String value = mapEntry.getValue();
      if (value == null || value.length() == 0) {
        continue;
      }
      switch (mapEntry.getKey()) {
        case NAME:
          entry.addProperty("name", value);
          break;
        case PARENT_ORG_UNIT_PATH:
          entry.addProperty("parentUnitPath", value);
          break;
        case DESCRIPTION:
          entry.addProperty("description", value);
          break;
        case BLOCK_INHERTANCE:
          entry.addProperty("blockInheritance", value);
          break;
        case USERS_TO_MOVE:
          entry.addProperty("usersToMove", value);
          break;
        default:
          break;
      }
    }
View Full Code Here

TOP

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

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.