com.atlassian.gadgets.opensocial.spi
Interface AppDataService


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(com.atlassian.gadgets.opensocial.model.PersonId personId, com.atlassian.gadgets.opensocial.model.AppId appId, com.atlassian.gadgets.opensocial.OpenSocialRequestContext requestContext)
          Delete all application data for the specified person and all fields
 void deletePersonData(com.atlassian.gadgets.opensocial.model.PersonId personId, com.atlassian.gadgets.opensocial.model.AppId appId, Set<String> fields, com.atlassian.gadgets.opensocial.OpenSocialRequestContext requestContext)
          Delete all application data for the specified person and fields
 Map<com.atlassian.gadgets.opensocial.model.PersonId,Map<String,String>> getPeopleData(Set<com.atlassian.gadgets.opensocial.model.PersonId> people, com.atlassian.gadgets.opensocial.model.AppId appId, com.atlassian.gadgets.opensocial.OpenSocialRequestContext requestContext)
          Fetch the application data for the specified people and all fields
 Map<com.atlassian.gadgets.opensocial.model.PersonId,Map<String,String>> getPeopleData(Set<com.atlassian.gadgets.opensocial.model.PersonId> people, com.atlassian.gadgets.opensocial.model.AppId appId, Set<String> fields, com.atlassian.gadgets.opensocial.OpenSocialRequestContext requestContext)
          Fetch the application data for the specified people
 void updatePersonData(com.atlassian.gadgets.opensocial.model.PersonId personId, com.atlassian.gadgets.opensocial.model.AppId appId, Map<String,String> values, com.atlassian.gadgets.opensocial.OpenSocialRequestContext requestContext)
          Update (add or modify) application data for the specified person with the specified field / value pairs.
 

Method Detail

getPeopleData

Map<com.atlassian.gadgets.opensocial.model.PersonId,Map<String,String>> getPeopleData(Set<com.atlassian.gadgets.opensocial.model.PersonId> people,
                                                                                      com.atlassian.gadgets.opensocial.model.AppId appId,
                                                                                      Set<String> fields,
                                                                                      com.atlassian.gadgets.opensocial.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<com.atlassian.gadgets.opensocial.model.PersonId,Map<String,String>> getPeopleData(Set<com.atlassian.gadgets.opensocial.model.PersonId> people,
                                                                                      com.atlassian.gadgets.opensocial.model.AppId appId,
                                                                                      com.atlassian.gadgets.opensocial.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(com.atlassian.gadgets.opensocial.model.PersonId personId,
                      com.atlassian.gadgets.opensocial.model.AppId appId,
                      Set<String> fields,
                      com.atlassian.gadgets.opensocial.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(com.atlassian.gadgets.opensocial.model.PersonId personId,
                      com.atlassian.gadgets.opensocial.model.AppId appId,
                      com.atlassian.gadgets.opensocial.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(com.atlassian.gadgets.opensocial.model.PersonId personId,
                      com.atlassian.gadgets.opensocial.model.AppId appId,
                      Map<String,String> values,
                      com.atlassian.gadgets.opensocial.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.