Package org.picketlink.idm.api

Examples of org.picketlink.idm.api.IdentitySession


        if (log.isTraceEnabled()) {
            Tools.logMethodIn(log, LogLevel.TRACE, "saveUser", new Object[] { "user", user, "broadcast", broadcast });
        }

        IdentitySession session = service_.getIdentitySession();
        if (broadcast) {
            preSave(user, false);
        }

        persistUserInfo(user, session);
View Full Code Here


    public User removeUser(String userName, boolean broadcast) throws Exception {
        if (log.isTraceEnabled()) {
            Tools.logMethodIn(log, LogLevel.TRACE, "removeUser", new Object[] { "userName", userName, "broadcast", broadcast });
        }

        IdentitySession session = service_.getIdentitySession();

        org.picketlink.idm.api.User foundUser = null;

        try {
            orgService.flush();

            foundUser = session.getPersistenceManager().findUser(userName);
        } catch (IdentityException e) {
            handleException("Cannot obtain user: " + userName + "; ", e);

        }

        if (foundUser == null) {
            return null;
        }

        try {
            // Remove all memberships and profile first
            orgService.getMembershipHandler().removeMembershipByUser(userName, false);
            orgService.getUserProfileHandler().removeUserProfile(userName, false);
        } catch (Exception e) {
            handleException("Cannot cleanup user relationships: " + userName + "; ", e);

        }

        User exoUser = getPopulatedUser(userName, session);

        if (broadcast) {
            preDelete(exoUser);
        }

        try {
            session.getPersistenceManager().removeUser(foundUser, true);
        } catch (IdentityException e) {
            handleException("Cannot remove user: " + userName + "; ", e);

        }
View Full Code Here

    public User findUserByName(String userName) throws Exception {
        if (log.isTraceEnabled()) {
            Tools.logMethodIn(log, LogLevel.TRACE, "findUserByName", new Object[] { "userName", userName, });
        }

        IdentitySession session = service_.getIdentitySession();

        User user = getPopulatedUser(userName, session);

        if (log.isTraceEnabled()) {
            Tools.logMethodOut(log, LogLevel.TRACE, "findUserByName", user);
View Full Code Here

            authenticated = user.getPassword().equals(password);
        } else {
            try {
                orgService.flush();

                IdentitySession session = service_.getIdentitySession();
                org.picketlink.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());

                authenticated = session.getAttributesManager().validatePassword(idmUser, password);
            } catch (Exception e) {
                handleException("Cannot authenticate user: " + username + "; ", e);

            }
        }
View Full Code Here

    public User findUserByEmail(String email) throws Exception {
        if (log.isTraceEnabled()) {
            Tools.logMethodIn(log, LogLevel.TRACE, "findUserByEmail", new Object[] { "findUserByEmail", email });
        }

        IdentitySession session = service_.getIdentitySession();

        org.picketlink.idm.api.User plUser = null;

        try {
            orgService.flush();

            plUser = session.getAttributesManager().findUserByUniqueAttribute(USER_EMAIL, email);
        } catch (IdentityException e) {
            handleException("Cannot find user by email: " + email + "; ", e);

        }
View Full Code Here

      return new UserImpl(username);
   }

   public void createUser(User user, boolean broadcast) throws Exception
   {
      IdentitySession session = service_.getIdentitySession();
      if (broadcast)
      {
         preSave(user, true);
      }

      session.getPersistenceManager().createUser(user.getUserName());

      persistUserInfo(user, session);

      if (broadcast)
      {
View Full Code Here

   }

   public void saveUser(User user, boolean broadcast) throws Exception
   {
      IdentitySession session = service_.getIdentitySession();
      if (broadcast)
      {
         preSave(user, false);
      }
View Full Code Here

      cache_.put(user.getUserName(), user);
   }

   public User removeUser(String userName, boolean broadcast) throws Exception
   {
      IdentitySession session = service_.getIdentitySession();

      org.picketlink.idm.api.User foundUser = session.getPersistenceManager().findUser(userName);

      if (foundUser == null)
      {
         cache_.remove(userName);
         return null;
      }

      // Remove all memberships and profile first
      orgService.getMembershipHandler().removeMembershipByUser(userName, false);
      orgService.getUserProfileHandler().removeUserProfile(userName, false);
     
      User exoUser = getPopulatedUser(userName, session);

      if (broadcast)
      {
         preDelete(exoUser);
      }

      session.getPersistenceManager().removeUser(foundUser, true);
      if (broadcast)
      {
         postDelete(exoUser);
      }
      cache_.remove(userName);
View Full Code Here

   }

   //
   public User findUserByName(String userName) throws Exception
   {
      IdentitySession session = service_.getIdentitySession();

      User user = (User)cache_.get(userName);
      if (user != null)
      {
         return user;
View Full Code Here

      {
         authenticated = user.getPassword().equals(password);
      }
      else
      {
         IdentitySession session = service_.getIdentitySession();
         org.picketlink.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());

         authenticated = session.getAttributesManager().validatePassword(idmUser, password);
      }

      if (authenticated)
      {
         UserImpl userImpl = (UserImpl)user;
View Full Code Here

TOP

Related Classes of org.picketlink.idm.api.IdentitySession

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.