Examples of UserEntry


Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

    } catch (MalformedURLException murle) {
      LOGGER.info(murle.toString());
      return BAD_DOMAIN_MSG;
    }
   
    UserEntry userEntry = null;
    try {
      userEntry = (UserEntry) service.getEntry(url, UserEntry.class);
    } catch (ServiceException se) {
      LOGGER.info(se.toString());
      return FAILED_CONTACTING_SERVICE_MSG;
    } catch (IOException ioe) {
      LOGGER.info(ioe.toString());
      return FAILED_CONTACTING_SERVICE_MSG;
    }
 
    if (userEntry.getLogin().getAdmin().booleanValue() == false) {
      LOGGER.info("Given user is not an admin.");
      return MUST_BE_ADMIN_MSG;
    }
   
    return null;
View Full Code Here

Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

      if (userList == null) {
        throw new NotModifiedException();
      } else {
        List entryList = new LinkedList();
        for (Iterator iter = userList.iterator(); iter.hasNext(); ) {
          UserEntry userEntry = new UserEntry();
          Login login = new Login();
          login.setUserName((String) iter.next());
          userEntry.addExtension(login);
          entryList.add(userEntry);
        }
        UserFeed userFeed = new UserFeed();
        userFeed.getEntries().addAll(entryList);
        return userFeed;
View Full Code Here

Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

        }
      }
     
      public BaseEntry getEntry(URL url, Class klass) {
        if (url.toString().endsWith("admin")) {
          return new UserEntry() {
            public Login getLogin() {
              Login login = new Login();
              login.setAdmin(Boolean.TRUE);
              return login;
            }
          };
        } else {
          return new UserEntry() {
            public Login getLogin() {
              Login login = new Login();
              login.setAdmin(Boolean.FALSE);
              return login;
            }
View Full Code Here

Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

    String ownerUserName = "jane.doe." + randomFactor;
    String ownerFirstName = "Jane";
    String ownerLastName = "Doe";
    String ownerPassword = "123$$$abc";

    UserEntry createdUserEntry =
        createUser(username, givenName, familyName, password);

    // Update the user's family name.
    String newFamilyName = "Smith";
    createdUserEntry.getName().setFamilyName(newFamilyName);
    UserEntry updatedUserEntry = updateUser(username, createdUserEntry);

    // Create a nickname for the user.
    String nickname0 = "Susy-" + randomFactor;
    NicknameEntry createdNicknameEntry0 = createNickname(username, nickname0);
View Full Code Here

Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

            ? "' Hash Function: '" + passwordHashFunction : "") +
        (quotaLimitInMb != null
            ? "' Quota Limit: '" + quotaLimitInMb + "'." : "'.")
        );

    UserEntry entry = new UserEntry();
    Login login = new Login();
    login.setUserName(username);
    login.setPassword(password);
    if (passwordHashFunction != null) {
      login.setHashFunctionName(passwordHashFunction);
    }
    entry.addExtension(login);

    Name name = new Name();
    name.setGivenName(givenName);
    name.setFamilyName(familyName);
    entry.addExtension(name);

    if (quotaLimitInMb != null) {
      Quota quota = new Quota();
      quota.setLimit(quotaLimitInMb);
      entry.addExtension(quota);
    }

    URL insertUrl = new URL(domainUrlBase + "user/" + SERVICE_VERSION );
    return userService.insert(insertUrl, entry);
  }
View Full Code Here

Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

      throws AppsForYourDomainException, ServiceException, IOException {

    LOGGER.log(Level.INFO, "Suspending user '" + username + "'.");

    URL retrieveUrl = new URL(domainUrlBase + "user/" + SERVICE_VERSION + "/" + username);
    UserEntry userEntry = userService.getEntry(retrieveUrl, UserEntry.class);
    userEntry.getLogin().setSuspended(true);

    URL updateUrl = new URL(domainUrlBase + "user/" + SERVICE_VERSION + "/" + username);
    return userService.update(updateUrl, userEntry);
  }
View Full Code Here

Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

      throws AppsForYourDomainException, ServiceException, IOException {

    LOGGER.log(Level.INFO, "Restoring user '" + username + "'.");

    URL retrieveUrl = new URL(domainUrlBase + "user/" + SERVICE_VERSION + "/" + username);
    UserEntry userEntry = userService.getEntry(retrieveUrl, UserEntry.class);
    userEntry.getLogin().setSuspended(false);

    URL updateUrl = new URL(domainUrlBase + "user/" + SERVICE_VERSION + "/" + username);
    return userService.update(updateUrl, userEntry);
  }
View Full Code Here

Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

      throws AppsForYourDomainException, ServiceException, IOException {

    LOGGER.log(Level.INFO, "Setting admin privileges for user '" + username + "'.");

    URL retrieveUrl = new URL(domainUrlBase + "user/" + SERVICE_VERSION + "/" + username);
    UserEntry userEntry = userService.getEntry(retrieveUrl, UserEntry.class);
    userEntry.getLogin().setAdmin(true);

    URL updateUrl = new URL(domainUrlBase + "user/" + SERVICE_VERSION + "/" + username);
    return userService.update(updateUrl, userEntry);
  }
View Full Code Here

Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

      throws AppsForYourDomainException, ServiceException, IOException {

    LOGGER.log(Level.INFO, "Removing admin privileges for user '" + username + "'.");

    URL retrieveUrl = new URL(domainUrlBase + "user/" + SERVICE_VERSION + "/" + username);
    UserEntry userEntry = userService.getEntry(retrieveUrl, UserEntry.class);
    userEntry.getLogin().setAdmin(false);

    URL updateUrl = new URL(domainUrlBase + "user/" + SERVICE_VERSION + "/" + username);
    return userService.update(updateUrl, userEntry);
  }
View Full Code Here

Examples of com.google.gdata.data.appsforyourdomain.provisioning.UserEntry

    LOGGER.log(Level.INFO, "Requiring " + username + " to change password at " +
        "next login.");

    URL retrieveUrl = new URL(domainUrlBase + "user/"
        + SERVICE_VERSION + "/" + username);
    UserEntry userEntry = userService.getEntry(retrieveUrl, UserEntry.class);
    userEntry.getLogin().setChangePasswordAtNextLogin(true);

    URL updateUrl = new URL(domainUrlBase + "user/"
        + SERVICE_VERSION + "/" + username);
    return userService.update(updateUrl, userEntry);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.