|
|||||||||
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(java.lang.String groupName,
int number)
get Article from group by either unique id or number |
NNTPMessage |
getArticle(java.lang.String groupName,
int type,
java.lang.String value)
get Article from group by either unique id or number |
NNTPMessage |
getArticle(java.lang.String groupName,
java.lang.String messageId)
get Article from group by unique id |
NNTPMessage |
getArticles(NewsGroup group)
get selected articles from the NewsGroup Selection is made as articles between NewsGroup.getFirst()
and NewsGroup.getLast() . |
GroupList |
getGroupList()
get the list of groups this newsserver supports |
int[] |
getHandledEvents()
|
int |
getMaxConnection()
get the maximum connections this server can support This may differ from the connections supplied by ServerDescription if server rejects more connections |
NNTPMessage |
getNewArticles(NewsGroup group)
get new articles from the NewsGroup get the all the new articles from the list, with a maximum of 50000. |
ServerDescriptor |
getServer()
|
NNTPMessage |
handleEvent(CoffeeEvent event)
|
boolean |
isAvailable()
|
void |
open()
|
NNTPMessage |
post(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()
public NNTPMessage getArticles(NewsGroup group)
Selection is made as articles between NewsGroup.getFirst()
and NewsGroup.getLast()
.
group
- NewsGroup
, the group to get articles from
NewsGroup
or InfoMessage
public NNTPMessage getNewArticles(NewsGroup group)
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
public NNTPMessage getArticle(java.lang.String groupName, java.lang.String messageId)
groupName
- String, the name of the groupmessageId
- String, the unique id of the message
Article
or InfoMessage
public NNTPMessage getArticle(java.lang.String groupName, int type, java.lang.String value)
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
public NNTPMessage getArticle(java.lang.String groupName, int number)
groupName
- String, the name of the groupnumber
- int, the number of the message in this group
Article
or InfoMessage
public NNTPMessage post(Article a)
a
- Article, the article to post
Article
with unique id set
or an InfoMessage
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 |