Spring Social Yammer

org.springframework.social.yammer.api
Interface MessageOperations

All Known Implementing Classes:
MessageTemplate

public interface MessageOperations

Sub-API for all message related operations

Author:
Morten Andersen-Gott

Field Summary
static java.lang.String NO_THREADING
          Convenience constant not threading Will return first message of each thread and the last two messages of each thread.
static java.lang.String THREADED
          Convenience constant for viewing messages by thread.
static java.lang.String THREADED_EXTENDED
          Convenience constant for viewing messages as extended threads.
 
Method Summary
 void delete(long messageId)
          Deletes a message, current user must be owner
 MessageInfo getMessages(long olderThan, long newerThan, java.lang.String threadedView, int limit)
          Gets messages from the company feed, essentially all messages posted in a Yammer network
 MessageInfo getMessagesAboutTopic(long topicId, long olderThan, long newerThan, java.lang.String threadedView, int limit)
          Gets messages on a specified topic
 MessageInfo getMessagesFollowing(long olderThan, long newerThan, java.lang.String threadedView, int limit)
          Gets messages from groups, topics and users you are following
 MessageInfo getMessagesFromUser(long userId, long olderThan, long newerThan, java.lang.String threadedView, int limit)
          Gets the message posted by a given user
 MessageInfo getMessagesInThread(long threadId, long olderThan, long newerThan, int limit)
          Get all messages for a thread
 MessageInfo getMessagesLikedByUser(long userId, long olderThan, long newerThan, java.lang.String threadedView, int limit)
          Gets messages liked by a specified user
 MessageInfo getMessagesPrivate(long olderThan, long newerThan, java.lang.String threadedView, int limit)
          Gets your private messages
 MessageInfo getMessagesReceived(long olderThan, long newerThan, java.lang.String threadedView, int limit)
          Gets messages you've received
 MessageInfo getMessagesSent(long olderThan, long newerThan, java.lang.String threadedView, int limit)
          Gets your sent messages
 void like(long messageId)
          Lets the logged in user like a message
 MessageInfo postUpdate(java.lang.String message)
          Post a textual message to your network
 MessageInfo postUpdate(java.lang.String message, YammerPostDetails details)
          Post an update to your network with details (ie attachments etc)
 void unlike(long messageId)
          Unlike a message that has previously been liked by logged in user
 

Field Detail

THREADED

static final java.lang.String THREADED
Convenience constant for viewing messages by thread. Will return first message of each thread.

See Also:
Constant Field Values

THREADED_EXTENDED

static final java.lang.String THREADED_EXTENDED
Convenience constant for viewing messages as extended threads. Will return first message of each thread and the last two messages of each thread.

See Also:
Constant Field Values

NO_THREADING

static final java.lang.String NO_THREADING
Convenience constant not threading Will return first message of each thread and the last two messages of each thread.

Method Detail

getMessages

MessageInfo getMessages(long olderThan,
                        long newerThan,
                        java.lang.String threadedView,
                        int limit)
Gets messages from the company feed, essentially all messages posted in a Yammer network

Parameters:
olderThan - return only messages older than this message id
newerThan - return only messages newer than this message id
threadedView - type of threaded view or null if no threaded view is required. Valid values are: THREADED_EXTENDED: return first message of thread and two most recent messages of thread, THREADED: returns first message of each thread, NO_THREADING: no threading
limit - the limit of number of messages returned (50 max)
Returns:
MessageInfo containing meta data and a list of messages
See Also:
THREADED, THREADED_EXTENDED, NO_THREADING

like

void like(long messageId)
Lets the logged in user like a message

Parameters:
messageId - id to like

unlike

void unlike(long messageId)
Unlike a message that has previously been liked by logged in user

Parameters:
messageId - id to unlike

getMessagesFromUser

MessageInfo getMessagesFromUser(long userId,
                                long olderThan,
                                long newerThan,
                                java.lang.String threadedView,
                                int limit)
Gets the message posted by a given user

Parameters:
userId - the user id you want to see the messages for
olderThan - return only messages older than this message id
newerThan - return only messages newer than this message id
threadedView - type of threaded view or null if no threaded view is required. Valid values are: THREADED_EXTENDED: return first message of thread and two most recent messages of thread, THREADED: returns first message of each thread, NO_THREADING: no threading
limit - the limit of number of messages returned (50 max)
Returns:
MessageInfo containing meta data and a list of messages
See Also:
THREADED, THREADED_EXTENDED, NO_THREADING

getMessagesPrivate

MessageInfo getMessagesPrivate(long olderThan,
                               long newerThan,
                               java.lang.String threadedView,
                               int limit)
Gets your private messages

Parameters:
olderThan - return only messages older than this message id
newerThan - return only messages newer than this message id
threadedView - type of threaded view or null if no threaded view is required. Valid values are: THREADED_EXTENDED: return first message of thread and two most recent messages of thread, THREADED: returns first message of each thread, NO_THREADING: no threading
limit - the limit of number of messages returned (50 max)
Returns:
MessageInfo containing meta data and a list of messages
See Also:
THREADED, THREADED_EXTENDED, NO_THREADING

getMessagesSent

MessageInfo getMessagesSent(long olderThan,
                            long newerThan,
                            java.lang.String threadedView,
                            int limit)
Gets your sent messages

Parameters:
olderThan - return only messages older than this message id
newerThan - return only messages newer than this message id
threadedView - type of threaded view or null if no threaded view is required. Valid values are: THREADED_EXTENDED: return first message of thread and two most recent messages of thread, THREADED: returns first message of each thread, NO_THREADING: no threading
limit - the limit of number of messages returned (50 max)
Returns:
MessageInfo containing meta data and a list of messages
See Also:
THREADED, THREADED_EXTENDED, NO_THREADING

getMessagesFollowing

MessageInfo getMessagesFollowing(long olderThan,
                                 long newerThan,
                                 java.lang.String threadedView,
                                 int limit)
Gets messages from groups, topics and users you are following

Parameters:
olderThan - return only messages older than this message id
newerThan - return only messages newer than this message id
threadedView - type of threaded view or null if no threaded view is required. Valid values are: THREADED_EXTENDED: return first message of thread and two most recent messages of thread, THREADED: returns first message of each thread, NO_THREADING: no threading
limit - the limit of number of messages returned (50 max)
Returns:
MessageInfo containing meta data and a list of messages
See Also:
THREADED, THREADED_EXTENDED, NO_THREADING

getMessagesReceived

MessageInfo getMessagesReceived(long olderThan,
                                long newerThan,
                                java.lang.String threadedView,
                                int limit)
Gets messages you've received

Parameters:
olderThan - return only messages older than this message id
newerThan - return only messages newer than this message id
threadedView - type of threaded view or null if no threaded view is required. Valid values are: THREADED_EXTENDED: return first message of thread and two most recent messages of thread, THREADED: returns first message of each thread, NO_THREADING: no threading
limit - the limit of number of messages returned (50 max)
Returns:
MessageInfo containing meta data and a list of messages
See Also:
THREADED, THREADED_EXTENDED, NO_THREADING

getMessagesAboutTopic

MessageInfo getMessagesAboutTopic(long topicId,
                                  long olderThan,
                                  long newerThan,
                                  java.lang.String threadedView,
                                  int limit)
Gets messages on a specified topic

Parameters:
topicId - the id of the topic for which you want to see messages
olderThan - return only messages older than this message id
newerThan - return only messages newer than this message id
threadedView - type of threaded view or null if no threaded view is required. Valid values are: THREADED_EXTENDED: return first message of thread and two most recent messages of thread, THREADED: returns first message of each thread, NO_THREADING: no threading
limit - the limit of number of messages returned (50 max)
Returns:
MessageInfo containing meta data and a list of messages
See Also:
THREADED, THREADED_EXTENDED, NO_THREADING

getMessagesLikedByUser

MessageInfo getMessagesLikedByUser(long userId,
                                   long olderThan,
                                   long newerThan,
                                   java.lang.String threadedView,
                                   int limit)
Gets messages liked by a specified user

Parameters:
userId - of the person who've liked the messages
olderThan - return only messages older than this message id
newerThan - return only messages newer than this message id
threadedView - type of threaded view or null if no threaded view is required. Valid values are: THREADED_EXTENDED: return first message of thread and two most recent messages of thread, THREADED: returns first message of each thread, NO_THREADING: no threading
limit - the limit of number of messages returned (50 max)
Returns:
MessageInfo containing meta data and a list of messages
See Also:
THREADED, THREADED_EXTENDED, NO_THREADING

getMessagesInThread

MessageInfo getMessagesInThread(long threadId,
                                long olderThan,
                                long newerThan,
                                int limit)
Get all messages for a thread

Parameters:
threadId - id of the thread for which messages will be returned
olderThan - return only messages older than this message id
newerThan - return only messages newer than this message id
limit - the limit of number of messages returned (50 max)
Returns:
MessageInfo containing meta data and a list of messages

postUpdate

MessageInfo postUpdate(java.lang.String message,
                       YammerPostDetails details)
Post an update to your network with details (ie attachments etc)

Parameters:
message - the text part of your message
details - additional details for your message
Returns:
MessageInfo containing meta data and your newly posted message

postUpdate

MessageInfo postUpdate(java.lang.String message)
Post a textual message to your network

Parameters:
message -
Returns:
MessageInfo containing meta data and your newly posted message

delete

void delete(long messageId)
Deletes a message, current user must be owner

Parameters:
messageId -
Throws:
org.springframework.social.OperationNotPermittedException - if the message does not exist or you are not the owner of that message

Spring Social Yammer