Package org.apache.commons.net.nntp
Class NNTPReply
- java.lang.Object
-
- org.apache.commons.net.nntp.NNTPReply
-
public final class NNTPReply extends java.lang.ObjectNNTPReply 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
Fields Modifier and Type Field Description static intARTICLE_LIST_BY_MESSAGE_ID_FOLLOWSNNTP reply code 230.static intARTICLE_NOT_WANTEDNNTP reply code 435.static intARTICLE_POSTED_OKNNTP reply code 240.static intARTICLE_REJECTEDNNTP reply code 437.static intARTICLE_RETRIEVED_BODY_FOLLOWSNNTP reply code 222.static intARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOWNNTP reply code 220.static intARTICLE_RETRIEVED_HEAD_FOLLOWSNNTP reply code 221.static intARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELYNNTP reply code 223.static intARTICLE_TRANSFERRED_OKNNTP reply code 235.static intAUTHENTICATION_ACCEPTEDNNTP reply code 281.static intAUTHENTICATION_REJECTEDNNTP reply code 482.static intAUTHENTICATION_REQUIREDNNTP reply code 480.static intCLOSING_CONNECTIONNNTP reply code 205.static intCOMMAND_NOT_RECOGNIZEDNNTP reply code 500.static intCOMMAND_SYNTAX_ERRORNNTP reply code 501.static intDEBUG_OUTPUTNNTP reply code 199.static intGROUP_SELECTEDNNTP reply code 211.static intHELP_TEXT_FOLLOWSNNTP reply code 100.static intMORE_AUTH_INFO_REQUIREDNNTP reply code 381.static intNEW_NEWSGROUP_LIST_FOLLOWSNNTP reply code 231.static intNO_CURRENT_ARTICLE_SELECTEDNNTP reply code 420.static intNO_NEWSGROUP_SELECTEDNNTP reply code 412.static intNO_NEXT_ARTICLENNTP reply code 421.static intNO_PREVIOUS_ARTICLENNTP reply code 422.static intNO_SUCH_ARTICLE_FOUNDNNTP reply code 430.static intNO_SUCH_ARTICLE_NUMBERNNTP reply code 423.static intNO_SUCH_NEWSGROUPNNTP reply code 411.static intPERMISSION_DENIEDNNTP reply code 502.static intPOSTING_FAILEDNNTP reply code 441.static intPOSTING_NOT_ALLOWEDNNTP reply code 440.static intPROGRAM_FAULTNNTP reply code 503.static intSEND_ARTICLE_TO_POSTNNTP reply code 340.static intSEND_ARTICLE_TO_TRANSFERNNTP reply code 335.static intSERVER_READY_POSTING_ALLOWEDNNTP reply code 200.static intSERVER_READY_POSTING_NOT_ALLOWEDNNTP reply code 201.static intSERVICE_DISCONTINUEDNNTP reply code 400.static intSLAVE_STATUS_NOTEDNNTP reply code 202.static intTRANSFER_FAILEDNNTP reply code 436.
-
Constructor Summary
Constructors Modifier Constructor Description privateNNTPReply()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisInformational(int reply)Tests if a reply code is an informational response.static booleanisNegativePermanent(int reply)Tests if a reply code is a negative permanent response.static booleanisNegativeTransient(int reply)Tests if a reply code is a negative transient response.static booleanisPositiveCompletion(int reply)Tests if a reply code is a positive completion response.static booleanisPositiveIntermediate(int reply)Tests if a reply code is a positive intermediate response.
-
-
-
Field Detail
-
HELP_TEXT_FOLLOWS
public static final int HELP_TEXT_FOLLOWS
NNTP reply code 100.- See Also:
- Constant Field Values
-
DEBUG_OUTPUT
public static final int DEBUG_OUTPUT
NNTP reply code 199.- See Also:
- Constant Field Values
-
SERVER_READY_POSTING_ALLOWED
public static final int SERVER_READY_POSTING_ALLOWED
NNTP reply code 200.- See Also:
- Constant Field Values
-
SERVER_READY_POSTING_NOT_ALLOWED
public static final int SERVER_READY_POSTING_NOT_ALLOWED
NNTP reply code 201.- See Also:
- Constant Field Values
-
SLAVE_STATUS_NOTED
public static final int SLAVE_STATUS_NOTED
NNTP reply code 202.- See Also:
- Constant Field Values
-
CLOSING_CONNECTION
public static final int CLOSING_CONNECTION
NNTP reply code 205.- See Also:
- Constant Field Values
-
GROUP_SELECTED
public static final int GROUP_SELECTED
NNTP reply code 211.- See Also:
- Constant Field Values
-
ARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW
public static final int ARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW
NNTP reply code 220.- See Also:
- Constant Field Values
-
ARTICLE_RETRIEVED_HEAD_FOLLOWS
public static final int ARTICLE_RETRIEVED_HEAD_FOLLOWS
NNTP reply code 221.- See Also:
- Constant Field Values
-
ARTICLE_RETRIEVED_BODY_FOLLOWS
public static final int ARTICLE_RETRIEVED_BODY_FOLLOWS
NNTP reply code 222.- See Also:
- Constant Field Values
-
ARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY
public static final int ARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY
NNTP reply code 223.- See Also:
- Constant Field Values
-
ARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS
public static final int ARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS
NNTP reply code 230.- See Also:
- Constant Field Values
-
NEW_NEWSGROUP_LIST_FOLLOWS
public static final int NEW_NEWSGROUP_LIST_FOLLOWS
NNTP reply code 231.- See Also:
- Constant Field Values
-
ARTICLE_TRANSFERRED_OK
public static final int ARTICLE_TRANSFERRED_OK
NNTP reply code 235.- See Also:
- Constant Field Values
-
ARTICLE_POSTED_OK
public static final int ARTICLE_POSTED_OK
NNTP reply code 240.- See Also:
- Constant Field Values
-
AUTHENTICATION_ACCEPTED
public static final int AUTHENTICATION_ACCEPTED
NNTP reply code 281.- See Also:
- Constant Field Values
-
SEND_ARTICLE_TO_TRANSFER
public static final int SEND_ARTICLE_TO_TRANSFER
NNTP reply code 335.- See Also:
- Constant Field Values
-
SEND_ARTICLE_TO_POST
public static final int SEND_ARTICLE_TO_POST
NNTP reply code 340.- See Also:
- Constant Field Values
-
MORE_AUTH_INFO_REQUIRED
public static final int MORE_AUTH_INFO_REQUIRED
NNTP reply code 381.- See Also:
- Constant Field Values
-
SERVICE_DISCONTINUED
public static final int SERVICE_DISCONTINUED
NNTP reply code 400.- See Also:
- Constant Field Values
-
NO_SUCH_NEWSGROUP
public static final int NO_SUCH_NEWSGROUP
NNTP reply code 411.- See Also:
- Constant Field Values
-
NO_NEWSGROUP_SELECTED
public static final int NO_NEWSGROUP_SELECTED
NNTP reply code 412.- See Also:
- Constant Field Values
-
NO_CURRENT_ARTICLE_SELECTED
public static final int NO_CURRENT_ARTICLE_SELECTED
NNTP reply code 420.- See Also:
- Constant Field Values
-
NO_NEXT_ARTICLE
public static final int NO_NEXT_ARTICLE
NNTP reply code 421.- See Also:
- Constant Field Values
-
NO_PREVIOUS_ARTICLE
public static final int NO_PREVIOUS_ARTICLE
NNTP reply code 422.- See Also:
- Constant Field Values
-
NO_SUCH_ARTICLE_NUMBER
public static final int NO_SUCH_ARTICLE_NUMBER
NNTP reply code 423.- See Also:
- Constant Field Values
-
NO_SUCH_ARTICLE_FOUND
public static final int NO_SUCH_ARTICLE_FOUND
NNTP reply code 430.- See Also:
- Constant Field Values
-
ARTICLE_NOT_WANTED
public static final int ARTICLE_NOT_WANTED
NNTP reply code 435.- See Also:
- Constant Field Values
-
TRANSFER_FAILED
public static final int TRANSFER_FAILED
NNTP reply code 436.- See Also:
- Constant Field Values
-
ARTICLE_REJECTED
public static final int ARTICLE_REJECTED
NNTP reply code 437.- See Also:
- Constant Field Values
-
POSTING_NOT_ALLOWED
public static final int POSTING_NOT_ALLOWED
NNTP reply code 440.- See Also:
- Constant Field Values
-
POSTING_FAILED
public static final int POSTING_FAILED
NNTP reply code 441.- See Also:
- Constant Field Values
-
AUTHENTICATION_REQUIRED
public static final int AUTHENTICATION_REQUIRED
NNTP reply code 480.- Since:
- 2.2 - corrected value to 480
- See Also:
- Constant Field Values
-
AUTHENTICATION_REJECTED
public static final int AUTHENTICATION_REJECTED
NNTP reply code 482.- See Also:
- Constant Field Values
-
COMMAND_NOT_RECOGNIZED
public static final int COMMAND_NOT_RECOGNIZED
NNTP reply code 500.- See Also:
- Constant Field Values
-
COMMAND_SYNTAX_ERROR
public static final int COMMAND_SYNTAX_ERROR
NNTP reply code 501.- See Also:
- Constant Field Values
-
PERMISSION_DENIED
public static final int PERMISSION_DENIED
NNTP reply code 502.- See Also:
- Constant Field Values
-
PROGRAM_FAULT
public static final int PROGRAM_FAULT
NNTP reply code 503.- See Also:
- Constant Field Values
-
-
Method Detail
-
isInformational
public static boolean isInformational(int reply)
Tests 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.
-
isNegativePermanent
public static boolean isNegativePermanent(int reply)
Tests 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.
-
isNegativeTransient
public static boolean isNegativeTransient(int reply)
Tests 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.
-
isPositiveCompletion
public static boolean isPositiveCompletion(int reply)
Tests 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 positive completion response, false if not.
-
isPositiveIntermediate
public static boolean isPositiveIntermediate(int reply)
Tests 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 multipart 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 positive intermediate response, false if not.
-
-