Package com.puzzlebazar.shared.model

Examples of com.puzzlebazar.shared.model.UserImpl


   * @param key The key for the user to get.
   * @return The {@link User} obtained from the datastore, or {@code null} if none found.
   */
  public User getUser(Key<UserImpl> key) {

    UserImpl user = null;
    try {
      user = ofy().get(key);
    } catch (NotFoundException e) {
      user = null;
    }
View Full Code Here


    // TODO Validate that the current user has the required privileges!
    long userId = updatedUser.getId();

    Objectify ofyTxn = newOfyTransaction();
    try {
      UserImpl user = ofyTxn.get(UserImpl.class, userId);
      user.editFrom(updatedUser);
      ofyTxn.put(user);
      ofyTxn.getTxn().commit();
    } catch (NotFoundException e) {
      throw new ObjectNotFoundException("User not found, can't modify. Id = " + userId);
    } finally {
View Full Code Here

      return null;
    }

    Objectify ofyTxn = newOfyTransaction();

    UserImpl user = null;
    int retry = 0;
    while (user == null && retry < MAX_RETRIES) {
      try {
        EmailToUser emailToUser = ofyTxn.get(EmailToUser.class, emailQuery);
        ofyTxn.getTxn().commit();
        user = ofy().get(emailToUser.getUserKey());
      } catch (NotFoundException e) {
        user = new UserImpl(emailQuery);
        user.setLocale(locale);
        ofy().put(user);
        EmailToUser emailToUser = new EmailToUser(emailQuery, user.createKey());
        ofyTxn.put(emailToUser);
        ofyTxn.getTxn().commit();
      } finally {
        if (ofyTxn.getTxn().isActive()) {
          ofyTxn.getTxn().rollback();
View Full Code Here

TOP

Related Classes of com.puzzlebazar.shared.model.UserImpl

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.