Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.webservices.server
Class PrivateMessageServiceImpl

java.lang.Object
  extended by com.jivesoftware.forum.webservices.server.PrivateMessageServiceImpl
All Implemented Interfaces:
PrivateMessageService

public class PrivateMessageServiceImpl
extends java.lang.Object
implements PrivateMessageService


Constructor Summary
PrivateMessageServiceImpl()
           
 
Method Summary
 PrivateMessageFolder createFolder(long userID, java.lang.String name)
          Create a named folder for the specified user.
 PrivateMessage createMessage(long senderID)
          Creates a new private message.
 void deleteFolder(long userID, int folderID)
          Delete the specified folder id for a user.
 void deleteMessage(long userID, long messageID)
          Deletes a private message from the folder by moving it to the trash folder.
 PrivateMessageFolder getFolder(long userID, int folderID)
          Returns the specified folder for a user.
 PrivateMessageFolder[] getFolders(long userID)
          Returns an array of Private Message folders for a specified user.
 PrivateMessage getMessage(long privateMessageID)
          Returns the specified private message.
 int getMessageCount(long userID)
          Returns the total message count for a specified user.
 int getMessageCountForFolder(long userID, int folderID)
          Returns the message count on a specific folder.
 PrivateMessage[] getMessages(long userID, int folderID)
          Returns all the messages in the folder sorted by date descending.
 int getUnreadMessageCount(long userID)
          Returns the total number of unread messages for a user.
 int getUnreadMessageCountForFolder(long userID, int folderID)
          Returns the unread message count for a specified folder.
 boolean isPrivateMessagesEnabled()
          Returns whether or not Private Messaging is enabled or disabled.
 void moveMessage(long userID, long messageID, int destinationFolderID)
          Moves a private message to another folder.
 void saveMessageAsDraft(PrivateMessage privateMessage)
          Saves a message as a draft by storing it in the sender's Drafts folder.
 PrivateMessage sendMessage(PrivateMessage privateMessage, long recipientID, boolean copyToSentFolder)
          Sends a private message to another user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivateMessageServiceImpl

public PrivateMessageServiceImpl()
Method Detail

isPrivateMessagesEnabled

public boolean isPrivateMessagesEnabled()
Returns whether or not Private Messaging is enabled or disabled.

Specified by:
isPrivateMessagesEnabled in interface PrivateMessageService
Returns:
true if Private Messaging is enabled, false otherwise.

getMessages

public PrivateMessage[] getMessages(long userID,
                                    int folderID)
                             throws UserNotFoundException,
                                    PrivateMessageFolderNotFoundException
Description copied from interface: PrivateMessageService
Returns all the messages in the folder sorted by date descending.

Specified by:
getMessages in interface PrivateMessageService
Parameters:
userID -
folderID -
Returns:
Throws:
UserNotFoundException
PrivateMessageFolderNotFoundException

deleteMessage

public void deleteMessage(long userID,
                          long messageID)
                   throws UserNotFoundException,
                          PrivateMessageFolderNotFoundException,
                          PrivateMessageNotFoundException
Description copied from interface: PrivateMessageService
Deletes a private message from the folder by moving it to the trash folder. Messages in the Trash folder will be routinely automatically deleted. If this is the Trash folder, this method will do nothing.

Specified by:
deleteMessage in interface PrivateMessageService
Parameters:
userID -
messageID -
Throws:
UserNotFoundException
PrivateMessageFolderNotFoundException
PrivateMessageNotFoundException

moveMessage

public void moveMessage(long userID,
                        long messageID,
                        int destinationFolderID)
                 throws UserNotFoundException,
                        PrivateMessageFolderNotFoundException,
                        PrivateMessageNotFoundException
Description copied from interface: PrivateMessageService
Moves a private message to another folder.

Specified by:
moveMessage in interface PrivateMessageService
Parameters:
userID -
messageID -
destinationFolderID -
Throws:
UserNotFoundException
PrivateMessageFolderNotFoundException
PrivateMessageNotFoundException

getMessageCount

public int getMessageCount(long userID)
                    throws UnauthorizedException,
                           UserNotFoundException
Returns the total message count for a specified user.

Specified by:
getMessageCount in interface PrivateMessageService
Parameters:
userID -
Returns:
Throws:
UnauthorizedException
UserNotFoundException

getMessageCountForFolder

public int getMessageCountForFolder(long userID,
                                    int folderID)
                             throws UnauthorizedException,
                                    UserNotFoundException,
                                    PrivateMessageFolderNotFoundException
Description copied from interface: PrivateMessageService
Returns the message count on a specific folder.

Specified by:
getMessageCountForFolder in interface PrivateMessageService
Parameters:
userID -
folderID -
Returns:
Throws:
UnauthorizedException
UserNotFoundException
PrivateMessageFolderNotFoundException

getUnreadMessageCount

public int getUnreadMessageCount(long userID)
                          throws UnauthorizedException,
                                 UserNotFoundException
Returns the total number of unread messages for a user.

Specified by:
getUnreadMessageCount in interface PrivateMessageService
Parameters:
userID -
Returns:
Throws:
UnauthorizedException
UserNotFoundException

getUnreadMessageCountForFolder

public int getUnreadMessageCountForFolder(long userID,
                                          int folderID)
                                   throws UnauthorizedException,
                                          UserNotFoundException,
                                          PrivateMessageFolderNotFoundException
Returns the unread message count for a specified folder.

Specified by:
getUnreadMessageCountForFolder in interface PrivateMessageService
Parameters:
userID -
folderID -
Returns:
Throws:
UnauthorizedException
UserNotFoundException
PrivateMessageFolderNotFoundException

getFolders

public PrivateMessageFolder[] getFolders(long userID)
                                  throws UnauthorizedException,
                                         UserNotFoundException
Returns an array of Private Message folders for a specified user.

Specified by:
getFolders in interface PrivateMessageService
Parameters:
userID -
Returns:
Throws:
UnauthorizedException
UserNotFoundException

getFolder

public PrivateMessageFolder getFolder(long userID,
                                      int folderID)
                               throws PrivateMessageFolderNotFoundException,
                                      UnauthorizedException,
                                      UserNotFoundException
Returns the specified folder for a user.

Specified by:
getFolder in interface PrivateMessageService
Parameters:
userID -
folderID -
Returns:
Throws:
PrivateMessageFolderNotFoundException
UnauthorizedException
UserNotFoundException

createFolder

public PrivateMessageFolder createFolder(long userID,
                                         java.lang.String name)
                                  throws UnauthorizedException,
                                         UserNotFoundException
Create a named folder for the specified user.

Specified by:
createFolder in interface PrivateMessageService
Parameters:
userID -
name -
Returns:
Throws:
UnauthorizedException
UserNotFoundException

deleteFolder

public void deleteFolder(long userID,
                         int folderID)
                  throws UnauthorizedException,
                         UserNotFoundException,
                         PrivateMessageFolderNotFoundException
Delete the specified folder id for a user.

Specified by:
deleteFolder in interface PrivateMessageService
Parameters:
userID -
folderID -
Throws:
UnauthorizedException
UserNotFoundException
PrivateMessageFolderNotFoundException

getMessage

public PrivateMessage getMessage(long privateMessageID)
                          throws UnauthorizedException,
                                 PrivateMessageNotFoundException
Returns the specified private message.

Specified by:
getMessage in interface PrivateMessageService
Parameters:
privateMessageID -
Returns:
Throws:
UnauthorizedException
PrivateMessageNotFoundException

createMessage

public PrivateMessage createMessage(long senderID)
                             throws UnauthorizedException,
                                    UserNotFoundException
Creates a new private message. The message must be either saved as a draft or sent to another user in order to be stored permanently.

Specified by:
createMessage in interface PrivateMessageService
Parameters:
senderID -
Returns:
Throws:
UnauthorizedException
UserNotFoundException

saveMessageAsDraft

public void saveMessageAsDraft(PrivateMessage privateMessage)
                        throws UnauthorizedException,
                               PrivateMessageRejectedException,
                               UserNotFoundException
Saves a message as a draft by storing it in the sender's Drafts folder.

Specified by:
saveMessageAsDraft in interface PrivateMessageService
Parameters:
privateMessage -
Throws:
UnauthorizedException
PrivateMessageRejectedException
UserNotFoundException

sendMessage

public PrivateMessage sendMessage(PrivateMessage privateMessage,
                                  long recipientID,
                                  boolean copyToSentFolder)
                           throws UnauthorizedException,
                                  PrivateMessageRejectedException,
                                  UserNotFoundException
Sends a private message to another user. The message will be delivered to the recipient's Inbox. Optionally, a copy of the message will be put in the sender's Sent folder.

If the recipient's mailbox is full, a PrivateMessageRejectedException will be thrown. The exception will also be thrown if the recipient is not allowed to receive private messages or if the user has elected to save a copy of the message in their Sent folder, but doesn't have room to do so.

Specified by:
sendMessage in interface PrivateMessageService
Parameters:
privateMessage -
recipientID -
copyToSentFolder -
Throws:
UnauthorizedException
PrivateMessageRejectedException
UserNotFoundException

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.