Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbPrivateMessageFolder

java.lang.Object
  extended by com.jivesoftware.forum.database.DbPrivateMessageFolder
All Implemented Interfaces:
PrivateMessageFolder, Cacheable, com.tangosol.io.ExternalizableLite, java.io.Serializable

public class DbPrivateMessageFolder
extends java.lang.Object
implements PrivateMessageFolder, Cacheable, com.tangosol.io.ExternalizableLite

Database implementation of the PrivateMessageFolder interface.

Since:
4.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.jivesoftware.forum.PrivateMessageFolder
FOLDER_DRAFTS, FOLDER_INBOX, FOLDER_SENT, FOLDER_TRASH, SORT_DATE, SORT_SENDER, SORT_SUBJECT
 
Constructor Summary
DbPrivateMessageFolder()
          Constructor for internal use only.
DbPrivateMessageFolder(int folderID, long userID)
          Loads an existing private message folder.
DbPrivateMessageFolder(long userID, java.lang.String name)
          Creates a new folder.
 
Method Summary
 void deleteMessage(PrivateMessage privateMessage)
          Deletes a private message from the folder by moving it to the trash folder.
 boolean equals(java.lang.Object object)
           
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 int getID()
          Returns the ID of the folder.
 int getMessageCount()
          Returns the number of messages in the folder.
 java.util.Iterator getMessages()
          Returns all the messages in the folder sorted by date descending.
 java.util.Iterator getMessages(int startIndex, int count, int sortField, boolean sortDescending)
          Returns messages in the folder based on the params.
 java.lang.String getName()
          Returns the name of the folder.
 User getOwner()
          Returns the owner of the private message folder.
 int getUnreadMessageCount()
          Returns the number of unread messages in the folder.
 int hashCode()
           
 void moveMessage(PrivateMessage privateMessage, PrivateMessageFolder destinationFolder)
          Moves a private message to another folder.
 void readExternal(java.io.DataInput in)
           
 void setName(java.lang.String name)
          Sets the name of the folder.
 java.lang.String toString()
           
 void writeExternal(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbPrivateMessageFolder

public DbPrivateMessageFolder(int folderID,
                              long userID)
                       throws PrivateMessageFolderNotFoundException
Loads an existing private message folder.

Parameters:
folderID - the ID of the folder.
userID - the ID of the user that owns the folder.
Throws:
PrivateMessageFolderNotFoundException - if unable to load the folder.

DbPrivateMessageFolder

public DbPrivateMessageFolder(long userID,
                              java.lang.String name)
Creates a new folder.

Parameters:
userID - the ID of the user that will own the folder.
name - the name of the new folder.

DbPrivateMessageFolder

public DbPrivateMessageFolder()
Constructor for internal use only.

Method Detail

getID

public int getID()
Description copied from interface: PrivateMessageFolder
Returns the ID of the folder. The folder ID may be one of the standard folders or a custom folder.

Specified by:
getID in interface PrivateMessageFolder
Returns:
the ID of the folder.

getOwner

public User getOwner()
Description copied from interface: PrivateMessageFolder
Returns the owner of the private message folder.

Specified by:
getOwner in interface PrivateMessageFolder
Returns:
the owner of the private message folder.

getName

public java.lang.String getName()
Description copied from interface: PrivateMessageFolder
Returns the name of the folder.

Specified by:
getName in interface PrivateMessageFolder
Returns:
the name of the folder.

setName

public void setName(java.lang.String name)
Description copied from interface: PrivateMessageFolder
Sets the name of the folder. This method does nothing if the folder is one of the standard folders.

Specified by:
setName in interface PrivateMessageFolder
Parameters:
name - the new name for the folder.

getMessageCount

public int getMessageCount()
Description copied from interface: PrivateMessageFolder
Returns the number of messages in the folder.

Specified by:
getMessageCount in interface PrivateMessageFolder
Returns:
the total number of messages.

getUnreadMessageCount

public int getUnreadMessageCount()
Description copied from interface: PrivateMessageFolder
Returns the number of unread messages in the folder.

Specified by:
getUnreadMessageCount in interface PrivateMessageFolder
Returns:
the number of unread messages.

getMessages

public java.util.Iterator getMessages()
Description copied from interface: PrivateMessageFolder
Returns all the messages in the folder sorted by date descending.

Specified by:
getMessages in interface PrivateMessageFolder
Returns:
all messages in the folder.

getMessages

public java.util.Iterator getMessages(int startIndex,
                                      int count,
                                      int sortField,
                                      boolean sortDescending)
Description copied from interface: PrivateMessageFolder
Returns messages in the folder based on the params. Valid fields to sort on are:

deleteMessage

public void deleteMessage(PrivateMessage privateMessage)
Description copied from interface: PrivateMessageFolder
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 PrivateMessageFolder
Parameters:
privateMessage - the private message to delete.

moveMessage

public void moveMessage(PrivateMessage privateMessage,
                        PrivateMessageFolder destinationFolder)
Description copied from interface: PrivateMessageFolder
Moves a private message to another folder.

Specified by:
moveMessage in interface PrivateMessageFolder
Parameters:
privateMessage - the message to move.
destinationFolder - the folder to move the message to.

getCachedSize

public int getCachedSize()
Description copied from interface: Cacheable
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

Specified by:
getCachedSize in interface Cacheable
Returns:
the size of the Object in bytes.

readExternal

public void readExternal(java.io.DataInput in)
                  throws java.io.IOException
Specified by:
readExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

writeExternal

public void writeExternal(java.io.DataOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.