query-by method for field profileLink
@param profileLink the specified attribute
@return an Iterable of DOAuth2Users for the specified profileLink
334360
public Iterable<DOAuth2User> queryByProfileLink(java.lang.String profileLink) {
    return queryByField(null, DOAuth2UserMapper.Field.PROFILELINK.getFieldName(), profileLink);
  }
93650
public static DefaultListOperation<ContentKeyInfo> list(
            LinkInfo<ContentKeyInfo> link) {
        return new DefaultListOperation<ContentKeyInfo>(link.getHref(),
                new GenericType<ListResult<ContentKeyInfo>>() {
                });
    }
686680
public DOAuth2User findByEmail(java.lang.String email) {
    return queryUniqueByField(null, DOAuth2UserMapper.Field.EMAIL.getFieldName(), email);
  }
564766
protected final Optional<UserProfile> retrieveUserProfile(final C credentials, final WebContext context) {
        final Optional<UserProfile> profile = this.profileCreator.create(credentials, context);
        logger.debug("profile: {}", profile);
        return profile;
    }
799199
public UserProfile fetchUserProfile(final Google google) {
    final UserInfo userInfo = google.oauth2Operations().getUserinfo();
    return new UserProfileBuilder().setUsername(userInfo.getId())
      .setId(userInfo.getId())
      .setEmail(userInfo.getEmail())
      .setName(userInfo.getName())
      .setFirstName(userInfo.getGivenName())
      .setLastName(userInfo.getFamilyName()).build();
  }
504426
public static void withLink(Representation representation, String rel, String href, Optional<Predicate<ReadableRepresentation>> predicate, Optional<String> name, Optional<String> title, Optional<String> hreflang, Optional<String> profile) {
        if (predicate.or(Predicates.<ReadableRepresentation>alwaysTrue()).apply(representation)) {
            representation.withLink(rel, href, name.orNull(), title.orNull(), hreflang.orNull(), profile.orNull());
        }
    }
570355
public AccountHeaderBuilder withProfiles(@NonNull List<IProfile> profiles) {
        if (mDrawer != null) {
            mDrawer.mDrawerBuilder.idDistributor.checkIds(profiles);
        }
        this.mProfiles = profiles;
        return this;
    }
984807
public Iterable<DOAuth2User> queryByThumbnailUrl(java.lang.String thumbnailUrl) {
    return queryByField(null, DOAuth2UserMapper.Field.THUMBNAILURL.getFieldName(), thumbnailUrl);
  }
440098
public Iterable<DOAuth2User> queryByUpdatedBy(java.lang.String updatedBy) {
    return queryByField(null, DOAuth2UserMapper.Field.UPDATEDBY.getFieldName(), updatedBy);
  }
836631
public static Profile createProfile(Connection<?> connection) {
        Profile profile = new Profile();
        UserProfile providerProfile = connection.fetchUserProfile();

        String email = providerProfile.getEmail();
        if (StringUtils.isEmpty(email)) {
            throw new IllegalStateException("No email included in provider profile");
        }

        String username = providerProfile.getUsername();
        if (StringUtils.isEmpty(username)) {
            username = email;
        }

        String firstName = providerProfile.getFirstName();
        String lastName = providerProfile.getLastName();
        String displayName;

        if (StringUtils.isNotEmpty(connection.getDisplayName())) {
            displayName = connection.getDisplayName();
        } else {
            displayName = firstName + " " + lastName;
        }

        profile.setUsername(username);
        profile.setEmail(email);
        profile.setAttribute(FIRST_NAME_ATTRIBUTE_NAME, firstName);
        profile.setAttribute(LAST_NAME_ATTRIBUTE_NAME, lastName);
        profile.setAttribute(DISPLAY_NAME_ATTRIBUTE_NAME, displayName);

        if (StringUtils.isNotEmpty(connection.getImageUrl())) {
            profile.setAttribute(AVATAR_LINK_ATTRIBUTE_NAME, connection.getImageUrl());
        }

        return profile;
    }
504067
@Override
    @JsonIgnore
    public Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(final Map<String, List<Object>> query,
                                                                     final IPersonAttributeDaoFilter filter) {
        if (this.logger.isDebugEnabled()) {
            this.logger.debug("invoking getPeopleWithMultivaluedAttributes(" + query + ")");
        }

        final IUsernameAttributeProvider usernameAttributeProvider = super.getUsernameAttributeProvider();
        String uid = usernameAttributeProvider.getUsernameFromQuery(query);
        if (uid == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No username attribute found in query, returning null");
            }

            return null;
        }
        uid = usernameCaseCanonicalizationMode.canonicalize(uid, usernameCaseCanonicalizationLocale);

        String targetName = this.descriptors.getName();
        if (targetName == null) {
            if (this.currentUserProvider != null) {
                targetName = this.currentUserProvider.getCurrentUserName();
            }

            if (targetName == null) {
                this.logger.warn("AdditionalDescriptors has a null name and a null name was returned by the currentUserProvider, returning null. " + this.descriptors);
                return null;
            }
        }

        targetName = usernameCaseCanonicalizationMode.canonicalize(targetName, usernameCaseCanonicalizationLocale);
        if (uid.equals(targetName)) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Adding additional descriptors " + this.descriptors);
            }

            final IPersonAttributes personAttributes = new CaseInsensitiveNamedPersonImpl(targetName, this.descriptors.getAttributes());
            return Collections.singleton(personAttributes);
        }

        return null;
    }
1258999
@Override
    public Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(final Map<String, List<Object>> query,
                                                                     final IPersonAttributeDaoFilter filter) {
        this.jaxbLoader.getUnmarshalledObject(this.attributeLoader);

        //Tracks persons that could match the query
        final Map<String, IPersonAttributes> canidatePersons = new LinkedHashMap<>();

        boolean firstAttribute = true;
        for (final Map.Entry<String, List<Object>> queryEntry : query.entrySet()) {
            final String entryKey = queryEntry.getKey();

            //Skip attributes that no people contain
            if (!this.attributesCache.contains(entryKey)) {
                continue;
            }

            //Build list of non-blank attribute values
            final List<String> entryValues = new LinkedList<>();
            for (final Object entryValue : queryEntry.getValue()) {
                //Skip null and blank values
                final String entry;
                if (entryValue == null || StringUtils.isBlank(entry = entryValue.toString())) {
                    continue;
                }

                entryValues.add(entry);
            }

            //Skip attributes that have no non-blank values
            if (entryValues.size() == 0) {
                continue;
            }

            //Build Set of Persons that have the current attribute
            final Set<IPersonAttributes> personsForAttribute = this.personByAttributeCache.get(entryKey);
            for (final Iterator<IPersonAttributes> canidateItr = canidatePersons.values().iterator(); canidateItr.hasNext(); ) {
                final IPersonAttributes canidate = canidateItr.next();
                if (!personsForAttribute.contains(canidate)) {
                    canidateItr.remove();
                }
            }

            final Map<String, IPersonAttributes> attributeCanidatePersons = new LinkedHashMap<>();
            final Set<String> attributeMissPersons = new HashSet<>();

            //Iterate over each possible value for an attribute checking for a match in the personsForAttribute 
            for (final String queryString : entryValues) {
                //Convert the query value into a regular expression pattern
                final Pattern queryPattern = PatternHelper.compilePattern(queryString);

                //Look for the attribute value in each potential IPersonAttributes
                for (final IPersonAttributes person : personsForAttribute) {
                    //If this isn't the first attribute and this person isn't a canidate skip them
                    final String name = person.getName();
                    if (!firstAttribute && !canidatePersons.containsKey(name)) {
                        continue;
                    }

                    //Track if any of the person's attributes match
                    boolean foundMatch = false;

                    //Compare the query pattern with the person's attribute values
                    final List<Object> personAttributeValues = person.getAttributeValues(entryKey);
                    if (personAttributeValues != null) {
                        for (final Object personAttributeValue : personAttributeValues) {
                            //Skip null values
                            if (personAttributeValue == null) {
                                continue;
                            }

                            final String personAttributeString = personAttributeValue.toString();
                            final Matcher personAttributeMatcher = queryPattern.matcher(personAttributeString);
                            if (personAttributeMatcher.matches()) {
                                //If the attribute matches put the person in the canidate map and break out of the personAttributeValues loop
                                attributeCanidatePersons.put(name, person);
                                attributeMissPersons.remove(name);
                                foundMatch = true;
                                break;
                            }
                        }
                    }

                    //No match for this attribute, remove the person from the canidate map if they are there
                    if (!foundMatch && !attributeCanidatePersons.containsKey(name)) {
                        attributeMissPersons.add(name);
                    }
                }
            }

            canidatePersons.putAll(attributeCanidatePersons);
            for (final String userName : attributeMissPersons) {
                canidatePersons.remove(userName);
            }

            //Ran through a query entry completely
            firstAttribute = false;

            //If no potential matches are left give up since canidatePersons never grows after the first pass
            if (canidatePersons.size() == 0) {
                break;
            }
        }

        return new LinkedHashSet<>(canidatePersons.values());
    }
1032181
public Observable<ComapiResult<Map<String, Object>>> getProfile(@NonNull final String profileId) {

        final String token = getToken();

        if (sessionController.isCreatingSession()) {
            return getTaskQueue().queueGetProfile(profileId);
        } else if (TextUtils.isEmpty(token)) {
            return Observable.error(getSessionStateErrorDescription());
        } else {
            return doGetProfile(token, profileId);
        }
    }
23669
protected Content getProfile(String profileName) {
        Content profileLinkContent;
        Content profileLabel;
        profileLabel = new StringContent(profileName);
        profileLinkContent = getHyperLink(DocPaths.profileFrame(profileName), profileLabel, "",
                    "packageListFrame");
        Content li = HtmlTree.LI(profileLinkContent);
        return li;
    }
1303602
@Override
    public final Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(
            Map<String, List<Object>> query) {
        Validate.notNull(query, "query may not be null.");

        // Generate the query to pass to the subclass
        final LocalAccountQuery queryBuilder = this.generateQuery(query);
        if (queryBuilder == null) {
            this.logger.debug(
                    "No queryBuilder was generated for query " + query + ", null will be returned");

            return null;
        }

        // Get the username from the query, if specified
        final IUsernameAttributeProvider usernameAttributeProvider =
                this.getUsernameAttributeProvider();

        // Execute the query in the subclass
        final List<ILocalAccountPerson> unmappedPeople = localAccountDao.getPeople(queryBuilder);
        if (unmappedPeople == null) {
            return null;
        }

        // Map the attributes of the found people according to resultAttributeMapping if it is set
        final Set<IPersonAttributes> mappedPeople = new LinkedHashSet<IPersonAttributes>();
        for (final ILocalAccountPerson unmappedPerson : unmappedPeople) {
            final IPersonAttributes mappedPerson = this.mapPersonAttributes(unmappedPerson);
            mappedPeople.add(mappedPerson);
        }

        return Collections.unmodifiableSet(mappedPeople);
    }
1355616
protected CommonProfile getAuthenticatedProfile(final HttpServletRequest request, final HttpServletResponse response) {
        val context = new J2EContext(request, response, getConfigurationContext().getSessionStore());
        val manager = new ProfileManager<>(context, context.getSessionStore());
        val profile = manager.get(true);

        if (profile.isEmpty()) {
            throw new IllegalArgumentException("Unable to determine the user profile from the context");
        }
        return profile.get();
    }
1015505
public Content getTargetProfileLink(String target, Content label,
            String profileName) {
        return getHyperLink(pathToRoot.resolve(
                DocPaths.profileSummary(profileName)), label, "", target);
    }