|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for NNTP client connections.
Method Summary | |
void |
connect(java.lang.String hostname,
int port)
Connects to the NNTP server. |
void |
disconnect()
Disconnects from the server. |
MessageHeader |
getHeader(int article)
Gets the MessageHeader of a newsgroup article. |
MessageHeader |
getHeader(java.lang.String messageId)
Gets the MessageHeader of a newsgroup article. |
Message |
getMessage(int article)
Gets a message from the news server. |
Message |
getMessage(int article,
MessageHeader header)
Gets a message from the news server. |
Message |
getMessage(java.lang.String messageId)
Gets a message from the news server. |
Message |
getMessage(java.lang.String messageId,
MessageHeader header)
Gets a message from the news server. |
java.util.Iterator |
getMessagesSince(Newsgroup newsgroup,
java.util.Date when)
Gets the message IDs in an iterator of all messages added to a Newsgroup since a Date. |
NewsgroupList |
getNewsgroupList()
Gets the list of available Newsgroups from the NNTP server. |
NewsgroupList |
getNewsgroupsSince(java.util.Date when)
Gets the list of Newsgroups added to the server since a Date. |
boolean |
isConnected()
Checks if this client is connected. |
boolean |
isPostingAllowed()
Checks if posting is allowed on this server. |
boolean |
post(Message message)
Posts a message to the NNTP server. |
boolean |
selectNewsgroup(Newsgroup newsgroup)
Selects the current Newsgroup. |
Method Detail |
public void connect(java.lang.String hostname, int port) throws NNTPConnectException
hostname
- The NNTP server's hostname.port
- The NNTP server's port.
NNTPConnectException
- if the connection failed.public void disconnect()
public boolean isConnected()
public boolean isPostingAllowed()
public NewsgroupList getNewsgroupList() throws UnconnectedException
UnconnectedException
- if this client is not connected.public boolean selectNewsgroup(Newsgroup newsgroup) throws UnconnectedException
newsgroup
- The Newsgroup to select.
UnconnectedException
- if this client is not connected.public MessageHeader getHeader(int article) throws UnconnectedException, InvalidArticleException
article
- The article ID in the current group.
UnconnectedException
- if this client is not connected.
InvalidArticleException
- if the article does not exist on this
server.public MessageHeader getHeader(java.lang.String messageId) throws UnconnectedException, InvalidArticleException
messageId
- The message ID of the article.
UnconnectedException
- if this client is not connected.
InvalidArticleException
- if the article does not exist on this
server.public Message getMessage(int article) throws UnconnectedException, InvalidArticleException
article
- The article ID in the current group.
UnconnectedException
- if this client is not connected.
InvalidArticleException
- if the article does not exist on this
server.public Message getMessage(int article, MessageHeader header) throws UnconnectedException, InvalidArticleException
article
- The article ID in the current group.header
- The MessageHeader of this article.
UnconnectedException
- if this client is not connected.
InvalidArticleException
- if the article does not exist on this
server.public Message getMessage(java.lang.String messageId) throws UnconnectedException, InvalidArticleException
messageId
- The message ID of the article.
UnconnectedException
- if this client is not connected.
InvalidArticleException
- if the article does not exist on this
server.public Message getMessage(java.lang.String messageId, MessageHeader header) throws UnconnectedException, InvalidArticleException
messageId
- The message ID of the article.header
- The MessageHeader of this article.
UnconnectedException
- if this client is not connected.
InvalidArticleException
- if the article does not exist on this
server.public NewsgroupList getNewsgroupsSince(java.util.Date when) throws UnconnectedException
when
- The Date after which the newsgroups were added.
UnconnectedException
- if this client is not connected.public java.util.Iterator getMessagesSince(Newsgroup newsgroup, java.util.Date when) throws UnconnectedException
newsgroup
- The Newsgroup to check for new messages in.when
- The Date after which the messages were added.
UnconnectedException
- if this client is not connected.public boolean post(Message message) throws UnconnectedException
message
- The Message to post.
UnconnectedException
- if this client is not connected.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |