org.apache.commons.net.nntp
Class NNTPReply

java.lang.Object
  extended by org.apache.commons.net.nntp.NNTPReply

public final class NNTPReply
extends Object

NNTPReply stores a set of constants for NNTP reply codes. To interpret the meaning of the codes, familiarity with RFC 977 is assumed. The mnemonic constant names are transcriptions from the code descriptions of RFC 977.


Field Summary
static int ARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS
           
static int ARTICLE_NOT_WANTED
           
static int ARTICLE_POSTED_OK
           
static int ARTICLE_REJECTED
           
static int ARTICLE_RETRIEVED_BODY_FOLLOWS
           
static int ARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW
           
static int ARTICLE_RETRIEVED_HEAD_FOLLOWS
           
static int ARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY
           
static int ARTICLE_TRANSFERRED_OK
           
static int AUTHENTICATION_ACCEPTED
           
static int AUTHENTICATION_REJECTED
           
static int AUTHENTICATION_REQUIRED
           
static int CLOSING_CONNECTION
           
static int COMMAND_NOT_RECOGNIZED
           
static int COMMAND_SYNTAX_ERROR
           
static int DEBUG_OUTPUT
           
static int GROUP_SELECTED
           
static int HELP_TEXT_FOLLOWS
           
static int MORE_AUTH_INFO_REQUIRED
           
static int NEW_NEWSGROUP_LIST_FOLLOWS
           
static int NO_CURRENT_ARTICLE_SELECTED
           
static int NO_NEWSGROUP_SELECTED
           
static int NO_NEXT_ARTICLE
           
static int NO_PREVIOUS_ARTICLE
           
static int NO_SUCH_ARTICLE_FOUND
           
static int NO_SUCH_ARTICLE_NUMBER
           
static int NO_SUCH_NEWSGROUP
           
static int PERMISSION_DENIED
           
static int POSTING_FAILED
           
static int POSTING_NOT_ALLOWED
           
static int PROGRAM_FAULT
           
static int SEND_ARTICLE_TO_POST
           
static int SEND_ARTICLE_TO_TRANSFER
           
static int SERVER_READY_POSTING_ALLOWED
           
static int SERVER_READY_POSTING_NOT_ALLOWED
           
static int SERVICE_DISCONTINUED
           
static int SLAVE_STATUS_NOTED
           
static int TRANSFER_FAILED
           
 
Method Summary
static boolean isInformational(int reply)
          Determine if a reply code is an informational response.
static boolean isNegativePermanent(int reply)
          Determine if a reply code is a negative permanent response.
static boolean isNegativeTransient(int reply)
          Determine if a reply code is a negative transient response.
static boolean isPositiveCompletion(int reply)
          Determine if a reply code is a positive completion response.
static boolean isPositiveIntermediate(int reply)
          Determine if a reply code is a positive intermediate response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HELP_TEXT_FOLLOWS

public static final int HELP_TEXT_FOLLOWS
See Also:
Constant Field Values

DEBUG_OUTPUT

public static final int DEBUG_OUTPUT
See Also:
Constant Field Values

SERVER_READY_POSTING_ALLOWED

public static final int SERVER_READY_POSTING_ALLOWED
See Also:
Constant Field Values

SERVER_READY_POSTING_NOT_ALLOWED

public static final int SERVER_READY_POSTING_NOT_ALLOWED
See Also:
Constant Field Values

SLAVE_STATUS_NOTED

public static final int SLAVE_STATUS_NOTED
See Also:
Constant Field Values

CLOSING_CONNECTION

public static final int CLOSING_CONNECTION
See Also:
Constant Field Values

GROUP_SELECTED

public static final int GROUP_SELECTED
See Also:
Constant Field Values

ARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW

public static final int ARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW
See Also:
Constant Field Values

ARTICLE_RETRIEVED_HEAD_FOLLOWS

public static final int ARTICLE_RETRIEVED_HEAD_FOLLOWS
See Also:
Constant Field Values

ARTICLE_RETRIEVED_BODY_FOLLOWS

public static final int ARTICLE_RETRIEVED_BODY_FOLLOWS
See Also:
Constant Field Values

ARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY

public static final int ARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY
See Also:
Constant Field Values

ARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS

public static final int ARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS
See Also:
Constant Field Values

NEW_NEWSGROUP_LIST_FOLLOWS

public static final int NEW_NEWSGROUP_LIST_FOLLOWS
See Also:
Constant Field Values

ARTICLE_TRANSFERRED_OK

public static final int ARTICLE_TRANSFERRED_OK
See Also:
Constant Field Values

ARTICLE_POSTED_OK

public static final int ARTICLE_POSTED_OK
See Also:
Constant Field Values

AUTHENTICATION_ACCEPTED

public static final int AUTHENTICATION_ACCEPTED
See Also:
Constant Field Values

SEND_ARTICLE_TO_TRANSFER

public static final int SEND_ARTICLE_TO_TRANSFER
See Also:
Constant Field Values

SEND_ARTICLE_TO_POST

public static final int SEND_ARTICLE_TO_POST
See Also:
Constant Field Values

MORE_AUTH_INFO_REQUIRED

public static final int MORE_AUTH_INFO_REQUIRED
See Also:
Constant Field Values

SERVICE_DISCONTINUED

public static final int SERVICE_DISCONTINUED
See Also:
Constant Field Values

NO_SUCH_NEWSGROUP

public static final int NO_SUCH_NEWSGROUP
See Also:
Constant Field Values

NO_NEWSGROUP_SELECTED

public static final int NO_NEWSGROUP_SELECTED
See Also:
Constant Field Values

NO_CURRENT_ARTICLE_SELECTED

public static final int NO_CURRENT_ARTICLE_SELECTED
See Also:
Constant Field Values

NO_NEXT_ARTICLE

public static final int NO_NEXT_ARTICLE
See Also:
Constant Field Values

NO_PREVIOUS_ARTICLE

public static final int NO_PREVIOUS_ARTICLE
See Also:
Constant Field Values

NO_SUCH_ARTICLE_NUMBER

public static final int NO_SUCH_ARTICLE_NUMBER
See Also:
Constant Field Values

NO_SUCH_ARTICLE_FOUND

public static final int NO_SUCH_ARTICLE_FOUND
See Also:
Constant Field Values

ARTICLE_NOT_WANTED

public static final int ARTICLE_NOT_WANTED
See Also:
Constant Field Values

TRANSFER_FAILED

public static final int TRANSFER_FAILED
See Also:
Constant Field Values

ARTICLE_REJECTED

public static final int ARTICLE_REJECTED
See Also:
Constant Field Values

POSTING_NOT_ALLOWED

public static final int POSTING_NOT_ALLOWED
See Also:
Constant Field Values

POSTING_FAILED

public static final int POSTING_FAILED
See Also:
Constant Field Values

AUTHENTICATION_REQUIRED

public static final int AUTHENTICATION_REQUIRED
Since:
2.2 - corrected value to 480
See Also:
Constant Field Values

AUTHENTICATION_REJECTED

public static final int AUTHENTICATION_REJECTED
See Also:
Constant Field Values

COMMAND_NOT_RECOGNIZED

public static final int COMMAND_NOT_RECOGNIZED
See Also:
Constant Field Values

COMMAND_SYNTAX_ERROR

public static final int COMMAND_SYNTAX_ERROR
See Also:
Constant Field Values

PERMISSION_DENIED

public static final int PERMISSION_DENIED
See Also:
Constant Field Values

PROGRAM_FAULT

public static final int PROGRAM_FAULT
See Also:
Constant Field Values
Method Detail

isInformational

public static boolean isInformational(int reply)
Determine if a reply code is an informational response. All codes beginning with a 1 are positive informational responses. Informational responses are used to provide human readable information such as help text.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is an informational response, false if not.

isPositiveCompletion

public static boolean isPositiveCompletion(int reply)
Determine if a reply code is a positive completion response. All codes beginning with a 2 are positive completion responses. The NNTP server will send a positive completion response on the final successful completion of a command.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is a postive completion response, false if not.

isPositiveIntermediate

public static boolean isPositiveIntermediate(int reply)
Determine if a reply code is a positive intermediate response. All codes beginning with a 3 are positive intermediate responses. The NNTP server will send a positive intermediate response on the successful completion of one part of a multi-part command or sequence of commands. For example, after a successful POST command, a positive intermediate response will be sent to indicate that the server is ready to receive the article to be posted.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is a postive intermediate response, false if not.

isNegativeTransient

public static boolean isNegativeTransient(int reply)
Determine if a reply code is a negative transient response. All codes beginning with a 4 are negative transient responses. The NNTP server will send a negative transient response on the failure of a correctly formatted command that could not be performed for some reason. For example, retrieving an article that does not exist will result in a negative transient response.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is a negative transient response, false if not.

isNegativePermanent

public static boolean isNegativePermanent(int reply)
Determine if a reply code is a negative permanent response. All codes beginning with a 5 are negative permanent responses. The NNTP server will send a negative permanent response when it does not implement a command, a command is incorrectly formatted, or a serious program error occurs.

Parameters:
reply - The reply code to test.
Returns:
True if a reply code is a negative permanent response, false if not.


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.