org.apache.shindig.social.opensocial.spi
Interface PersonService

All Known Implementing Classes:
JsonDbOpensocialService

public interface PersonService

Interface that defines how shindig gathers people information.


Field Summary
static String ALL_FILTER
          Retrieves all friends.
static String HAS_APP_FILTER
          Retrieves all friends with any data for this application.
static String IS_WITH_FRIENDS_FILTER
          Will filter the people requested by checking if they are friends with the given idSpec.
static String TOP_FRIENDS_FILTER
          Retrieves only the user's top friends.
static String TOP_FRIENDS_SORT
          When used will sort people by the container's definition of top friends.
 
Method Summary
 Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds, GroupId groupId, CollectionOptions collectionOptions, Set<String> fields, SecurityToken token)
          Returns a list of people that correspond to the passed in person ids.
 Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken token)
          Returns a person that corresponds to the passed in person id.
 

Field Detail

TOP_FRIENDS_SORT

static final String TOP_FRIENDS_SORT
When used will sort people by the container's definition of top friends. Note that both the sort order and the filter are required to deliver a topFriends response. The PersonService implementation should take this into account when delivering a topFriends response.

See Also:
Constant Field Values

TOP_FRIENDS_FILTER

static final String TOP_FRIENDS_FILTER
Retrieves only the user's top friends. The meaning of top and how many top is is defined by the PersonService implementation.

See Also:
Constant Field Values

HAS_APP_FILTER

static final String HAS_APP_FILTER
Retrieves all friends with any data for this application. TODO: how is this application defined

See Also:
Constant Field Values

ALL_FILTER

static final String ALL_FILTER
Retrieves all friends. (ie no filter)

See Also:
Constant Field Values

IS_WITH_FRIENDS_FILTER

static final String IS_WITH_FRIENDS_FILTER
Will filter the people requested by checking if they are friends with the given idSpec. The filter value will be set to the userId of the target friend.

See Also:
Constant Field Values
Method Detail

getPeople

Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds,
                                            GroupId groupId,
                                            CollectionOptions collectionOptions,
                                            Set<String> fields,
                                            SecurityToken token)
                                            throws ProtocolException
Returns a list of people that correspond to the passed in person ids.

Parameters:
userIds - A set of users
groupId - The group
collectionOptions - How to filter, sort and paginate the collection being fetched
fields - The profile details to fetch. Empty set implies all
token - The gadget token @return a list of people.
Returns:
Future that returns a RestfulCollection of Person
Throws:
ProtocolException

getPerson

Future<Person> getPerson(UserId id,
                         Set<String> fields,
                         SecurityToken token)
                         throws ProtocolException
Returns a person that corresponds to the passed in person id.

Parameters:
id - The id of the person to fetch.
fields - The fields to fetch.
token - The gadget token
Returns:
a list of people.
Throws:
ProtocolException


Copyright © 2007-2012. All Rights Reserved.