org.wso2.carbon.registry.social.api.message
Interface MessageManager


public interface MessageManager

This interface handles messages and message collections related to people and applications

Implement this interface to according to the persistence storage of social data


Method Summary
 void createMessage(String userId, String msgCollectionId, Message message)
          Posts a message to the user's specified message collection, to be sent to the set of recipients specified in the message
 void createMessage(String userId, String appId, String msgCollectionId, Message message)
          Posts a message to the user's specified message collection, to be sent to the set of recipients specified in the message
 void createMessageCollection(String userId, MessageCollection msgCollection, String messageCollectionId)
          Creates a MessageCollection of the the user with given id and attributes
 void deleteMessageCollection(String userId, String messageCollectionId)
          Deletes a message collection for the given arguments
 void deleteMessages(String userId, String msgCollectionId, List<String> messageIds)
          Deletes a set of messages for a given user/message collection
 MessageCollection[] getMessageCollections(String userId, Set<String> fields, FilterOptions options)
          Returns an array of message collections corresponding to the given user details
 Message[] getMessages(String userId, String msgCollectionId, Set<String> fields, List<String> msgIds, FilterOptions options)
          Returns an array of messages that correspond to the passed in data
 void modifyMessage(String userId, String msgCollId, String messageId, Message message)
          Modifies/Updates a specific message with new data
 void modifyMessageCollection(String userId, MessageCollection msgCollection, String messageCollectionId)
          Modifies/Updates a message collection for the given arguments
 

Method Detail

getMessageCollections

MessageCollection[] getMessageCollections(String userId,
                                          Set<String> fields,
                                          FilterOptions options)
                                          throws SocialMessageException
Returns an array of message collections corresponding to the given user details

Parameters:
userId - The userId to fetch for
fields - The fields to fetch for the message collections
options - Pagination details
Returns:
An array of MessageCollection
Throws:
SocialMessageException

createMessageCollection

void createMessageCollection(String userId,
                             MessageCollection msgCollection,
                             String messageCollectionId)
                             throws SocialMessageException
Creates a MessageCollection of the the user with given id and attributes

Parameters:
userId - The userId to which the collection belongs to
msgCollection - The MessageCollection object to retrieve the attrobutes
messageCollectionId - The id of the message collection
Throws:
SocialMessageException

deleteMessageCollection

void deleteMessageCollection(String userId,
                             String messageCollectionId)
                             throws SocialMessageException
Deletes a message collection for the given arguments

Parameters:
userId - The userId to create the message collection for
messageCollectionId - The message Collection ID to be removed
Throws:
SocialMessageException

modifyMessageCollection

void modifyMessageCollection(String userId,
                             MessageCollection msgCollection,
                             String messageCollectionId)
                             throws SocialMessageException
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
messageCollectionId - The message Collection ID to modify
Throws:
SocialMessageException

getMessages

Message[] getMessages(String userId,
                      String msgCollectionId,
                      Set<String> fields,
                      List<String> msgIds,
                      FilterOptions options)
                      throws SocialMessageException
Returns an array of messages that correspond to the passed in data

Parameters:
userId - The userId of the person to fetch message for
msgCollectionId - 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
Returns:
Throws:
SocialMessageException

createMessage

void createMessage(String userId,
                   String msgCollectionId,
                   Message message)
                   throws SocialMessageException
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
msgCollectionId - The message collection Id to post to, default @outbox
message - The message object
Throws:
SocialMessageException

createMessage

void createMessage(String userId,
                   String appId,
                   String msgCollectionId,
                   Message message)
                   throws SocialMessageException
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
msgCollectionId - The message collection Id to post to, default @outbox
message - The message to post
Throws:
SocialMessageException

deleteMessages

void deleteMessages(String userId,
                    String msgCollectionId,
                    List<String> messageIds)
                    throws SocialMessageException
Deletes a set of messages for a given user/message collection

Parameters:
userId - The userId of the person whose messages to be deleted
msgCollectionId - The Message Collection ID to delete from, default @all
messageIds - List of messageIds to delete
Throws:
SocialMessageException

modifyMessage

void modifyMessage(String userId,
                   String msgCollId,
                   String messageId,
                   Message message)
                   throws SocialMessageException
Modifies/Updates a specific message with new data

Parameters:
userId - The userId of the person whose messaged to be modified
msgCollId - The Message Collection ID to modify from, default @all
messageId - The messageId to modify
message - The message details to modify
Throws:
SocialMessageException


Copyright © 2015 WSO2. All Rights Reserved.