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

Field Detail

TOP_FRIENDS_SORT

static final java.lang.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 java.lang.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 java.lang.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 java.lang.String ALL_FILTER
Retrieves all friends. (ie no filter)

See Also:
Constant Field Values

IS_WITH_FRIENDS_FILTER

static final java.lang.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

java.util.concurrent.Future<RestfulCollection<Person>> getPeople(java.util.Set<UserId> userIds,
                                                                 GroupId groupId,
                                                                 CollectionOptions collectionOptions,
                                                                 java.util.Set<java.lang.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

java.util.concurrent.Future<Person> getPerson(UserId id,
                                              java.util.Set<java.lang.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

updatePerson

java.util.concurrent.Future<Person> updatePerson(UserId id,
                                                 Person person,
                                                 SecurityToken token)
                                                 throws ProtocolException
Updates person that corresponds to the passed in person id and updates him

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


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.