Package org.jboss.portal.identity

Examples of org.jboss.portal.identity.User


      {
         return super.equals(obj);
      }


      User u = (User)obj;
      if (u.getId().toString().equals(getId().toString()))
      {
         return true;
      }
      return false;
   }
View Full Code Here


   {


      public int compare(Object o1, Object o2)
      {
         User u1 = (User)o1;
         User u2 = (User)o2;

         String name1 = u1.getUserName();
         String name2 = u2.getUserName();

         return name1.compareToIgnoreCase(name2);
      }
View Full Code Here

         {
            public Object run() throws Exception
            {
               try
               {
                  User user = getUserModule().findUserByUserName(getUsername());
                  // in case module implementation doesn't throw proper
                  // exception...
                  if (user == null)
                  {
                     throw new NoSuchUserException("UserModule returned null user object")
                  }

                  //This is because LDAP binds can be non case sensitive
                  if (validateUserNameCase != null && validateUserNameCase.equalsIgnoreCase("true")
                     && !getUsername().equals(user.getUserName()))
                  {
                     return UserStatus.UNEXISTING;
                  }

                  boolean enabled = false;
                  try {
                     Object enabledS;
                     enabledS = getUserProfileModule().getProperty(user,
                           User.INFO_USER_ENABLED);
                     if (enabledS != null) {
                        enabled = new Boolean(enabledS.toString());
                     }
                  } catch (Exception e) {
                     e.printStackTrace();
                  }
                  if (!enabled) {
                     return UserStatus.DISABLE;
                  }
                  if (havingRole != null)
                  {
                     boolean hasTheRole = false;
                     Set roles = getMembershipModule().getRoles(user);
                     for (Iterator i = roles.iterator(); i.hasNext();)
                     {
                        Role role = (Role)i.next();
                        if (havingRole.equals(role.getName()))
                        {
                           hasTheRole = true;
                           break;
                        }
                     }
                     if (!hasTheRole)
                     {
                        return UserStatus.NOTASSIGNEDTOROLE;
                     }
                  }
                  if (!user.validatePassword(inputPassword))
                  {
                     return UserStatus.WRONGPASSWORD;
                  }
               }
               catch (NoSuchUserException e1)
View Full Code Here

               if (additionalRole != null) {
                  rolesGroup.addMember(createIdentity(additionalRole));
               }

               try {
                  User user = getUserModule().findUserByUserName(getUsername());
                  Set roles = getMembershipModule().getRoles(user);

                  //

                  for (Iterator iterator = roles.iterator(); iterator.hasNext();) {
View Full Code Here

               "Posible data inconsistency");
         }
         SearchResult res = (SearchResult)sr.iterator().next();
         ctx = (Context)res.getObject();
         String dn = ctx.getNameInNamespace();
         User user = createUserInstance(res.getAttributes(), dn);
         ctx.close();
         return user;

      }
      catch (NoSuchElementException e)
View Full Code Here

         catch (NamingException e)
         {
            throw new IdentityException("Failed to close LDAP connection", e);
         }
      }
      User u =  findUserByUserName(userName);


      fireUserCreatedEvent(u.getId(), u.getUserName());
      return u;
   }
View Full Code Here

         {
            public Object run() throws Exception
            {
               try
               {
                  User user = null;
                  //check if user exist
                  try
                  {

                     user = getUserModule().findUserByUserName(name);

                     //synchronize password from LDAP to DB
                     if (!user.validatePassword(password))
                     {
                        user.updatePassword(password);
                     }
                  }
                  catch (Exception e)
                  {
                     // nothing as user can simply not exist
View Full Code Here

            {
               try
               {


                  User user = null;
                  //check if user exist
                  try
                  {

                     user = getUserModule().findUserByUserName(name);

                     //synchronize password from LDAP to DB
                     if (!user.validatePassword(password))
                     {
                        user.updatePassword(password);
                     }
                  }
                  catch (Exception e)
                  {
                     // nothing as user can simply not exist
View Full Code Here

               "Posible data inconsistency");
         }
         SearchResult res = (SearchResult)sr.iterator().next();
         ctx = (Context)res.getObject();
         String dn = ctx.getNameInNamespace();
         User user = createUserInstance(res.getAttributes(), dn);
         ctx.close();
         return user;

      }
      catch (NoSuchElementException e)
View Full Code Here

         {
            SearchResult res = (SearchResult)iterator.next();
            DirContext ctx = (DirContext)res.getObject();

            //TODO: this part isn't efficient - check the condition without creating instance
            User user = getUserModule().createUserInstance(res.getAttributes(),ctx.getNameInNamespace());
            if (userNameFilter != null && userNameFilter.length() != 0 && !user.getUserName().matches(".*" + userNameFilter + ".*"))
            {
               continue;
            }
            users.add(user);
         }
View Full Code Here

TOP

Related Classes of org.jboss.portal.identity.User

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.