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

All Known Implementing Classes:
JsonDbOpensocialService

public interface ActivityService

The ActivityService interface defines the service provider interface to retrieve activities from the underlying SNS.


Method Summary
 Future<Void> createActivity(UserId userId, GroupId groupId, String appId, Set<String> fields, Activity activity, SecurityToken token)
          Creates the passed in activity for the passed in user and group.
 Future<Void> deleteActivities(UserId userId, GroupId groupId, String appId, Set<String> activityIds, SecurityToken token)
          Deletes the activity for the passed in user and group that corresponds to the activityId.
 Future<RestfulCollection<Activity>> getActivities(Set<UserId> userIds, GroupId groupId, String appId, Set<String> fields, CollectionOptions options, SecurityToken token)
          Returns a list of activities that correspond to the passed in users and group.
 Future<RestfulCollection<Activity>> getActivities(UserId userId, GroupId groupId, String appId, Set<String> fields, CollectionOptions options, Set<String> activityIds, SecurityToken token)
          Returns a set of activities for the passed in user and group that corresponds to a list of activityIds.
 Future<Activity> getActivity(UserId userId, GroupId groupId, String appId, Set<String> fields, String activityId, SecurityToken token)
          Returns an activity for the passed in user and group that corresponds to a single activityId.
 

Method Detail

getActivities

Future<RestfulCollection<Activity>> getActivities(Set<UserId> userIds,
                                                  GroupId groupId,
                                                  String appId,
                                                  Set<String> fields,
                                                  CollectionOptions options,
                                                  SecurityToken token)
                                                  throws ProtocolException
Returns a list of activities that correspond to the passed in users and group.

Parameters:
userIds - The set of ids of the people to fetch activities for.
groupId - Indicates whether to fetch activities for a group.
appId - The app id.
fields - The fields to return. Empty set implies all
options - The sorting/filtering/pagination options
token - A valid SecurityToken
Returns:
a response item with the list of activities.
Throws:
ProtocolException

getActivities

Future<RestfulCollection<Activity>> getActivities(UserId userId,
                                                  GroupId groupId,
                                                  String appId,
                                                  Set<String> fields,
                                                  CollectionOptions options,
                                                  Set<String> activityIds,
                                                  SecurityToken token)
                                                  throws ProtocolException
Returns a set of activities for the passed in user and group that corresponds to a list of activityIds.

Parameters:
userId - The set of ids of the people to fetch activities for.
groupId - Indicates whether to fetch activities for a group.
appId - The app id.
fields - The fields to return. Empty set implies all
options - The sorting/filtering/pagination options
activityIds - The set of activity ids to fetch.
token - A valid SecurityToken
Returns:
a response item with the list of activities.
Throws:
ProtocolException

getActivity

Future<Activity> getActivity(UserId userId,
                             GroupId groupId,
                             String appId,
                             Set<String> fields,
                             String activityId,
                             SecurityToken token)
                             throws ProtocolException
Returns an activity for the passed in user and group that corresponds to a single activityId.

Parameters:
userId - The set of ids of the people to fetch activities for.
groupId - Indicates whether to fetch activities for a group.
appId - The app id.
fields - The fields to return. Empty set implies all
activityId - The activity id to fetch.
token - A valid SecurityToken
Returns:
a response item with the list of activities.
Throws:
ProtocolException

deleteActivities

Future<Void> deleteActivities(UserId userId,
                              GroupId groupId,
                              String appId,
                              Set<String> activityIds,
                              SecurityToken token)
                              throws ProtocolException
Deletes the activity for the passed in user and group that corresponds to the activityId.

Parameters:
userId - The user.
groupId - The group.
appId - The app id.
activityIds - A list of activity ids to delete.
token - A valid SecurityToken.
Returns:
a response item containing any errors
Throws:
ProtocolException

createActivity

Future<Void> createActivity(UserId userId,
                            GroupId groupId,
                            String appId,
                            Set<String> fields,
                            Activity activity,
                            SecurityToken token)
                            throws ProtocolException
Creates the passed in activity for the passed in user and group. Once createActivity is called, getActivities will be able to return the Activity.

Parameters:
userId - The id of the person to create the activity for.
groupId - The group.
appId - The app id.
fields - The fields to return.
activity - The activity to create.
token - A valid SecurityToken
Returns:
a response item containing any errors
Throws:
ProtocolException


Copyright © 2007-2012. All Rights Reserved.