Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.nntp
Class ArticleResponder

java.lang.Object
  extended by com.jivesoftware.forum.nntp.ArticleResponder

public class ArticleResponder
extends java.lang.Object

Creates a response to a stanard article request.

Responses are one of ARTICLE, HEAD, BODY, or STAT indicated by which parts of the artice to include:

Include HeadersInclude bodyType
truetrueARTICLE
truefalseHEAD
falsetrueBODY
falsefalseSTAT


Constructor Summary
ArticleResponder(Connection conn)
          Creates a new article response (cannot be instantiated directly).
 
Method Summary
 NNTPResponse sendArticle(ArticleCommand cmd)
          Create an ARTICLE command response.
 NNTPResponse sendBody(ArticleCommand cmd)
          Create a BODY command response.
 NNTPResponse sendHead(ArticleCommand cmd)
          Create a HEAD command response.
 NNTPResponse sendStat(ArticleCommand cmd)
          Generates a STAT response using the command's article number and located article.
 NNTPResponse sendStat(long number, Article art)
          Create a STAT command response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArticleResponder

public ArticleResponder(Connection conn)

Creates a new article response (cannot be instantiated directly).

Parameters:
conn - the connection this responder will send the response
Method Detail

sendStat

public NNTPResponse sendStat(ArticleCommand cmd)
                      throws java.io.IOException
Generates a STAT response using the command's article number and located article. Convenience for calling createStat(cmd.getNumber(),cmd.getArticle()).

Parameters:
cmd - The command to use in generating a response
Throws:
java.io.IOException - if writing to the underlying connection failed

sendStat

public NNTPResponse sendStat(long number,
                             Article art)
                      throws java.io.IOException
Create a STAT command response.

Parameters:
number - the number of the article selected or -1 if no relevant number exists.
art - the article retrieved.
Throws:
java.io.IOException - if writing to the underlying connection failed.

sendBody

public NNTPResponse sendBody(ArticleCommand cmd)
                      throws java.io.IOException
Create a BODY command response.

Parameters:
cmd - The command that retrieved the article
Throws:
java.io.IOException - if writing to the underlying connection failed

sendHead

public NNTPResponse sendHead(ArticleCommand cmd)
                      throws java.io.IOException
Create a HEAD command response.

Parameters:
cmd - The command that retrieved the article
Throws:
java.io.IOException - if writing to the underlying connection failed

sendArticle

public NNTPResponse sendArticle(ArticleCommand cmd)
                         throws java.io.IOException
Create an ARTICLE command response.

Parameters:
cmd - the command that retrieved the article.
Throws:
java.io.IOException - if writing to the underlying connection failed.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.