Examples of CollectionOptions


Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

    public void getPeople_FriendsFilterField() throws ExecutionException, InterruptedException {
        Set<UserId> ids = getUserIdSet();
        GroupId groupId = new GroupId(GroupId.Type.friends, GROUP_ID);
        replay(token);

        CollectionOptions options = new CollectionOptions();
        String field = Person.Field.ABOUT_ME.toString();
        String value = "AAA";
        options.setFilter(field);
        options.setFilterOperation(FilterOperation.contains);
        options.setFilterValue(value);

        expect(repository.findFriends(ID_2, field, FilterOperation.contains, value)).andReturn(getDbPersonList());
        expect(repository.findFriends(ID_3, field, FilterOperation.contains, value)).andReturn(getDbPersonList());
        replay(repository);
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

    public void getPeople_FriendsAllFilterField() throws ExecutionException, InterruptedException {
        Set<UserId> ids = getUserIdSet();
        GroupId groupId = new GroupId(GroupId.Type.friends, GROUP_ID);
        replay(token);

        CollectionOptions options = new CollectionOptions();
        String field = PersonService.ALL_FILTER;
        String value = "AAA";
        options.setFilter(field);
        options.setFilterOperation(FilterOperation.contains);
        options.setFilterValue(value);

        expect(repository.findFriends(ID_2)).andReturn(getDbPersonList());
        expect(repository.findFriends(ID_3)).andReturn(getDbPersonList());
        replay(repository);
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

        GroupId groupId = new GroupId(GroupId.Type.friends, GROUP_ID);
        String appId = "5";
        expect(token.getAppId()).andReturn(appId).anyTimes();
        replay(token);

        CollectionOptions options = new CollectionOptions();
        String field = PersonService.HAS_APP_FILTER;
        options.setFilter(field);

        expect(repository.findFriends(ID_2, appId)).andReturn(getDbPersonList());
        expect(repository.findFriends(ID_3, appId)).andReturn(getDbPersonList());
        replay(repository);
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

        GroupId groupId = new GroupId(GroupId.Type.all, GROUP_ID);
        String appId = "5";
        expect(token.getAppId()).andReturn(appId).anyTimes();
        replay(token);

        CollectionOptions options = new CollectionOptions();
        String field = PersonService.HAS_APP_FILTER;
        options.setFilter(field);

        expect(repository.findAllConnectedPeople(ID_2, appId)).andReturn(getDbPersonList());
        expect(repository.findAllConnectedPeople(ID_3, appId)).andReturn(getDbPersonList());
        replay(repository);
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

        GroupId groupId = new GroupId(GroupId.Type.groupId, GROUP_ID);
        String appId = "5";
        expect(token.getAppId()).andReturn(appId).anyTimes();
        replay(token);

        CollectionOptions options = new CollectionOptions();
        String field = PersonService.HAS_APP_FILTER;
        options.setFilter(field);

        expect(repository.findByGroup(GROUP_ID, appId)).andReturn(getDbPersonList());
        replay(repository);

        Future<RestfulCollection<Person>> people = service.getPeople(ids, groupId, options, null, token);
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

        GroupId groupId = new GroupId(GroupId.Type.friends, GROUP_ID);
        String appId = "5";
        expect(token.getAppId()).andReturn(appId);
        replay(token);

        CollectionOptions options = new CollectionOptions();
        String field = PersonService.IS_WITH_FRIENDS_FILTER;
        options.setFilter(field);
        options.setFilterValue(ID_1);

        expect(repository.findFriendsWithFriend(ID_2, ID_1)).andReturn(getDbPersonList());
        expect(repository.findFriendsWithFriend(ID_3, ID_1)).andReturn(getDbPersonList());
        replay(repository);
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

        GroupId groupId = new GroupId(GroupId.Type.all, GROUP_ID);
        String appId = "5";
        expect(token.getAppId()).andReturn(appId);
        replay(token);

        CollectionOptions options = new CollectionOptions();
        String field = PersonService.IS_WITH_FRIENDS_FILTER;
        options.setFilter(field);
        options.setFilterValue(ID_1);

        expect(repository.findAllConnectedPeopleWithFriend(ID_2, ID_1)).andReturn(getDbPersonList());
        expect(repository.findAllConnectedPeopleWithFriend(ID_3, ID_1)).andReturn(getDbPersonList());
        replay(repository);
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

        GroupId groupId = new GroupId(GroupId.Type.groupId, GROUP_ID);
        String appId = "5";
        expect(token.getAppId()).andReturn(appId).anyTimes();
        replay(token);

        CollectionOptions options = new CollectionOptions();
        String field = PersonService.IS_WITH_FRIENDS_FILTER;
        options.setFilter(field);
        options.setFilterValue(ID_1);

        expect(repository.findByGroupWithFriend(GROUP_ID, ID_1)).andReturn(getDbPersonList());
        replay(repository);

        Future<RestfulCollection<Person>> people = service.getPeople(ids, groupId, options, null, token);
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

        HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
// //   if (userIds.size() > 1 && !optionalPersonId.isEmpty()) {
// //     throw new IllegalArgumentException("Cannot fetch personIds for multiple userIds");
// //  }

        CollectionOptions options = new CollectionOptions(request);

        ////    if (userIds.size() == 1) {
        if (optionalPersonId.isEmpty()) {
            if (groupId.getType() == GroupId.Type.self) {
                // If a filter is set then we have to call getPeople(), otherwise use the simpler getPerson()
                if (options != null && options.getFilter() != null) {
                    Future<RestfulCollection<Person>> people = personService.getPeople(
                            userIds, groupId, options, fields, request.getToken());
                    return FutureUtil.getFirstFromCollection(people);
                } else {
                    return personService.getPerson(userIds.iterator().next(), fields, request.getToken());
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.CollectionOptions

    public Future<?> get(SocialRequestItem request)
            throws ProtocolException {
        Set<UserId> userIds = request.getUsers();
        Set<String> optionalActivityIds = ImmutableSet.copyOf(request.getListParameter("activityId"));

        CollectionOptions options = new CollectionOptions(request);

        // Preconditions
        HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
        if (userIds.size() > 1 && !optionalActivityIds.isEmpty()) {
            throw new IllegalArgumentException("Cannot fetch same activityIds for multiple userIds");
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.