|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.brains2b.coffee.NewsServer
public class NewsServer
Class for handling newsserver actions and maintaining connections
Constructor Summary | |
---|---|
NewsServer(ServerDescriptor server)
Constructor |
Method Summary | |
---|---|
void |
addProgressMonitor(ProgressMonitor monitor)
|
void |
close()
|
java.lang.String |
getAddress()
get the address of the Server |
NNTPMessage |
getArticle(NNTPConnector con,
java.lang.String groupName,
int number)
get Article from group by either unique id or number |
NNTPMessage |
getArticle(NNTPConnector nntp,
java.lang.String groupName,
int type,
java.lang.String value)
get Article from group by either unique id or number |
NNTPMessage |
getArticle(NNTPConnector con,
java.lang.String groupName,
java.lang.String messageId)
get Article from group by unique id |
NNTPMessage |
getArticles(NNTPConnector nntp,
NewsGroup group)
get selected articles from the NewsGroup |
GroupList |
getGroupList(NNTPConnector con)
get the list of groups this newsserver supports |
int[] |
getHandledEvents()
|
int |
getMaxConnection()
get the maximum connections this server can support |
NNTPMessage |
getNewArticles(NNTPConnector nntp,
NewsGroup group)
get new articles from the NewsGroup |
ServerDescriptor |
getServer()
|
NNTPMessage |
handleEvent(CoffeeEvent event)
|
boolean |
isAvailable()
|
void |
open()
|
NNTPMessage |
post(NNTPConnector con,
Article a)
post an article to the NewsServer |
void |
removeProgressMonitor(ProgressMonitor monitor)
|
void |
setMaxConnection(int maxConnection)
set the maximum connections you want the server to support |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NewsServer(ServerDescriptor server)
server
- ServerDescriptor
, information to
make NNTP connectionsMethod Detail |
---|
public NNTPMessage handleEvent(CoffeeEvent event) throws CoffeeSpill
handleEvent
in interface TicketHandler
CoffeeSpill
public GroupList getGroupList(NNTPConnector con) throws CoffeeSpill
CoffeeSpill
public NNTPMessage getArticles(NNTPConnector nntp, NewsGroup group) throws CoffeeSpill
Selection is made as articles between NewsGroup.getFirst()
and NewsGroup.getLast()
.
group
- NewsGroup
, the group to get articles from
NewsGroup
or InfoMessage
CoffeeSpill
public NNTPMessage getNewArticles(NNTPConnector nntp, NewsGroup group) throws CoffeeSpill
get the all the new articles from the list, with a maximum
of 50000. It uses NewsGroup.getLast()
from the supplied
group to determine what is new
group
- NewsGroup
, the group to get articles from
NewsGroup
or InfoMessage
CoffeeSpill
public NNTPMessage getArticle(NNTPConnector con, java.lang.String groupName, java.lang.String messageId) throws CoffeeSpill
groupName
- String, the name of the groupmessageId
- String, the unique id of the message
Article
or InfoMessage
CoffeeSpill
public NNTPMessage getArticle(NNTPConnector nntp, java.lang.String groupName, int type, java.lang.String value) throws CoffeeSpill
groupName
- String, the name of the grouptype
- int, 0 for messageId or 1 for numbervalue
- String, the unique id of the message, or its number
Article
or InfoMessage
CoffeeSpill
public NNTPMessage getArticle(NNTPConnector con, java.lang.String groupName, int number) throws CoffeeSpill
groupName
- String, the name of the groupnumber
- int, the number of the message in this group
Article
or InfoMessage
CoffeeSpill
public NNTPMessage post(NNTPConnector con, Article a) throws CoffeeSpill
a
- Article, the article to post
Article
with unique id set
or an InfoMessage
CoffeeSpill
public java.lang.String getAddress()
public int getMaxConnection()
This may differ from the connections supplied by ServerDescription if server rejects more connections
public void setMaxConnection(int maxConnection)
maxConnection
- getMaxConnection()
public void close() throws java.lang.Exception
close
in interface TicketHandler
java.lang.Exception
public boolean isAvailable()
isAvailable
in interface TicketHandler
public void addProgressMonitor(ProgressMonitor monitor)
addProgressMonitor
in interface TicketHandler
public void open()
open
in interface TicketHandler
public void removeProgressMonitor(ProgressMonitor monitor)
removeProgressMonitor
in interface TicketHandler
public int[] getHandledEvents()
getHandledEvents
in interface TicketHandler
public ServerDescriptor getServer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |