org.apache.shindig.social.opensocial.spi
Interface MessageService

All Known Implementing Classes:
JsonDbOpensocialService, MessageService.NotImplementedMessageService

public interface MessageService

The MessageService interface defines the service provider interface to post messages to the underlying SNS.


Nested Class Summary
static class MessageService.NotImplementedMessageService
           
 
Method Summary
 java.util.concurrent.Future<java.lang.Void> createMessage(UserId userId, java.lang.String appId, java.lang.String msgCollId, Message message, SecurityToken token)
          Posts a message to the user's specified message collection, to be sent to the set of recipients specified in the message.
 java.util.concurrent.Future<MessageCollection> createMessageCollection(UserId userId, MessageCollection msgCollection, SecurityToken token)
          Creates a new message collection for the given arguments
 java.util.concurrent.Future<java.lang.Void> deleteMessageCollection(UserId userId, java.lang.String msgCollId, SecurityToken token)
          Deletes a message collection for the given arguments
 java.util.concurrent.Future<java.lang.Void> deleteMessages(UserId userId, java.lang.String msgCollId, java.util.List<java.lang.String> ids, SecurityToken token)
          Deletes a set of messages for a given user/message collection
 java.util.concurrent.Future<RestfulCollection<MessageCollection>> getMessageCollections(UserId userId, java.util.Set<java.lang.String> fields, CollectionOptions options, SecurityToken token)
          Returns a list of message collections corresponding to the given user
 java.util.concurrent.Future<RestfulCollection<Message>> getMessages(UserId userId, java.lang.String msgCollId, java.util.Set<java.lang.String> fields, java.util.List<java.lang.String> msgIds, CollectionOptions options, SecurityToken token)
          Returns a list of messages that correspond to the passed in data
 java.util.concurrent.Future<java.lang.Void> modifyMessage(UserId userId, java.lang.String msgCollId, java.lang.String messageId, Message message, SecurityToken token)
          Modifies/Updates a specific message with new data
 java.util.concurrent.Future<java.lang.Void> modifyMessageCollection(UserId userId, MessageCollection msgCollection, SecurityToken token)
          Modifies/Updates a message collection for the given arguments
 

Method Detail

getMessageCollections

java.util.concurrent.Future<RestfulCollection<MessageCollection>> getMessageCollections(UserId userId,
                                                                                        java.util.Set<java.lang.String> fields,
                                                                                        CollectionOptions options,
                                                                                        SecurityToken token)
                                                                                        throws ProtocolException
Returns a list of message collections corresponding to the given user

Parameters:
userId - The User to fetch for
fields - The fields to fetch for the message collections
options - Pagination, etal
token - Given security token for this request
Returns:
a collection of message collections.
Throws:
ProtocolException - when invalid parameters are given

createMessageCollection

java.util.concurrent.Future<MessageCollection> createMessageCollection(UserId userId,
                                                                       MessageCollection msgCollection,
                                                                       SecurityToken token)
                                                                       throws ProtocolException
Creates a new message collection for the given arguments

Parameters:
userId - The userId to create the message collection for
msgCollection - A message collection that is to be created
token - A security token for this request
Returns:
Data for the message collection that is created
Throws:
ProtocolException - when invalid parameters are given or not implemented

modifyMessageCollection

java.util.concurrent.Future<java.lang.Void> modifyMessageCollection(UserId userId,
                                                                    MessageCollection msgCollection,
                                                                    SecurityToken token)
                                                                    throws ProtocolException
Modifies/Updates a message collection for the given arguments

Parameters:
userId - The userId to modify the message collection for
msgCollection - Data for the message collection to be modified
token - A security token for this request
Throws:
ProtocolException - when invalid parameters are given or not implemented

deleteMessageCollection

java.util.concurrent.Future<java.lang.Void> deleteMessageCollection(UserId userId,
                                                                    java.lang.String msgCollId,
                                                                    SecurityToken token)
                                                                    throws ProtocolException
Deletes a message collection for the given arguments

Parameters:
userId - The userId to create the message collection for
msgCollId - Data for the message collection to be modified
token - A security token for this request
Returns:
Future
Throws:
ProtocolException - when invalid parameters are given, the message collection does not exist or not implemented

getMessages

java.util.concurrent.Future<RestfulCollection<Message>> getMessages(UserId userId,
                                                                    java.lang.String msgCollId,
                                                                    java.util.Set<java.lang.String> fields,
                                                                    java.util.List<java.lang.String> msgIds,
                                                                    CollectionOptions options,
                                                                    SecurityToken token)
                                                                    throws ProtocolException
Returns a list of messages that correspond to the passed in data

Parameters:
userId - The User to fetch for
msgCollId - The message Collection ID to fetch from, default @all
fields - The fields to fetch for the messages
msgIds - An explicit set of message ids to fetch
options - Options to control the fetch
token - Given security token for this request
Returns:
a collection of messages
Throws:
ProtocolException - when invalid parameters are given

createMessage

java.util.concurrent.Future<java.lang.Void> createMessage(UserId userId,
                                                          java.lang.String appId,
                                                          java.lang.String msgCollId,
                                                          Message message,
                                                          SecurityToken token)
                                                          throws ProtocolException
Posts a message to the user's specified message collection, to be sent to the set of recipients specified in the message.

Parameters:
userId - The user posting the message.
appId - The app id
msgCollId - The message collection Id to post to, default @outbox
message - The message to post
token - A valid security token @return a response item containing any errors/
Returns:
Void Future
Throws:
ProtocolException - when invalid parameters are given

deleteMessages

java.util.concurrent.Future<java.lang.Void> deleteMessages(UserId userId,
                                                           java.lang.String msgCollId,
                                                           java.util.List<java.lang.String> ids,
                                                           SecurityToken token)
                                                           throws ProtocolException
Deletes a set of messages for a given user/message collection

Parameters:
userId - The User to delete for
msgCollId - The Message Collection ID to delete from, default @all
ids - List of IDs to delete
token - Given Security Token for this request
Returns:
Future
Throws:
ProtocolException

modifyMessage

java.util.concurrent.Future<java.lang.Void> modifyMessage(UserId userId,
                                                          java.lang.String msgCollId,
                                                          java.lang.String messageId,
                                                          Message message,
                                                          SecurityToken token)
                                                          throws ProtocolException
Modifies/Updates a specific message with new data

Parameters:
userId - The User to modify for
msgCollId - The Message Collection ID to modify from, default @all
messageId - The messageId to modify
message - The message details to modify
token - Given Security Token for this request
Returns:
Future
Throws:
ProtocolException - for invalid parameters or missing messages or users


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.