org.brains2b.coffee.plugin.search
Class QueryMessage

java.lang.Object
  extended by org.brains2b.coffee.plugin.search.QueryMessage
All Implemented Interfaces:
NNTPMessage, MimeType

public class QueryMessage
extends java.lang.Object
implements NNTPMessage, MimeType

Local Message for storing Query definitions of NewsSearch

Version:
$Revision: 1.3 $ $Date: 2010/07/05 01:18:10 $
Author:
dennis@brains2b.nl

Field Summary
static int QUERY
           
 
Constructor Summary
QueryMessage()
          Constructor
 
Method Summary
 void addArticle(Article a)
          add an Article which was found as a result of this Query
 void addFilter(MessageFilter filter)
          add a Filter to this Query
 void addHeader(int id, java.lang.String s)
           
 void addLine(java.lang.String s)
           
 void addNewsGroup(NewsGroup group)
           
 void endMessage()
           
 java.util.List<Article> getArticles()
          get a List of Articles which were found by this Query
 java.util.List getFilters()
          get a List of Filters making up this query
 int getFrequency()
           
 java.lang.String getId()
           
 java.lang.String getMimeType()
           
 int getNewMessages()
           
 java.util.List getNewsgroups()
          get a List of Newsgroups this Query should search in
 int getSize()
           
 int getType()
           
 boolean hasContent()
           
 boolean isHeaderSet()
           
 void setArticles(java.util.List articles)
          set a List of Articles as result for this Query
 void setFilters(java.util.List filters)
          set a List of Filters making up this query
 void setFrequency(int frequency)
           
 void setId(java.lang.String id)
           
 void setNewsgroups(java.util.List newsgroups)
          set a List of Newsgroups this Query should search in
 java.lang.String toString()
           
 void writeMessage(org.brains2b.saxo.SAXWriter sw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY

public static final int QUERY
See Also:
Constant Field Values
Constructor Detail

QueryMessage

public QueryMessage()
Constructor

Method Detail

getId

public java.lang.String getId()
Specified by:
getId in interface NNTPMessage

getSize

public int getSize()
Specified by:
getSize in interface NNTPMessage

getType

public int getType()
Specified by:
getType in interface NNTPMessage

hasContent

public boolean hasContent()
Specified by:
hasContent in interface NNTPMessage

isHeaderSet

public boolean isHeaderSet()
Specified by:
isHeaderSet in interface NNTPMessage

writeMessage

public void writeMessage(org.brains2b.saxo.SAXWriter sw)
                  throws org.xml.sax.SAXException
Specified by:
writeMessage in interface NNTPMessage
Throws:
org.xml.sax.SAXException

getFilters

public java.util.List getFilters()
get a List of Filters making up this query

Returns:
List, list of MessageFilter

setFilters

public void setFilters(java.util.List filters)
set a List of Filters making up this query

Parameters:
filters - List, list of MessageFilter

addFilter

public void addFilter(MessageFilter filter)
add a Filter to this Query

Parameters:
filter - MessageFilter

getNewsgroups

public java.util.List getNewsgroups()
get a List of Newsgroups this Query should search in

Returns:
List, list of NewsGroup

setNewsgroups

public void setNewsgroups(java.util.List newsgroups)
set a List of Newsgroups this Query should search in

Parameters:
newsgroups - List, list of NewsGroup

addNewsGroup

public void addNewsGroup(NewsGroup group)

setId

public void setId(java.lang.String id)

toString

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

addArticle

public void addArticle(Article a)
add an Article which was found as a result of this Query

Parameters:
a - Article

getArticles

public java.util.List<Article> getArticles()
get a List of Articles which were found by this Query

Returns:
List, list of Article

setArticles

public void setArticles(java.util.List articles)
set a List of Articles as result for this Query

Parameters:
articles - List, list of Article

getMimeType

public java.lang.String getMimeType()
Specified by:
getMimeType in interface MimeType

getFrequency

public int getFrequency()

setFrequency

public void setFrequency(int frequency)

addHeader

public void addHeader(int id,
                      java.lang.String s)
Specified by:
addHeader in interface NNTPMessage

addLine

public void addLine(java.lang.String s)
Specified by:
addLine in interface NNTPMessage

endMessage

public void endMessage()
Specified by:
endMessage in interface NNTPMessage

getNewMessages

public int getNewMessages()