| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ActivityService |
|
| 0.0;0 |
| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one | |
| 3 | * or more contributor license agreements. See the NOTICE file | |
| 4 | * distributed with this work for additional information | |
| 5 | * regarding copyright ownership. The ASF licenses this file | |
| 6 | * to you under the Apache License, Version 2.0 (the | |
| 7 | * "License"); you may not use this file except in compliance | |
| 8 | * with the License. You may obtain a copy of the License at | |
| 9 | * | |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 11 | * | |
| 12 | * Unless required by applicable law or agreed to in writing, | |
| 13 | * software distributed under the License is distributed on an | |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
| 15 | * KIND, either express or implied. See the License for the | |
| 16 | * specific language governing permissions and limitations under the License. | |
| 17 | */ | |
| 18 | package org.apache.shindig.social.opensocial.spi; | |
| 19 | ||
| 20 | import org.apache.shindig.auth.SecurityToken; | |
| 21 | import org.apache.shindig.social.opensocial.model.Activity; | |
| 22 | import org.apache.shindig.social.sample.spi.JsonDbOpensocialService; | |
| 23 | ||
| 24 | import com.google.inject.ImplementedBy; | |
| 25 | ||
| 26 | import java.util.Set; | |
| 27 | import java.util.concurrent.Future; | |
| 28 | ||
| 29 | /** | |
| 30 | * The ActivityService interface defines the service provider interface to retrieve activities from | |
| 31 | * the underlying SNS. | |
| 32 | */ | |
| 33 | @ImplementedBy(JsonDbOpensocialService.class) | |
| 34 | public interface ActivityService { | |
| 35 | ||
| 36 | /** | |
| 37 | * Returns a list of activities that correspond to the passed in users and group. | |
| 38 | * | |
| 39 | * @param userIds The set of ids of the people to fetch activities for. | |
| 40 | * @param groupId Indicates whether to fetch activities for a group. | |
| 41 | * @param appId The app id. | |
| 42 | * @param fields The fields to return. Empty set implies all | |
| 43 | * @param token A valid SecurityToken | |
| 44 | * @return a response item with the list of activities. | |
| 45 | */ | |
| 46 | Future<RestfulCollection<Activity>> getActivities(Set<UserId> userIds, | |
| 47 | GroupId groupId, String appId, Set<String> fields, SecurityToken token) | |
| 48 | throws SocialSpiException; | |
| 49 | ||
| 50 | /** | |
| 51 | * Returns a set of activities for the passed in user and group that corresponds to a list of | |
| 52 | * activityIds. | |
| 53 | * | |
| 54 | * @param userId The set of ids of the people to fetch activities for. | |
| 55 | * @param groupId Indicates whether to fetch activities for a group. | |
| 56 | * @param appId The app id. | |
| 57 | * @param fields The fields to return. Empty set implies all | |
| 58 | * @param activityIds The set of activity ids to fetch. | |
| 59 | * @param token A valid SecurityToken | |
| 60 | * @return a response item with the list of activities. | |
| 61 | */ | |
| 62 | Future<RestfulCollection<Activity>> getActivities(UserId userId, GroupId groupId, | |
| 63 | String appId, Set<String> fields, Set<String> activityIds, SecurityToken token) | |
| 64 | throws SocialSpiException; | |
| 65 | ||
| 66 | ||
| 67 | /** | |
| 68 | * Returns a set of activities for the passed in user and group that corresponds to a single of | |
| 69 | * activityId | |
| 70 | * | |
| 71 | * @param userId The set of ids of the people to fetch activities for. | |
| 72 | * @param groupId Indicates whether to fetch activities for a group. | |
| 73 | * @param appId The app id. | |
| 74 | * @param fields The fields to return. Empty set implies all | |
| 75 | * @param activityId The activity id to fetch. | |
| 76 | * @param token A valid SecurityToken | |
| 77 | * @return a response item with the list of activities. | |
| 78 | */ | |
| 79 | Future<Activity> getActivity(UserId userId, GroupId groupId, String appId, | |
| 80 | Set<String> fields, String activityId, SecurityToken token) | |
| 81 | throws SocialSpiException; | |
| 82 | ||
| 83 | /** | |
| 84 | * Deletes the activity for the passed in user and group that corresponds to the activityId. | |
| 85 | * | |
| 86 | * @param userId The user. | |
| 87 | * @param groupId The group. | |
| 88 | * @param appId The app id. | |
| 89 | * @param activityIds A list of activity ids to delete. | |
| 90 | * @param token A valid SecurityToken. | |
| 91 | * @return a response item containing any errors | |
| 92 | */ | |
| 93 | Future<Void> deleteActivities(UserId userId, GroupId groupId, String appId, | |
| 94 | Set<String> activityIds, SecurityToken token) throws SocialSpiException; | |
| 95 | ||
| 96 | /** | |
| 97 | * Creates the passed in activity for the passed in user and group. Once createActivity is called, | |
| 98 | * getActivities will be able to return the Activity. | |
| 99 | * | |
| 100 | * @param userId The id of the person to create the activity for. | |
| 101 | * @param groupId The group. | |
| 102 | * @param appId The app id. | |
| 103 | * @param fields The fields to return. | |
| 104 | * @param activity The activity to create. | |
| 105 | * @param token A valid SecurityToken | |
| 106 | * @return a response item containing any errors | |
| 107 | */ | |
| 108 | Future<Void> createActivity(UserId userId, GroupId groupId, String appId, | |
| 109 | Set<String> fields, Activity activity, SecurityToken token) throws SocialSpiException; | |
| 110 | } |