| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AppDataService |
|
| 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.sample.spi.JsonDbOpensocialService; | |
| 22 | ||
| 23 | import com.google.inject.ImplementedBy; | |
| 24 | ||
| 25 | import java.util.Map; | |
| 26 | import java.util.Set; | |
| 27 | import java.util.concurrent.Future; | |
| 28 | ||
| 29 | /** | |
| 30 | * Data Service SPI interface. This interface represents is used to retrieve information bound to a | |
| 31 | * person, there are methods to update and delete data. | |
| 32 | */ | |
| 33 | @ImplementedBy(JsonDbOpensocialService.class) | |
| 34 | public interface AppDataService { | |
| 35 | ||
| 36 | /** | |
| 37 | * Retrives app data for the specified user list and group. | |
| 38 | * | |
| 39 | * @param userIds A set of UserIds. | |
| 40 | * @param groupId The group | |
| 41 | * @param appId The app | |
| 42 | * @param fields The fields to filter the data by. Empty set implies all | |
| 43 | * @param token The security token | |
| 44 | * @return The data fetched | |
| 45 | */ | |
| 46 | Future<DataCollection> getPersonData(Set<UserId> userIds, GroupId groupId, | |
| 47 | String appId, Set<String> fields, SecurityToken token) throws SocialSpiException; | |
| 48 | ||
| 49 | /** | |
| 50 | * Deletes data for the specified user and group. | |
| 51 | * | |
| 52 | * @param userId The user | |
| 53 | * @param groupId The group | |
| 54 | * @param appId The app | |
| 55 | * @param fields The fields to delete. Empty set implies all | |
| 56 | * @param token The security token | |
| 57 | * @return an error if one occurs | |
| 58 | */ | |
| 59 | Future<Void> deletePersonData(UserId userId, GroupId groupId, | |
| 60 | String appId, Set<String> fields, SecurityToken token) throws SocialSpiException; | |
| 61 | ||
| 62 | /** | |
| 63 | * Updates app data for the specified user and group with the new values. | |
| 64 | * | |
| 65 | * @param userId The user | |
| 66 | * @param groupId The group | |
| 67 | * @param appId The app | |
| 68 | * @param fields The fields to filter the data by. Empty set implies all | |
| 69 | * @param values The values to set | |
| 70 | * @param token The security token | |
| 71 | * @return an error if one occurs | |
| 72 | */ | |
| 73 | Future<Void> updatePersonData(UserId userId, GroupId groupId, | |
| 74 | String appId, Set<String> fields, Map<String, String> values, SecurityToken token) | |
| 75 | throws SocialSpiException; | |
| 76 | } |