com.ondelette.servlet.webforum
Class MessageFolder

java.lang.Object
  |
  +--com.ondelette.servlet.webforum.MessageFolder
All Implemented Interfaces:
AutorizationConstants

public final class MessageFolder
extends java.lang.Object
implements AutorizationConstants

This class manages a bunch of posts and it handles saving and loading them from disk


Field Summary
protected  Forum mForum
          Host forum
protected  com.ondelette.servlet.webforum.MessageArchiveBuffer mMAB
          Archive buffer (buffer for loading posts from disk)
 
Fields inherited from interface com.ondelette.servlet.webforum.AutorizationConstants
ACCOUNTINACTIVE, ADMIN, DELETED, EXECUTIVEMEMBER, IDENTIFIEDGUEST, ILLEGAL, MEMBER, NORMAL, VIPMEMBER
 
Constructor Summary
MessageFolder(Forum forum)
          Constructor for the MessageFolder object
 
Method Summary
 MessageReference addMessage(Message message)
          Add a message (post)
 void deleteMessage(int mr)
          Delete a post
 void deleteMessage(MessageReference mr)
          Delete a post
 void destroy()
          Call this when the servlet dies
 int getCurrentMaxIndex()
          Gets the CurrentMaxIndex attribute of the MessageFolder object
 Message getMessage(int ID)
          Gets the Message attribute of the MessageFolder object
 int getNumberOfPages()
          Gets the NumberOfPages attribute of the MessageFolder object
 int[] getPage(int pagenumber)
          Gets the Page attribute of the MessageFolder object
 void writeLastMessagesSummaryHTML(int NumberOfMessages, java.io.PrintWriter out, java.lang.String ServletPath)
          Something like last 10 messages
 void writePageSummaryHTML(int pagenumber, java.io.PrintWriter out, java.lang.String ServletPath)
          Write usual summary of titles and dates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mForum

protected Forum mForum
Host forum

Since:
0.30

mMAB

protected com.ondelette.servlet.webforum.MessageArchiveBuffer mMAB
Archive buffer (buffer for loading posts from disk)

Since:
0.30
Constructor Detail

MessageFolder

public MessageFolder(Forum forum)
              throws java.io.IOException
Constructor for the MessageFolder object

Parameters:
forum -
Throws:
java.io.IOException
Since:
0.30
Method Detail

getMessage

public Message getMessage(int ID)
                   throws java.io.IOException
Gets the Message attribute of the MessageFolder object

Parameters:
ID -
Returns:
The Message value
Throws:
java.io.IOException
Since:
0.30

getNumberOfPages

public int getNumberOfPages()
Gets the NumberOfPages attribute of the MessageFolder object

Returns:
The NumberOfPages value
Since:
0.30

getPage

public int[] getPage(int pagenumber)
Gets the Page attribute of the MessageFolder object

Parameters:
pagenumber -
Returns:
The Page value
Since:
0.30

getCurrentMaxIndex

public int getCurrentMaxIndex()
Gets the CurrentMaxIndex attribute of the MessageFolder object

Returns:
The CurrentMaxIndex value
Since:
0.30

deleteMessage

public void deleteMessage(MessageReference mr)
                   throws java.io.IOException
Delete a post

Parameters:
mr -
Throws:
java.io.IOException
Since:
0.30

deleteMessage

public void deleteMessage(int mr)
                   throws java.io.IOException
Delete a post

Parameters:
mr -
Throws:
java.io.IOException
Since:
0.30

writePageSummaryHTML

public void writePageSummaryHTML(int pagenumber,
                                 java.io.PrintWriter out,
                                 java.lang.String ServletPath)
                          throws java.io.IOException
Write usual summary of titles and dates

Parameters:
pagenumber -
out -
ServletPath -
Throws:
java.io.IOException
Since:
0.30

writeLastMessagesSummaryHTML

public void writeLastMessagesSummaryHTML(int NumberOfMessages,
                                         java.io.PrintWriter out,
                                         java.lang.String ServletPath)
                                  throws java.io.IOException
Something like last 10 messages

Parameters:
NumberOfMessages -
out -
ServletPath -
Throws:
java.io.IOException
Since:
0.30

addMessage

public MessageReference addMessage(Message message)
                            throws java.io.IOException
Add a message (post)

Parameters:
message - The feature to be added to the Message attribute
Returns:
Throws:
java.io.IOException
Since:
0.30

destroy

public void destroy()
Call this when the servlet dies

Since:
0.30