Package org.apache.shindig.social.opensocial.spi

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.findByUsername(ID_2)).andReturn(getDbPerson(ID_2));
        expect(repository.findByUsername(ID_3)).andReturn(getDbPerson(ID_3));

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


        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.findByUsername(ID_2)).andReturn(getDbPerson(ID_2));
        expect(repository.findByUsername(ID_3)).andReturn(getDbPerson(ID_3));

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

        GroupId groupId = new GroupId(GroupId.Type.objectId, 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

        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.findByUsername(ID_2)).andReturn(getDbPerson(ID_2));
        expect(repository.findByUsername(ID_3)).andReturn(getDbPerson(ID_3));

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

        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.findByUsername(ID_2)).andReturn(getDbPerson(ID_2));
        expect(repository.findByUsername(ID_3)).andReturn(getDbPerson(ID_3));

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

        GroupId groupId = new GroupId(GroupId.Type.objectId, 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

            request.getAppId(), request.getFields(),
            optionalAlbumIds.iterator().next(), request.getToken());
      } else {
        return service.getAlbums(Iterables.getOnlyElement(userIds),
            request.getAppId(), request.getFields(),
            new CollectionOptions(request), optionalAlbumIds,
            request.getToken());
      }
    }

    // Retrieve albums by group
    return service.getAlbums(userIds, request.getGroup(), request
        .getAppId(), request.getFields(),
        new CollectionOptions(request), request.getToken());
  }
View Full Code Here

  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

    Set<UserId> userIds = request.getUsers();
    String msgCollId = request.getParameter("msgCollId");
    List<String> messageIds = request.getListParameter("messageIds");

    CollectionOptions options = new CollectionOptions(request);

    HandlerPreconditions.requireNotEmpty(userIds, "No userId specified");
    HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported");

    UserId user = request.getUsers().iterator().next();
View Full Code Here

            Iterables.getOnlyElement(optionalMediaItemIds),
            request.getFields(), request.getToken());
      } else {
        return service.getMediaItems(Iterables.getOnlyElement(userIds),
            request.getAppId(), albumId, optionalMediaItemIds,
            request.getFields(), new CollectionOptions(request),
            request.getToken());
      }
    }

    // Retrieve by Album
    if (albumId != null) {
      return service.getMediaItems(Iterables.getOnlyElement(userIds),
          request.getAppId(), albumId, request.getFields(),
          new CollectionOptions(request), request.getToken());
    }

    // Retrieve by users and groups
    return service.getMediaItems(userIds, request.getGroup(), request
        .getAppId(), request.getFields(),
        new CollectionOptions(request), request.getToken());
  }
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.opensocial.spi.CollectionOptions

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.