|
Spring Social Twitter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DirectMessageOperations
Interface defining the Twitter operations for working with direct messages.
Method Summary | |
---|---|
void |
deleteDirectMessage(long messageId)
Deletes a direct message for the authenticated user. |
DirectMessage |
getDirectMessage(long id)
Gets a direct message by its ID. |
java.util.List<DirectMessage> |
getDirectMessagesReceived()
Retrieve the 20 most recently received direct messages for the authenticating user. |
java.util.List<DirectMessage> |
getDirectMessagesReceived(int page,
int pageSize)
Retrieve received direct messages for the authenticating user. |
java.util.List<DirectMessage> |
getDirectMessagesReceived(int page,
int pageSize,
long sinceId,
long maxId)
Retrieve received direct messages for the authenticating user. |
java.util.List<DirectMessage> |
getDirectMessagesSent()
Retrieve the 20 most recent direct messages sent by the authenticating user. |
java.util.List<DirectMessage> |
getDirectMessagesSent(int page,
int pageSize)
Retrieve direct messages sent by the authenticating user. |
java.util.List<DirectMessage> |
getDirectMessagesSent(int page,
int pageSize,
long sinceId,
long maxId)
Retrieve direct messages sent by the authenticating user. |
DirectMessage |
sendDirectMessage(long toUserId,
java.lang.String text)
Sends a direct message to another Twitter user. |
DirectMessage |
sendDirectMessage(java.lang.String toScreenName,
java.lang.String text)
Sends a direct message to another Twitter user. |
Method Detail |
---|
java.util.List<DirectMessage> getDirectMessagesReceived()
DirectMessage
with the authenticating user as the recipient.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.java.util.List<DirectMessage> getDirectMessagesReceived(int page, int pageSize)
page
- The page to returnpageSize
- The number of DirectMessage
s per page. Should be less than or equal to 200. (Will return at most 200 entries, even if pageSize is greater than 200.)
DirectMessage
with the authenticating user as the recipient.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.java.util.List<DirectMessage> getDirectMessagesReceived(int page, int pageSize, long sinceId, long maxId)
page
- The page to returnpageSize
- The number of DirectMessage
s per page. Should be less than or equal to 200. (Will return at most 200 entries, even if pageSize is greater than 200.)sinceId
- The minimum DirectMessage
ID to return in the resultsmaxId
- The maximum DirectMessage
ID to return in the results
DirectMessage
with the authenticating user as the recipient.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.java.util.List<DirectMessage> getDirectMessagesSent()
DirectMessage
with the authenticating user as the sender.
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.java.util.List<DirectMessage> getDirectMessagesSent(int page, int pageSize)
page
- The page to returnpageSize
- The number of DirectMessage
s per page. Should be less than or equal to 200. (Will return at most 200 entries, even if pageSize is greater than 200.)
DirectMessage
with the authenticating user as the sender.
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.java.util.List<DirectMessage> getDirectMessagesSent(int page, int pageSize, long sinceId, long maxId)
page
- The page to returnpageSize
- The number of DirectMessage
s per page. Should be less than or equal to 200. (Will return at most 200 entries, even if pageSize is greater than 200.)sinceId
- The minimum DirectMessage
ID to return in the resultsmaxId
- The maximum DirectMessage
ID to return in the results
DirectMessage
with the authenticating user as the sender.
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.DirectMessage getDirectMessage(long id)
id
- the message ID
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.DirectMessage sendDirectMessage(java.lang.String toScreenName, java.lang.String text)
InvalidMessageRecipientException
will be thrown.
toScreenName
- the screen name of the recipient of the messages.text
- the message text.
DirectMessage
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.
InvalidMessageRecipientException
- if the recipient is not following the authenticating user.
DuplicateTweetException
- if the message duplicates a previously sent message.
MessageTooLongException
- if the message length exceeds Twitter's 140 character limit.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.DirectMessage sendDirectMessage(long toUserId, java.lang.String text)
InvalidMessageRecipientException
will be thrown.
toUserId
- the Twitter user ID of the recipient of the messages.text
- the message text.
DirectMessage
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.
InvalidMessageRecipientException
- if the recipient is not following the authenticating user.
DuplicateTweetException
- if the message duplicates a previously sent message.
MessageTooLongException
- if the message length exceeds Twitter's 140 character limit.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.void deleteDirectMessage(long messageId)
messageId
- the ID of the message to be removed.
org.springframework.social.ApiException
- if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException
- if TwitterTemplate was not created with OAuth credentials.
|
Spring Social Twitter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |