com.atlassian.gadgets.opensocial.spi
Interface AppDataService

All Known Implementing Classes:
PluginSettingsAppDataService

public interface AppDataService

Interface for handling application data requests. The appId parameter in the methods below is a unique identifier for a particular gadget (e.g. Chart Gadget).

This is an optional SPI that host applications may implement if they wish to provide the ability to read and store custom application data using the OpenSocial APIs. If the AppDataService is implemented, an implementation of [@link PersonService} must also be provided. If an implementation of AppDataService is not supplied, the OpenSocial appData API will not be supported, but other OpenSocial and Gadget functionality will work normally.

Application data is a per-Person, per-AppId persistent store of field / value pairs. The fields and values are stored as Strings. Implementations may choose to restrict the set of field names that may be stored. There is no default set of field names that must be supported.

Since:
2.0

Method Summary
 void deletePersonData(PersonId personId, AppId appId, OpenSocialRequestContext requestContext)
          Delete all application data for the specified person and all fields
 void deletePersonData(PersonId personId, AppId appId, Set<String> fields, OpenSocialRequestContext requestContext)
          Delete all application data for the specified person and fields
 Map<PersonId,Map<String,String>> getPeopleData(Set<PersonId> people, AppId appId, OpenSocialRequestContext requestContext)
          Fetch the application data for the specified people and all fields
 Map<PersonId,Map<String,String>> getPeopleData(Set<PersonId> people, AppId appId, Set<String> fields, OpenSocialRequestContext requestContext)
          Fetch the application data for the specified people
 void updatePersonData(PersonId personId, AppId appId, Map<String,String> values, OpenSocialRequestContext requestContext)
          Update (add or modify) application data for the specified person with the specified field / value pairs.
 

Method Detail

getPeopleData

Map<PersonId,Map<String,String>> getPeopleData(Set<PersonId> people,
                                               AppId appId,
                                               Set<String> fields,
                                               OpenSocialRequestContext requestContext)
                                               throws AppDataServiceException
Fetch the application data for the specified people

Parameters:
people - The people whose data is being requested
appId - The app id for the gadget making this request
fields - The requested fields
requestContext - The request context
Returns:
the data, as a map from person to field / value pairs
Throws:
AppDataServiceException - if there is a problem while performing this operation

getPeopleData

Map<PersonId,Map<String,String>> getPeopleData(Set<PersonId> people,
                                               AppId appId,
                                               OpenSocialRequestContext requestContext)
                                               throws AppDataServiceException
Fetch the application data for the specified people and all fields

Parameters:
people - The people whose data is being requested
appId - The app id for the gadget making this request
requestContext - The request context
Returns:
the data, as a map from person to field / value pairs. All field / value pairs for the person are returned
Throws:
AppDataServiceException

deletePersonData

void deletePersonData(PersonId personId,
                      AppId appId,
                      Set<String> fields,
                      OpenSocialRequestContext requestContext)
                      throws AppDataServiceException
Delete all application data for the specified person and fields

Parameters:
personId - The person whose data is being deleted
appId - The app id for the gadget making this request
fields - The requested fields
requestContext - The request context
Throws:
AppDataServiceException - if there is a problem while performing this operation

deletePersonData

void deletePersonData(PersonId personId,
                      AppId appId,
                      OpenSocialRequestContext requestContext)
                      throws AppDataServiceException
Delete all application data for the specified person and all fields

Parameters:
personId - The person whose data is being deleted
appId - The app id for the gadget making this request
requestContext - The request context
Throws:
AppDataServiceException - if there is a problem while performing this operation

updatePersonData

void updatePersonData(PersonId personId,
                      AppId appId,
                      Map<String,String> values,
                      OpenSocialRequestContext requestContext)
                      throws AppDataServiceException
Update (add or modify) application data for the specified person with the specified field / value pairs.

Parameters:
personId - The person whose data is being updated
appId - The app id for the gadget making this request
values - The new values for the fields to take on
requestContext - The request context
Throws:
AppDataServiceException - if there is a problem while performing this operation


Copyright © 2011 Atlassian. All Rights Reserved.