Package org.jboss.errai.demo.todo.shared

Examples of org.jboss.errai.demo.todo.shared.TodoListUser


    //if this was the real world we would sent a mail to the user that this todo list was just shared with him.
    //but this is _only_ a demo.

    final TypedQuery<TodoListUser> query = entityManager.createNamedQuery("userByEmail", TodoListUser.class);
    query.setParameter("email", email);
    TodoListUser user;
    try {
      user = query.getSingleResult();
    } catch (NoResultException exception) {
      throw new UnknownUserException("user with email '" + email + "' is not a registered user");
    }
View Full Code Here


      throw new AuthenticationException("An error occurred during authentication.", ex);
    }

    if (result == Identity.AuthenticationResult.SUCCESS) {
      final User picketLinkUser = (User) identity.getAccount();
      final TodoListUser todoListUser = lookupTodoListUser(picketLinkUser.getEmail());

      return todoListUser;
    }
    else {
      throw new FailedAuthenticationException();
View Full Code Here

      return org.jboss.errai.security.shared.api.identity.User.ANONYMOUS;
    }
  }
 
  private TodoListUser lookupTodoListUser(String email) {
      final TodoListUser todoListUser = entityManager
              .createNamedQuery("userByEmail", TodoListUser.class)
              .setParameter("email", email)
              .getSingleResult();

      return todoListUser;
View Full Code Here

    this.loginName = user.getLoginName();
    this.password = password;
  }

  public TodoListUser asUser() {
    TodoListUser user = new TodoListUser();
    user.setEmail(email);
    user.setFullName(fullName);
    user.setShortName(shortName);
    user.setLoginName(loginName);
    return user;
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.demo.todo.shared.TodoListUser

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.