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
 Future<Void> createMessage(UserId userId, String appId, 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.
 Future<MessageCollection> createMessageCollection(UserId userId, MessageCollection msgCollection, SecurityToken token)
          Creates a new message collection for the given arguments
 Future<Void> deleteMessageCollection(UserId userId, String msgCollId, SecurityToken token)
          Deletes a message collection for the given arguments
 Future<Void> deleteMessages(UserId userId, String msgCollId, List<String> ids, SecurityToken token)
          Deletes a set of messages for a given user/message collection
 Future<RestfulCollection<MessageCollection>> getMessageCollections(UserId userId, Set<String> fields, CollectionOptions options, SecurityToken token)
          Returns a list of message collections corresponding to the given user
 Future<RestfulCollection<Message>> getMessages(UserId userId, String msgCollId, Set<String> fields, List<String> msgIds, CollectionOptions options, SecurityToken token)
          Returns a list of messages that correspond to the passed in data
 Future<Void> modifyMessage(UserId userId, String msgCollId, String messageId, Message message, SecurityToken token)
          Modifies/Updates a specific message with new data
 Future<Void> modifyMessageCollection(UserId userId, MessageCollection msgCollection, SecurityToken token)
          Modifies/Updates a message collection for the given arguments
 

Method Detail

getMessageCollections

Future<RestfulCollection<MessageCollection>> getMessageCollections(UserId userId,
                                                                   Set<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

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

Future<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

Future<Void> deleteMessageCollection(UserId userId,
                                     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

Future<RestfulCollection<Message>> getMessages(UserId userId,
                                               String msgCollId,
                                               Set<String> fields,
                                               List<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

Future<Void> createMessage(UserId userId,
                           String appId,
                           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

Future<Void> deleteMessages(UserId userId,
                            String msgCollId,
                            List<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

Future<Void> modifyMessage(UserId userId,
                           String msgCollId,
                           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. All Rights Reserved.