Package gfriends.client.model

Examples of gfriends.client.model.LoginInfo


    PersistenceManager pm = null;

    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    LoginInfo loginInfo = new LoginInfo();

    try {

      if (user != null) {
        loginInfo.setLoggedIn(true);
        loginInfo.setEmailAddress(user.getEmail());
        loginInfo.setNickname(user.getNickname());
        loginInfo.setLogoutUrl(userService.createLogoutURL(requestUri));

        Contact contact = null;
        pm = PMF.get().getPersistenceManager();
        String query = "select from " + Contact.class.getName() + " where email == :email";
        @SuppressWarnings("unchecked")
        List<Contact> contactList = (List<Contact>) pm.newQuery(query).execute(user.getEmail());
        if (contactList != null && contactList.size() > 0) {
          contact = contactList.get(0);
        }
        if (contact != null && contact.isEnable()) {
          loginInfo.setRegisted(true);
        } else {
          loginInfo.setRegisted(false);
        }

      } else {
        loginInfo.setLoggedIn(false);
        loginInfo.setLoginUrl(userService.createLoginURL(requestUri));
      }

    } finally {
      if (pm != null) {
        pm.close();
View Full Code Here

TOP

Related Classes of gfriends.client.model.LoginInfo

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.