org.apache.shindig.social.opensocial.service
Class AppDataHandler

java.lang.Object
  extended by org.apache.shindig.social.opensocial.service.AppDataHandler

public class AppDataHandler
extends Object

Handles REST/RPC requests for AppData


Constructor Summary
AppDataHandler(AppDataService service)
           
 
Method Summary
 Future<?> create(SocialRequestItem request)
          /appdata/{userId}/{groupId}/{appId} - fields={field1, field2} examples: /appdata/john.doe/@friends/app?fields=count /appdata/john.doe/@self/app The post data should be a regular json object.
 Future<?> delete(SocialRequestItem request)
          Allowed endpoints /appdata/{userId}/{groupId}/{appId} - fields={field1, field2} examples: /appdata/john.doe/@friends/app?fields=count /appdata/john.doe/@self/app The post data should be a regular json object.
 Future<?> get(SocialRequestItem request)
          /appdata/{userId}+/{groupId}/{appId} - fields={field1, field2} examples: /appdata/john.doe/@friends/app?fields=count /appdata/john.doe/@self/app
static boolean isValidKey(String key)
          Determines whether the input is a valid key.
 Future<?> update(SocialRequestItem request)
          Allowed endpoints /appdata/{userId}/{groupId}/{appId} - fields={field1, field2} examples: /appdata/john.doe/@friends/app?fields=count /appdata/john.doe/@self/app The post data should be a regular json object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppDataHandler

@Inject
public AppDataHandler(AppDataService service)
Method Detail

delete

public Future<?> delete(SocialRequestItem request)
                 throws ProtocolException
Allowed endpoints /appdata/{userId}/{groupId}/{appId} - fields={field1, field2} examples: /appdata/john.doe/@friends/app?fields=count /appdata/john.doe/@self/app The post data should be a regular json object. All of the fields vars will be pulled from the values and set on the person object. If there are no fields vars then all of the data will be overridden.

Throws:
ProtocolException

update

public Future<?> update(SocialRequestItem request)
                 throws ProtocolException
Allowed endpoints /appdata/{userId}/{groupId}/{appId} - fields={field1, field2} examples: /appdata/john.doe/@friends/app?fields=count /appdata/john.doe/@self/app The post data should be a regular json object. All of the fields vars will be pulled from the values and set on the person object. If there are no fields vars then all of the data will be overridden.

Throws:
ProtocolException

create

public Future<?> create(SocialRequestItem request)
                 throws ProtocolException
/appdata/{userId}/{groupId}/{appId} - fields={field1, field2} examples: /appdata/john.doe/@friends/app?fields=count /appdata/john.doe/@self/app The post data should be a regular json object. All of the fields vars will be pulled from the values and set. If there are no fields vars then all of the data will be overridden.

Throws:
ProtocolException

get

public Future<?> get(SocialRequestItem request)
              throws ProtocolException
/appdata/{userId}+/{groupId}/{appId} - fields={field1, field2} examples: /appdata/john.doe/@friends/app?fields=count /appdata/john.doe/@self/app

Throws:
ProtocolException

isValidKey

public static boolean isValidKey(String key)
Determines whether the input is a valid key. Valid keys match the regular expression [\w\-\.]+. The logic is not done using java.util.regex.* as that is 20X slower.

Parameters:
key - the key to validate.
Returns:
true if the key is a valid appdata key, false otherwise.


Copyright © 2007-2012. All Rights Reserved.