org.tigris.eyebrowse
Class EyebrowseDb

java.lang.Object
  |
  +--org.tigris.eyebrowse.EyebrowseDb

public class EyebrowseDb
extends java.lang.Object

EyebrowseDb This class implements the object-relational mapping between the MySQL database and the Java objects used to represents elements in the database. All access to the database is done through the EyebrowseDb classes. The methods in this class affect the database only; they do not affect files outside the database (such as the text search index or the mailbox files.) EyebrowseDb connections are obtained through the static getConnection method and returned through the release method. The parameters used to find the database path, user name, password, etc, are obtained through the eyebrowse.properties file (or through the system properties) so that callers do not need to do anything to set up access to the eyebrowse database. This class also defines several classes for describing objects in the database, such as ListInfo, MessageInfo, etc.

Since:
1.0
Author:
Brian Goetz - Quiotix Corp, Daniel Rall

Inner Class Summary
static class EyebrowseDb.ListFileInfo
          ListFileInfo Describes the properties of a mailbox file in Eyebrowse
static class EyebrowseDb.ListInfo
          ListInfo Describes the properties of a mailing list in Eyebrowse
static class EyebrowseDb.ListSummaryInfo
          ListSummaryInfo Describes the results of a query summarizing a list by date, sender, subject, or thread
static class EyebrowseDb.MessageInfo
          MessageInfo Describes the properties of a mail message in Eyebrowse.
 
Field Summary
protected static org.tigris.eyebrowse.util.EyebrowseLogger log
           
protected static int message_fieldCount
           
protected static java.lang.String message_fields
           
protected static java.lang.String messageExt_fields
           
protected static java.lang.String messageExt_joinCriteria
           
protected static java.lang.String messageExt_tables
           
protected static java.lang.String subjectMatchInterval
           
 
Method Summary
 int Author_add(int listId, java.lang.String name)
          Add an author to the database
 int Author_find(int listId, java.lang.String name)
          Find an author by name.
 java.lang.String Author_get(int authorId)
          Get the name of the author associated with a specific authorId.
 void close()
           
 void DateSummaryCache_update(int listId)
           
protected  void finalize()
           
static EyebrowseDb getConnection()
          Static method used to obtain an EyebrowseDb connection.
 java.sql.Connection getJDBCConnection()
           
 int List_add(java.lang.String listName, java.lang.String listDescription)
          Add a new list to the eyebrowse database.
 int List_add(java.lang.String listName, java.lang.String listDescription, int ID)
          Add a new list to the eyebrowse database.
 void List_addIndex(int listId, java.lang.String listFile)
          Mark the list as indexed, and associate the list with the specified index file.
 int List_countAuthors(int listId)
          Count the number of authors in the list.
 int List_countSubjects(int listId)
          Count the number of subjects in the list.
 int List_countThreads(int listId)
          Count the number of threads in the specified list.
 void List_delete(int listId)
          Delete a list from the database.
 void List_deleteIndex(int listId)
          Mark the list as nonindexed.
 int List_find(java.lang.String listName)
          Find a list by name.
 EyebrowseDb.ListInfo List_get(int listId)
          Get the ListInfo object for the specified list.
 EyebrowseDb.ListInfo List_get(java.lang.String listName)
          Get the ListInfo object for the specified list.
 EyebrowseDb.ListInfo[] List_getAll()
           
 EyebrowseDb.ListSummaryInfo[] List_summarizeByAuthor(int listId, int startAt, int max)
          Summarize the specified list by author.
 EyebrowseDb.ListSummaryInfo[] List_summarizeByDate(int listId)
          Summarize the specified list by date ranges.
 EyebrowseDb.ListSummaryInfo[] List_summarizeBySubject(int listId, int startAt, int max)
          Summarize the specified list by subject.
 EyebrowseDb.ListSummaryInfo[] List_summarizeByThread(int listId, int startAt, int max)
          Summarize the specified list by thread.
 void List_updateDescription(int listId, java.lang.String description)
          Updates description by listId
 void List_updateIndex(int listId, int lastMsg)
          Update the last-message-indexed value for the specified list.
 int ListFile_add(int listId, java.lang.String fileName, int firstMessageNumber, int fileIndex, boolean isActive)
          Add a mailbox file to the specified list.
 int ListFile_find(java.lang.String filePath)
          Find the fileId associated with the specified file.
 int ListFile_findActive(int listId)
          Find the active file associated with a specific list.
 int ListFile_findLast(int listId)
          Find the last file associated with a list.
 EyebrowseDb.ListFileInfo ListFile_get(int fileId)
          Get information about a mailbox file.
 java.util.ArrayList ListFile_getAllFilePaths(int listId)
          Creates a String array of all the list files for a given list id This is used if someone wants to remove the lists programmatically
 void ListFile_setActive(int fileId, boolean active)
          Mark the specified list file as being the active file in the list.
 int ListFile_updateMsgInfo(int fileId, int messageCount, int fileSize)
          Update information related to which messages in this file have been processed.
 int Message_add(EyebrowseDb.MessageInfo mi)
          Add a message to the database.
 int Message_countByAuthor(int listId, int authorId)
          Count the number of messages by a particular author in a particular list.
 int Message_countBySubject(int listId, int subjectId)
          Count the number of messages with a given subject in a list.
 int Message_countByThread(int listId, int threadId)
          Count the number of messages in the list in a particular thread.
 void Message_delete(int msgId)
          Marks given msgId as dead in the db by setting its isDeleted field to 1.
 EyebrowseDb.MessageInfo Message_get(int msgId)
          Get the MessageInfo object associated with a particular message
 EyebrowseDb.MessageInfo Message_getByIdString(java.lang.String idString)
          Find a message by it's MIME Message-ID string
 EyebrowseDb.MessageInfo Message_getSubjectRoot(EyebrowseDb.MessageInfo mi)
          Find the first message whose subject matches the specified message (for purposes of creating threads.)
 java.util.Date Message_guessDate(int listId)
          Attempt to guess a reasonable date for a new message in a list when the date in the message cannot be determined.
 void Message_setThread(int msgId, int threadId)
          Associate a message with a thread.
 EyebrowseDb.MessageInfo MessageExt_get(int msgId)
          Get all the information associated with a particular message.
 EyebrowseDb.MessageInfo[] MessageExt_getAll(int listId, int startAt, int max)
          Get information about all messages in a list.
 EyebrowseDb.MessageInfo[] MessageExt_getByAuthor(int listId, int authorId, int startAt, int max)
          Get information about messages with the specified author.
 EyebrowseDb.MessageInfo[] MessageExt_getByDate(int listId, java.sql.Date fromDate, java.sql.Date toDate, int startAt, int max)
          Get information about messages from a specified date range.
 EyebrowseDb.MessageInfo MessageExt_getByNo(int listId, int msgNo)
          Retrieve information about a specific message.
 EyebrowseDb.MessageInfo[] MessageExt_getBySubject(int listId, int subjectId, int startAt, int max)
          Get information about messages with the specified subject.
 EyebrowseDb.MessageInfo[] MessageExt_getByThread(int threadId, int startAt, int max)
          Get information about messages with the specified thread.
 EyebrowseDb.MessageInfo MessageExt_getByThreadNo(int threadId, int msgNo)
          Retrieve message information for the message with a specified threadId and msgNo
 EyebrowseDb.MessageInfo[] MessageExt_getChildren(EyebrowseDb.MessageInfo mi)
          Get information about the messages which are direct replies to a specified message
 EyebrowseDb.MessageInfo MessageExt_getNext(EyebrowseDb.MessageInfo mi)
          Get information about the next message in a list.
 EyebrowseDb.MessageInfo MessageExt_getPrev(EyebrowseDb.MessageInfo mi)
          Get information about the previous message in the list
 EyebrowseDb.MessageInfo MessageExt_getThreadNext(EyebrowseDb.MessageInfo mi)
          Retrieve information about the next message in a thread.
 EyebrowseDb.MessageInfo MessageExt_getThreadPrev(EyebrowseDb.MessageInfo mi)
          Get information about the previous message in a thread
 void MessageId_add(int listId, int messageId, java.lang.String idString)
          Associate a message with a Message-ID string
 int MessageId_find(java.lang.String idString, int listId)
          Find a message by it's Message-ID string
 void release()
          To be called when a task is finished with the connection, so the connection can be closed or returned to the pool.
 int Subject_add(int listId, java.lang.String subject)
          Add a subject to the database
 int Subject_find(int listId, java.lang.String subject)
          Find a subject by text.
 java.lang.String Subject_get(int subjectId)
          Get the subject text associated with a specific subject.
 int Thread_add(int listId, int firstMsg)
          Add a thread to the database
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subjectMatchInterval

protected static final java.lang.String subjectMatchInterval

log

protected static org.tigris.eyebrowse.util.EyebrowseLogger log

message_fields

protected static final java.lang.String message_fields

message_fieldCount

protected static final int message_fieldCount

messageExt_fields

protected static final java.lang.String messageExt_fields

messageExt_tables

protected static final java.lang.String messageExt_tables

messageExt_joinCriteria

protected static final java.lang.String messageExt_joinCriteria
Method Detail

getJDBCConnection

public java.sql.Connection getJDBCConnection()

close

public void close()
           throws java.sql.SQLException

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object

getConnection

public static EyebrowseDb getConnection()
                                 throws java.sql.SQLException
Static method used to obtain an EyebrowseDb connection. This is the only supported method of obtaining an EyebrowseDb connect.
Throws:
java.sql.SQLException -  

release

public void release()
To be called when a task is finished with the connection, so the connection can be closed or returned to the pool.

List_add

public int List_add(java.lang.String listName,
                    java.lang.String listDescription)
             throws java.sql.SQLException
Add a new list to the eyebrowse database. Use the next available ID.
Parameters:
listName -  
listDescription -  
Returns:
The listId of the newly created list.
Throws:
java.sql.SQLException -  

List_add

public int List_add(java.lang.String listName,
                    java.lang.String listDescription,
                    int ID)
             throws java.sql.SQLException
Add a new list to the eyebrowse database.
Parameters:
listName -  
listDescription -  
Returns:
The listId of the newly created list.
Throws:
java.sql.SQLException -  

List_addIndex

public void List_addIndex(int listId,
                          java.lang.String listFile)
                   throws java.sql.SQLException
Mark the list as indexed, and associate the list with the specified index file.
Parameters:
listId -  
listFile -  
Throws:
java.sql.SQLException -  

List_updateIndex

public void List_updateIndex(int listId,
                             int lastMsg)
                      throws java.sql.SQLException
Update the last-message-indexed value for the specified list.
Parameters:
listId -  
lastMsg -  
Throws:
java.sql.SQLException -  

List_deleteIndex

public void List_deleteIndex(int listId)
                      throws java.sql.SQLException
Mark the list as nonindexed.
Parameters:
listId -  
Throws:
java.sql.SQLException -  

List_find

public int List_find(java.lang.String listName)
              throws java.sql.SQLException
Find a list by name.
Parameters:
listName -  
Returns:
The listId of the desired list, or -1 if the list can not be found.
Throws:
java.sql.SQLException -  

List_get

public EyebrowseDb.ListInfo List_get(int listId)
                              throws java.sql.SQLException
Get the ListInfo object for the specified list.
Parameters:
listId -  
Returns:
A ListInfo object, or null if the list could not be found.
Throws:
java.sql.SQLException -  

List_get

public EyebrowseDb.ListInfo List_get(java.lang.String listName)
                              throws java.sql.SQLException
Get the ListInfo object for the specified list.
Parameters:
listName -  
Returns:
A ListInfo object, or null if the list could not be found.
Throws:
java.sql.SQLException -  

List_getAll

public EyebrowseDb.ListInfo[] List_getAll()
                                   throws java.sql.SQLException

DateSummaryCache_update

public void DateSummaryCache_update(int listId)
                             throws java.sql.SQLException

List_summarizeByDate

public EyebrowseDb.ListSummaryInfo[] List_summarizeByDate(int listId)
                                                   throws java.sql.SQLException
Summarize the specified list by date ranges. The date ranges are determined by the values in the eb_DateRange table.
Parameters:
listId -  
Returns:
An array of ListSummaryInfo objects, describing the date ranges for which messages were found and a count for each date range.
Throws:
java.sql.SQLException -  

List_summarizeByAuthor

public EyebrowseDb.ListSummaryInfo[] List_summarizeByAuthor(int listId,
                                                            int startAt,
                                                            int max)
                                                     throws java.sql.SQLException
Summarize the specified list by author. Can return only a subset of the results, for paging purposes.
Parameters:
listId -  
startAt - If it is desired to access the summaries in pages, the index into the list of authors at which to start summarizing.
max - If it is desired to access the summaries in pages, the maximum number of summaries to return.
Returns:
An array of ListSummaryInfo objects, describing the name of the author and a count of messages associated with that author.
Throws:
java.sql.SQLException -  

List_summarizeBySubject

public EyebrowseDb.ListSummaryInfo[] List_summarizeBySubject(int listId,
                                                             int startAt,
                                                             int max)
                                                      throws java.sql.SQLException
Summarize the specified list by subject. Can return only a subset of the results, for paging purposes.
Parameters:
listId -  
startAt - If it is desired to access the summaries in pages, the index into the list of authors at which to start summarizing.
max - If it is desired to access the summaries in pages, the maximum number of summaries to return.
Returns:
An array of ListSummaryInfo objects, describing the subject and a count of messages associated with that subject.
Throws:
java.sql.SQLException -  

List_summarizeByThread

public EyebrowseDb.ListSummaryInfo[] List_summarizeByThread(int listId,
                                                            int startAt,
                                                            int max)
                                                     throws java.sql.SQLException
Summarize the specified list by thread. Can return only a subset of the results, for paging purposes.
Parameters:
listId -  
startAt - If it is desired to access the summaries in pages, the index into the list of threads at which to start summarizing.
max - If it is desired to access the summaries in pages, the maximum number of summaries to return.
Returns:
An array of ListSummaryInfo objects, describing the subject and a count of messages associated with that subject.
Throws:
java.sql.SQLException -  

List_countThreads

public int List_countThreads(int listId)
                      throws java.sql.SQLException
Count the number of threads in the specified list.
Parameters:
listId -  
Returns:
The number of threads in the list.
Throws:
java.sql.SQLException -  

List_countAuthors

public int List_countAuthors(int listId)
                      throws java.sql.SQLException
Count the number of authors in the list.
Parameters:
listId -  
Returns:
The number of authors in the specified list.
Throws:
java.sql.SQLException -  

List_countSubjects

public int List_countSubjects(int listId)
                       throws java.sql.SQLException
Count the number of subjects in the list.
Parameters:
listId -  
Returns:
The number of subjects in the list.
Throws:
java.sql.SQLException -  

List_delete

public void List_delete(int listId)
                 throws java.sql.SQLException
Delete a list from the database. This will delete all messages, authors, subjects, and threads associated with the list from the database.
Parameters:
listId -  
Throws:
java.sql.SQLException -  

ListFile_find

public int ListFile_find(java.lang.String filePath)
                  throws java.sql.SQLException
Find the fileId associated with the specified file.
Parameters:
filePath -  
Returns:
The fileId for the specified file, or -1 if the file has not been added to any list.
Throws:
java.sql.SQLException -  

ListFile_findActive

public int ListFile_findActive(int listId)
                        throws java.sql.SQLException
Find the active file associated with a specific list.
Parameters:
listId -  
Returns:
The fileId of the active list file, or -1 if there is no active file for the list.
Throws:
java.sql.SQLException -  

ListFile_findLast

public int ListFile_findLast(int listId)
                      throws java.sql.SQLException
Find the last file associated with a list. If the list has an active file, this will be the active file.
Parameters:
listId -  
Returns:
The fileId of the last file added to the list, or -1 if the list has no files.
Throws:
java.sql.SQLException -  

ListFile_setActive

public void ListFile_setActive(int fileId,
                               boolean active)
                        throws java.sql.SQLException
Mark the specified list file as being the active file in the list. Ensure that no other file is active before calling this method, as only one list file should be active at any given time.
Parameters:
fileId -  
active -  
Throws:
java.sql.SQLException -  

ListFile_get

public EyebrowseDb.ListFileInfo ListFile_get(int fileId)
                                      throws java.sql.SQLException
Get information about a mailbox file.
Parameters:
fileId -  
Returns:
A ListFileInfo object, or null if the file could not be found in the database.
Throws:
java.sql.SQLException -  

ListFile_add

public int ListFile_add(int listId,
                        java.lang.String fileName,
                        int firstMessageNumber,
                        int fileIndex,
                        boolean isActive)
                 throws java.sql.SQLException
Add a mailbox file to the specified list.
Parameters:
listId - The list to which we are adding the file.
fileName - The absolute path to the new file.
firstMessageNumber - The message number that will be associated with the first message in this file.
fileIndex - The index of the file into the list of files associated with this list.
isActive - Whether or not this file should be marked active. Only mark a new file as active if you have ensured that no other file is active.
Returns:
The fileId of the newly created file.
Throws:
java.sql.SQLException -  

ListFile_updateMsgInfo

public int ListFile_updateMsgInfo(int fileId,
                                  int messageCount,
                                  int fileSize)
                           throws java.sql.SQLException
Update information related to which messages in this file have been processed.
Parameters:
fileId - The mailbox file for which we are updating information
messageCount - The total number of messages in this mailbox we have already processed
fileSize - The offset, in bytes, of the last byte of the last message we have processed.
Throws:
java.sql.SQLException -  

ListFile_getAllFilePaths

public java.util.ArrayList ListFile_getAllFilePaths(int listId)
                                             throws java.sql.SQLException
Creates a String array of all the list files for a given list id This is used if someone wants to remove the lists programmatically

List_updateDescription

public void List_updateDescription(int listId,
                                   java.lang.String description)
                            throws java.sql.SQLException
Updates description by listId
Parameters:
listId - list to update
description - new value for field
Throws:
java.sql.SQLException -  

Author_find

public int Author_find(int listId,
                       java.lang.String name)
                throws java.sql.SQLException
Find an author by name.
Parameters:
listId - The list which we are searching (authors are defined on a per-list basis)
name - The name of the author we are searching for (must match exactly)
Returns:
The authorId of the desired author, or -1 if not found
Throws:
java.sql.SQLException -  

Author_add

public int Author_add(int listId,
                      java.lang.String name)
               throws java.sql.SQLException
Add an author to the database
Parameters:
listId - The list with which to associate this author (authors are defined on a per-list basis)
name - The name of this author
Returns:
The authorId of the newly created author record
Throws:
java.sql.SQLException -  

Author_get

public java.lang.String Author_get(int authorId)
                            throws java.sql.SQLException
Get the name of the author associated with a specific authorId.
Parameters:
authorId -  
Returns:
The author name, or null if the author is not found
Throws:
java.sql.SQLException -  

Subject_find

public int Subject_find(int listId,
                        java.lang.String subject)
                 throws java.sql.SQLException
Find a subject by text.
Parameters:
listId - The list which we are searching (subjects are defined on a per-list basis)
name - The text of the subject we are searching for (must match exactly)
Returns:
The subjectId of the desired subject, or -1 if not found
Throws:
java.sql.SQLException -  

Subject_add

public int Subject_add(int listId,
                       java.lang.String subject)
                throws java.sql.SQLException
Add a subject to the database
Parameters:
listId - The list with which to associate this subject (subjects are defined on a per-list basis)
subject - The text of this subject
Returns:
The subjectId of the newly created subject record
Throws:
java.sql.SQLException -  

Subject_get

public java.lang.String Subject_get(int subjectId)
                             throws java.sql.SQLException
Get the subject text associated with a specific subject.
Parameters:
subjectId -  
Returns:
The subject text, or null if not found
Throws:
java.sql.SQLException -  

Thread_add

public int Thread_add(int listId,
                      int firstMsg)
               throws java.sql.SQLException
Add a thread to the database
Parameters:
listId -  
firstMsg - The messageId of the first message in this thread
Returns:
The threadId of the newly create thread
Throws:
java.sql.SQLException -  

MessageId_find

public int MessageId_find(java.lang.String idString,
                          int listId)
                   throws java.sql.SQLException
Find a message by it's Message-ID string
Parameters:
idString -  
Returns:
The msgId of the associated message
Throws:
java.sql.SQLException -  

MessageId_add

public void MessageId_add(int listId,
                          int messageId,
                          java.lang.String idString)
                   throws java.sql.SQLException
Associate a message with a Message-ID string
Parameters:
listId - The list this message comes from
messageId - The messageId (database identifer) of the message
idString - The Message-ID (from the Message-ID MIME headeroken) of the message
Throws:
java.sql.SQLException -  

Message_add

public int Message_add(EyebrowseDb.MessageInfo mi)
                throws java.sql.SQLException
Add a message to the database.
Parameters:
mi - A MessageInfo object describing the message. Only the 'basic' fields of the MessageInfo object are added.
Returns:
The msgId of the newly created message
Throws:
java.sql.SQLException -  

Message_get

public EyebrowseDb.MessageInfo Message_get(int msgId)
                                    throws java.sql.SQLException
Get the MessageInfo object associated with a particular message
Parameters:
msgId -  
Returns:
A MessageInfo object. Only the 'basic' (not joined) fields of the MessageInfo are filled in.
Throws:
java.sql.SQLException -  

Message_getByIdString

public EyebrowseDb.MessageInfo Message_getByIdString(java.lang.String idString)
                                              throws java.sql.SQLException
Find a message by it's MIME Message-ID string
Parameters:
idString -  
Returns:
A MessageInfo object describing the message, or null if not found.
Throws:
java.sql.SQLException -  

Message_setThread

public void Message_setThread(int msgId,
                              int threadId)
                       throws java.sql.SQLException
Associate a message with a thread.
Parameters:
msgId -  
threadId -  
Throws:
java.sql.SQLException -  

Message_getSubjectRoot

public EyebrowseDb.MessageInfo Message_getSubjectRoot(EyebrowseDb.MessageInfo mi)
                                               throws java.sql.SQLException
Find the first message whose subject matches the specified message (for purposes of creating threads.)
Parameters:
mi - MessageInfo object describing a message whose subject we want to match.
Returns:
A MessageInfo object describing the first message whose subject matches the subject specified, or null if no previous messages could be found.
Throws:
java.sql.SQLException -  

Message_guessDate

public java.util.Date Message_guessDate(int listId)
                                 throws java.sql.SQLException
Attempt to guess a reasonable date for a new message in a list when the date in the message cannot be determined.
Parameters:
listId -  
Returns:
A Date object describing the date of the last message added to the list.
Throws:
java.sql.SQLException -  

Message_countByThread

public int Message_countByThread(int listId,
                                 int threadId)
                          throws java.sql.SQLException
Count the number of messages in the list in a particular thread.
Parameters:
listId -  
threadId -  
Returns:
A count of messages in the specified thread.
Throws:
java.sql.SQLException -  

Message_countByAuthor

public int Message_countByAuthor(int listId,
                                 int authorId)
                          throws java.sql.SQLException
Count the number of messages by a particular author in a particular list.
Parameters:
listId -  
authorId -  
Returns:
The number of messages by the specified author in the specified list.
Throws:
java.sql.SQLException -  

Message_countBySubject

public int Message_countBySubject(int listId,
                                  int subjectId)
                           throws java.sql.SQLException
Count the number of messages with a given subject in a list.
Parameters:
listId -  
subjectId -  
Returns:
The number of messages in the specified list with the specified subject.
Throws:
java.sql.SQLException -  

MessageExt_get

public EyebrowseDb.MessageInfo MessageExt_get(int msgId)
                                       throws java.sql.SQLException
Get all the information associated with a particular message.
Parameters:
msgId -  
Returns:
A MessageId object with both the basic and joined fields filled in.
Throws:
java.sql.SQLException -  

MessageExt_getByDate

public EyebrowseDb.MessageInfo[] MessageExt_getByDate(int listId,
                                                      java.sql.Date fromDate,
                                                      java.sql.Date toDate,
                                                      int startAt,
                                                      int max)
                                               throws java.sql.SQLException
Get information about messages from a specified date range. Can return the results in pages (as specified by the startAt and max) parameters.
Parameters:
listId - The list we are interested in
fromDate - The beginning date of the date range we are interested in
toDate - The ending date of the date range we are interested in
startAt - For paging. The index into the query results of the first message we want to retrieve.
max - For paging. The maximum number of messages to return.
Returns:
An array of MessageInfo objects with both basic and joined fields filled in.
Throws:
java.sql.SQLException -  

MessageExt_getByAuthor

public EyebrowseDb.MessageInfo[] MessageExt_getByAuthor(int listId,
                                                        int authorId,
                                                        int startAt,
                                                        int max)
                                                 throws java.sql.SQLException
Get information about messages with the specified author. Can return the results in pages (as specified by the startAt and max) parameters.
Parameters:
listId - The list we are interested in
authorId - The author we are interested in
startAt - For paging. The index into the query results of the first message we want to retrieve.
max - For paging. The maximum number of messages to return.
Returns:
An array of MessageInfo objects with both basic and joined fields filled in.
Throws:
java.sql.SQLException -  

MessageExt_getBySubject

public EyebrowseDb.MessageInfo[] MessageExt_getBySubject(int listId,
                                                         int subjectId,
                                                         int startAt,
                                                         int max)
                                                  throws java.sql.SQLException
Get information about messages with the specified subject. Can return the results in pages (as specified by the startAt and max) parameters.
Parameters:
listId - The list we are interested in
subjectId - The subject we are interested in
startAt - For paging. The index into the query results of the first message we want to retrieve.
max - For paging. The maximum number of messages to return.
Returns:
An array of MessageInfo objects with both basic and joined fields filled in.
Throws:
java.sql.SQLException -  

MessageExt_getByThread

public EyebrowseDb.MessageInfo[] MessageExt_getByThread(int threadId,
                                                        int startAt,
                                                        int max)
                                                 throws java.sql.SQLException
Get information about messages with the specified thread. Can return the results in pages (as specified by the startAt and max) parameters.
Parameters:
listId - The list we are interested in
threadId - The thread we are interested in
startAt - For paging. The index into the query results of the first message we want to retrieve.
max - For paging. The maximum number of messages to return.
Returns:
An array of MessageInfo objects with both basic and joined fields filled in.
Throws:
java.sql.SQLException -  

MessageExt_getByNo

public EyebrowseDb.MessageInfo MessageExt_getByNo(int listId,
                                                  int msgNo)
                                           throws java.sql.SQLException
Retrieve information about a specific message.
Parameters:
listId -  
msgNo -  
Returns:
A MessageInfo object with both basic and joined fields filled in.
Throws:
java.sql.SQLException -  

MessageExt_getAll

public EyebrowseDb.MessageInfo[] MessageExt_getAll(int listId,
                                                   int startAt,
                                                   int max)
                                            throws java.sql.SQLException
Get information about all messages in a list. Can return the results in pages (as specified by the startAt and max) parameters.
Parameters:
listId - The list we are interested in
startAt - For paging. The index into the query results of the first message we want to retrieve.
max - For paging. The maximum number of messages to return.
Returns:
An array of MessageInfo objects with both basic and joined fields filled in.
Throws:
java.sql.SQLException -  

MessageExt_getNext

public EyebrowseDb.MessageInfo MessageExt_getNext(EyebrowseDb.MessageInfo mi)
                                           throws java.sql.SQLException
Get information about the next message in a list.
Parameters:
mi - A MessageInfo object describing the message
Returns:
A MessageInfo object describing the next message in the list.
Throws:
java.sql.SQLException -  

MessageExt_getPrev

public EyebrowseDb.MessageInfo MessageExt_getPrev(EyebrowseDb.MessageInfo mi)
                                           throws java.sql.SQLException
Get information about the previous message in the list
Parameters:
mi - A MessageInfo object describing a message
Returns:
A MessageInfo object describing the previous message in the list.
Throws:
java.sql.SQLException -  

MessageExt_getByThreadNo

public EyebrowseDb.MessageInfo MessageExt_getByThreadNo(int threadId,
                                                        int msgNo)
                                                 throws java.sql.SQLException
Retrieve message information for the message with a specified threadId and msgNo
Parameters:
threadId -  
msgNo -  
Returns:
A MessageInfo object describing the message (with basic and joined fields filled in).
Throws:
java.sql.SQLException -  

MessageExt_getThreadNext

public EyebrowseDb.MessageInfo MessageExt_getThreadNext(EyebrowseDb.MessageInfo mi)
                                                 throws java.sql.SQLException
Retrieve information about the next message in a thread.
Parameters:
mi - A MessageInfo object describing the message
Returns:
A MessageInfo object describing the next message in the thread, or null if there is no next message in the thread.
Throws:
java.sql.SQLException -  

MessageExt_getThreadPrev

public EyebrowseDb.MessageInfo MessageExt_getThreadPrev(EyebrowseDb.MessageInfo mi)
                                                 throws java.sql.SQLException
Get information about the previous message in a thread
Parameters:
mi - A MessageInfo object describing the message
Returns:
A MessageInfo object describing the next message in the thread, or null if there is no next message in the thread.
Throws:
java.sql.SQLException -  

MessageExt_getChildren

public EyebrowseDb.MessageInfo[] MessageExt_getChildren(EyebrowseDb.MessageInfo mi)
                                                 throws java.sql.SQLException
Get information about the messages which are direct replies to a specified message
Parameters:
mi - A MessageInfo object describing the message
Returns:
An array of MessageInfo objects describing the messages which are direct replies to this message.
Throws:
java.sql.SQLException -  

Message_delete

public void Message_delete(int msgId)
                    throws java.sql.SQLException
Marks given msgId as dead in the db by setting its isDeleted field to 1. Before the isDeleted field was added, this was accomplished by setting the msgNo to -1. Messages which were deleted using that method are only viewable by msgId.


Copyright © 2000 Quiotix Corp. All Rights Reserved.