com.atlassian.gadgets.opensocial.spi
Interface PersonService

All Known Implementing Classes:
UserManagerPersonService

public interface PersonService

Interface for handling Person requests.

The PersonService has three functions: first, it resolves String-based person id's, ensuring that a user corresponding to the requested id exists in the system. Second, it aggregates social data associated with a user (which may be stored in disparate places in the host application) into a single Person container. Third, it aggregates Group members in getPeople(java.util.Set, com.atlassian.gadgets.opensocial.model.Group, com.atlassian.gadgets.opensocial.OpenSocialRequestContext), collecting all members of a named group for each of a set of Persons together into one collection. All of this data is expected to be stored persistently by the host application. For example, a typical PersonService implementation might resolve Person requests against its database of users, filling in the Person fields from stored profile information for that user.

This is an optional SPI that host applications may implement if they wish to provide the ability to query person and group data using the OpenSocial APIs. Host applications that wish to provide AppDataService or ActivityService implementations must also implement PersonService as well, as those services depend on this service.

The PersonService is not intended to provide a mechanism for updating social data.

Since:
2.0

Method Summary
 Set<Person> getPeople(Set<String> personIds, Group group, OpenSocialRequestContext requestContext)
          Returns a List corresponding to the group members of the passed in person IDs
 Person getPerson(String personId, OpenSocialRequestContext requestContext)
          Returns a Person corresponding to the personId
 

Method Detail

getPerson

@Nullable
Person getPerson(String personId,
                          OpenSocialRequestContext requestContext)
                 throws PersonServiceException
Returns a Person corresponding to the personId

Parameters:
personId - The requested person id
requestContext - context for this request
Returns:
a Person corresponding to the requested personId, or null if the requested personId could not be resolved
Throws:
PersonServiceException - if there is a problem while performing this operation

getPeople

Set<Person> getPeople(Set<String> personIds,
                      Group group,
                      OpenSocialRequestContext requestContext)
                      throws PersonServiceException
Returns a List corresponding to the group members of the passed in person IDs

Parameters:
personIds - A set of users
group - The group to select from each of the passed in personIds
requestContext - context for this request
Returns:
a set of people
Throws:
PersonServiceException - if there is a problem while performing this operation


Copyright © 2011 Atlassian. All Rights Reserved.