Examples of SimpleAttribute


Examples of org.picketlink.idm.impl.api.SimpleAttribute

        String description = exoGroup.getDescription();
        String label = exoGroup.getLabel();

        List<Attribute> attrsList = new ArrayList<Attribute>();
        if (description != null) {
            attrsList.add(new SimpleAttribute(GROUP_DESCRIPTION, description));
        }

        if (label != null) {
            attrsList.add(new SimpleAttribute(GROUP_LABEL, label));
        }

        if (attrsList.size() > 0) {
            Attribute[] attrs = new Attribute[attrsList.size()];
View Full Code Here

Examples of org.picketlink.idm.impl.api.SimpleAttribute

        String description = exoGroup.getDescription();
        String label = exoGroup.getLabel();

        List<Attribute> attrsList = new ArrayList<Attribute>();
        if (description != null) {
            attrsList.add(new SimpleAttribute(GROUP_DESCRIPTION, description));
        }

        if (label != null) {
            attrsList.add(new SimpleAttribute(GROUP_LABEL, label));
        }

        if (attrsList.size() > 0) {
            Attribute[] attrs = new Attribute[attrsList.size()];
View Full Code Here

Examples of org.picketlink.idm.impl.api.SimpleAttribute

      String label = exoGroup.getLabel();

      List<Attribute> attrsList = new ArrayList<Attribute>();
      if (description != null)
      {
         attrsList.add(new SimpleAttribute(GROUP_DESCRIPTION, description));
      }

      if (label != null)
      {
         attrsList.add(new SimpleAttribute(GROUP_LABEL, label));
      }

      if (attrsList.size() > 0)
      {
         Attribute[] attrs = new Attribute[attrsList.size()];
View Full Code Here

Examples of org.picketlink.idm.impl.api.SimpleAttribute

      Set<Attribute> attrs = new HashSet<Attribute>();

      for (Map.Entry<String, String> entry : profileAttrs.entrySet())
      {
         attrs.add(new SimpleAttribute(entry.getKey(), entry.getValue()));
      }

      Attribute[] attrArray = new Attribute[attrs.size()];
      attrArray = attrs.toArray(attrArray);
View Full Code Here

Examples of org.picketlink.idm.impl.api.SimpleAttribute

      ArrayList attributes = new ArrayList();

      if (user.getCreatedDate() != null)
      {
         attributes.add(new SimpleAttribute(USER_CREATED_DATE, dateFormat.format(user.getCreatedDate())));
      }
      if (user.getLastLoginTime() != null)
      {
         attributes.add(new SimpleAttribute(USER_LAST_LOGIN_TIME, dateFormat.format(user.getLastLoginTime())));
      }
      if (user.getEmail() != null)
      {
         attributes.add(new SimpleAttribute(USER_EMAIL, user.getEmail()));
      }
      if (user.getFirstName() != null)
      {
         attributes.add(new SimpleAttribute(USER_FIRST_NAME, user.getFirstName()));
      }
      if (user.getLastName() != null)
      {
         attributes.add(new SimpleAttribute(USER_LAST_NAME, user.getLastName()));
      }
      if (user.getOrganizationId() != null)
      {
         attributes.add(new SimpleAttribute(USER_ORGANIZATION_ID, user.getOrganizationId()));
      }
      if (user.getPassword() != null)
      {
         if (orgService.getConfiguration().isPasswordAsAttribute())
         {
            attributes.add(new SimpleAttribute(USER_PASSWORD, user.getPassword()));
         }
         else
         {
            am.updatePassword(session.getPersistenceManager().findUser(user.getUserName()), user.getPassword());
         }
View Full Code Here

Examples of org.picketlink.idm.impl.api.SimpleAttribute

        String description = exoGroup.getDescription();
        String label = exoGroup.getLabel();

        List<Attribute> attrsList = new ArrayList<Attribute>();
        if (description != null) {
            attrsList.add(new SimpleAttribute(GROUP_DESCRIPTION, description));
        }

        if (label != null) {
            attrsList.add(new SimpleAttribute(GROUP_LABEL, label));
        }

        if (attrsList.size() > 0) {
            Attribute[] attrs = new Attribute[attrsList.size()];
View Full Code Here

Examples of org.picketlink.idm.impl.api.SimpleAttribute

        AttributesManager am = session.getAttributesManager();

        ArrayList attributes = new ArrayList();

        if (user.getCreatedDate() != null) {
            attributes.add(new SimpleAttribute(USER_CREATED_DATE, "" + user.getCreatedDate().getTime()));
        }
        if (user.getLastLoginTime() != null) {
            attributes.add(new SimpleAttribute(USER_LAST_LOGIN_TIME, "" + user.getLastLoginTime().getTime()));
        }
        if (user.getEmail() != null) {
            attributes.add(new SimpleAttribute(USER_EMAIL, user.getEmail()));
        }
        if (user.getFirstName() != null) {
            attributes.add(new SimpleAttribute(USER_FIRST_NAME, user.getFirstName()));
        }
        if (user.getLastName() != null) {
            attributes.add(new SimpleAttribute(USER_LAST_NAME, user.getLastName()));
        }

        // TODO: GTNPORTAL-2358 Change once displayName will be available as part of Organization API
        if (user instanceof UserImpl) {
            UserImpl userImpl = (UserImpl) user;
            if (userImpl.getDisplayName() != null) {
                attributes.add(new SimpleAttribute(USER_DISPLAY_NAME, ((UserImpl) user).getDisplayName()));
            } else {
                removeDisplayNameIfNeeded(am, user);
            }
        } else {
            log.warn("User is of class " + user.getClass() + " which is not instanceof " + UserImpl.class);
        }

        if (user.getOrganizationId() != null) {
            attributes.add(new SimpleAttribute(USER_ORGANIZATION_ID, user.getOrganizationId()));
        }
        if (user.getPassword() != null) {
            if (orgService.getConfiguration().isPasswordAsAttribute()) {
                attributes.add(new SimpleAttribute(USER_PASSWORD, user.getPassword()));
            } else {
                try {
                    am.updatePassword(session.getPersistenceManager().findUser(user.getUserName()), user.getPassword());
                } catch (Exception e) {
                    handleException("Cannot update password: " + user.getUserName() + "; ", e);
View Full Code Here

Examples of org.picketlink.idm.impl.api.SimpleAttribute

        Map<String, String> profileAttrs = profile.getUserInfoMap();

        Set<Attribute> attrs = new HashSet<Attribute>();

        for (Map.Entry<String, String> entry : profileAttrs.entrySet()) {
            attrs.add(new SimpleAttribute(entry.getKey(), entry.getValue()));
        }

        Attribute[] attrArray = new Attribute[attrs.size()];
        attrArray = attrs.toArray(attrArray);
View Full Code Here

Examples of org.picketlink.idm.impl.api.SimpleAttribute

        }
        ((UserImpl) foundUser).setEnabled(enabled);
        if (broadcast)
            preSetEnabled(foundUser);

        Attribute[] attrs = new Attribute[] { new SimpleAttribute(USER_ENABLED, String.valueOf(enabled)) };

        AttributesManager am = session.getAttributesManager();
        try {
            am.updateAttributes(userName, attrs);
        } catch (Exception e) {
View Full Code Here

Examples of org.picketlink.idm.impl.api.SimpleAttribute

        AttributesManager am = session.getAttributesManager();

        ArrayList attributes = new ArrayList();

        if (user.getCreatedDate() != null) {
            attributes.add(new SimpleAttribute(USER_CREATED_DATE, "" + user.getCreatedDate().getTime()));
        }
        if (user.getLastLoginTime() != null) {
            attributes.add(new SimpleAttribute(USER_LAST_LOGIN_TIME, "" + user.getLastLoginTime().getTime()));
        }
        if (user.getEmail() != null) {
            attributes.add(new SimpleAttribute(USER_EMAIL, user.getEmail()));
        }
        if (user.getFirstName() != null) {
            attributes.add(new SimpleAttribute(USER_FIRST_NAME, user.getFirstName()));
        }
        if (user.getLastName() != null) {
            attributes.add(new SimpleAttribute(USER_LAST_NAME, user.getLastName()));
        }

        // TODO: GTNPORTAL-2358 Change once displayName will be available as part of Organization API
        if (user instanceof UserImpl) {
            UserImpl userImpl = (UserImpl) user;
            if (userImpl.getDisplayName() != null) {
                attributes.add(new SimpleAttribute(USER_DISPLAY_NAME, ((UserImpl) user).getDisplayName()));
            } else {
                removeDisplayNameIfNeeded(am, user);
            }

            if (isNew) {
                attributes.add(new SimpleAttribute(USER_ENABLED, Boolean.TRUE.toString()));
            }
        } else {
            log.warn("User is of class " + user.getClass() + " which is not instanceof " + UserImpl.class);
        }

        if (user.getOrganizationId() != null) {
            attributes.add(new SimpleAttribute(USER_ORGANIZATION_ID, user.getOrganizationId()));
        }
        if (user.getPassword() != null) {
            if (orgService.getConfiguration().isPasswordAsAttribute()) {
                attributes.add(new SimpleAttribute(USER_PASSWORD, user.getPassword()));
            } else {
                try {
                    am.updatePassword(session.getPersistenceManager().findUser(user.getUserName()), user.getPassword());
                } catch (Exception e) {
                    handleException("Cannot update password: " + user.getUserName() + "; ", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.