|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.nntp.spi.ArticlePointerImpl
public class ArticlePointerImpl
Simple article pointer that uses a ForumSession to access the message store.
Constructor Summary | |
---|---|
ArticlePointerImpl(ForumSession session)
Create an article pointer using the given adapter. |
Method Summary | |
---|---|
Article |
getArticle(int articleNumber)
Obtain an article by it's article number. |
Article |
getArticle(java.lang.String messageID)
Obtain an article based on it's Message-ID. |
java.util.Iterator |
getArticles(ArticleFilter filter)
Obtain all articles in the current group that match the article filter criteria. |
Article |
getCurrentArticle()
Obtain the Article this pointer is currently pointing to. |
int |
getCurrentArticleNumber()
Obtain the number of the article currently being pointed to. |
NewsGroup |
getGroup()
Obtain the group currently assigned to the pointer on null if none has been set. |
Article |
last()
Moves the article pointer to the previous article in the current group. |
Article |
next()
Moves the article pointer to the next article in the current group. |
NewsGroup |
setGroup(java.lang.String name)
Sets the article pointer to use the given group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArticlePointerImpl(ForumSession session)
session
- The NNTP session.Method Detail |
---|
public NewsGroup setGroup(java.lang.String name) throws NoPermissionException, NewsGroupNotFoundException
ArticlePointer
Sets the article pointer to use the given group.
The successful selection response will return 220 GROUP_SELECTED otherwise 411 ENO_SUCH_GROUP is returned. Successful responses are accompanied by the article numbers of the first and last articles in the group, and an estimate of the number of articles on file in the group. It is not necessary that the estimate be correct, although that is helpful; it must only be equal to or larger than the actual number of articles on file. (Some implementations will actually count the number of articles on file. Others will just subtract first article number from last to get an estimate.)
When a valid group is selected by means of this command, the internally maintained "current article pointer" is set to the first article in the group. If an invalid group is specified, the previously selected group and article remain selected. If an empty newsgroup is selected, the "current article pointer" is in an indeterminate state and should not be used.
Note that the name of the newsgroup is not case-dependent. It must otherwise match a newsgroup obtained from the LIST command or an error will result.
setGroup
in interface ArticlePointer
name
- The name of the group to select
NoPermissionException
- If the caller does not have permission
to get the list
NewsGroupNotFoundException
- If no group matches the given namepublic Article getArticle(int articleNumber) throws NoGroupSelectedException, ArticleNotFoundException, NoPermissionException
ArticlePointer
getArticle
in interface ArticlePointer
articleNumber
- the article number to use in selecting the article.
NoGroupSelectedException
- if no group was selected before making this call.
ArticleNotFoundException
- if no acticle for that number could be found.
NoPermissionException
- if the caller didn't have permission to retrieve the article.public Article getArticle(java.lang.String messageID) throws ArticleNotFoundException, NoPermissionException
ArticlePointer
getArticle
in interface ArticlePointer
messageID
- The Message-ID of the article to match.
ArticleNotFoundException
- If no article was found
that has a matching message ID.
NoPermissionException
- If the caller does not have
permission to retrieve the article.public Article getCurrentArticle() throws ArticleNotFoundException, NoPermissionException, ArticleNotSelectedException, NoGroupSelectedException
ArticlePointer
getCurrentArticle
in interface ArticlePointer
ArticleNotFoundException
- if the current article has been
deleted.
NoPermissionException
- if the caller does not have
permission to retrieve the article.
ArticleNotSelectedException
- if no current article has been set.
NoGroupSelectedException
- if no group has been selected.public int getCurrentArticleNumber() throws ArticleNotSelectedException
ArticlePointer
getCurrentArticleNumber
in interface ArticlePointer
ArticleNotSelectedException
- if no article has been selected.public java.util.Iterator getArticles(ArticleFilter filter) throws NoGroupSelectedException, ArticleNotSelectedException, NoPermissionException, ArticleNotFoundException
ArticlePointer
getArticles
in interface ArticlePointer
filter
- The article filter to restrict the match results
NoGroupSelectedException
- If no group is curently selected
ArticleNotSelectedException
- If the filter is for the current
article and none has been selected
NoPermissionException
- If the caller does not have permission
to get the list
ArticleNotFoundException
- If the filter is for a specific
article that could not be foundpublic NewsGroup getGroup() throws NoGroupSelectedException, NoPermissionException
ArticlePointer
Obtain the group currently assigned to the pointer on null if none has been set.
getGroup
in interface ArticlePointer
NoGroupSelectedException
- If no group has been selected
NoPermissionException
- If the caller does not have permission
to get the grouppublic Article last() throws NoGroupSelectedException, ArticleNotFoundException, ArticleNotSelectedException, NoPermissionException
ArticlePointer
Moves the article pointer to the previous article in the current group.
The internally maintained "current article pointer" is set to the previous article in the current newsgroup. If already positioned at the first article of the newsgroup, an error message is returned and the current article remains selected:
The internally-maintained "current article pointer" is set by this command.
On successful repositioning of the current article pointer a 223 STAT response indicating the current article number, and a message-id string will be returned. No text is sent in response to this command.
last
in interface ArticlePointer
NoGroupSelectedException
- if no group is curently selected.
ArticleNotFoundException
- if there is no previous article.
ArticleNotSelectedException
- if no current article has been selected.
NoPermissionException
- if the caller does not have permission
to get the list.public Article next() throws NoGroupSelectedException, ArticleNotFoundException, ArticleNotSelectedException, NoPermissionException
ArticlePointer
Moves the article pointer to the next article in the current group.
The internally maintained "current article pointer" is set to the next article in the current newsgroup. If already positioned at the last article of the newsgroup, an error message is returned and the current article remains selected:
The internally-maintained "current article pointer" is set by this command.
On successful repositioning of the current article pointer a 223 STAT response indicating the current article number, and a message-id string will be returned. No text is sent in response to this command.
next
in interface ArticlePointer
NoGroupSelectedException
- if no group is curently selected.
ArticleNotFoundException
- if there is no next article.
ArticleNotSelectedException
- if no current article has been selected.
NoPermissionException
- if the caller does not have permission
to get the list.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |