org.apache.commons.net.nntp

Class 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. For those who think in terms of the actual reply code values, a set of CODE_NUM constants are provided where NUM is the numerical value of the code.

Author: Daniel F. Savarese

Field Summary
static intARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS
static intARTICLE_NOT_WANTED
static intARTICLE_POSTED_OK
static intARTICLE_REJECTED
static intARTICLE_RETRIEVED_BODY_FOLLOWS
static intARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW
static intARTICLE_RETRIEVED_HEAD_FOLLOWS
static intARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY
static intARTICLE_TRANSFERRED_OK
static intAUTHENTICATION_ACCEPTED
static intAUTHENTICATION_REJECTED
static intAUTHENTICATION_REQUIRED
static intCLOSING_CONNECTION
static intCODE_100
static intCODE_199
static intCODE_200
static intCODE_201
static intCODE_202
static intCODE_205
static intCODE_211
static intCODE_215
static intCODE_220
static intCODE_221
static intCODE_222
static intCODE_223
static intCODE_230
static intCODE_231
static intCODE_235
static intCODE_240
static intCODE_281
static intCODE_335
static intCODE_340
static intCODE_381
static intCODE_400
static intCODE_408
static intCODE_411
static intCODE_412
static intCODE_420
static intCODE_421
static intCODE_422
static intCODE_423
static intCODE_430
static intCODE_435
static intCODE_436
static intCODE_437
static intCODE_440
static intCODE_441
static intCODE_482
static intCODE_500
static intCODE_501
static intCODE_502
static intCODE_503
static intCOMMAND_NOT_RECOGNIZED
static intCOMMAND_SYNTAX_ERROR
static intDEBUG_OUTPUT
static intGROUP_SELECTED
static intHELP_TEXT_FOLLOWS
static intMORE_AUTH_INFO_REQUIRED
static intNEW_NEWSGROUP_LIST_FOLLOWS
static intNO_CURRENT_ARTICLE_SELECTED
static intNO_NEWSGROUP_SELECTED
static intNO_NEXT_ARTICLE
static intNO_PREVIOUS_ARTICLE
static intNO_SUCH_ARTICLE_FOUND
static intNO_SUCH_ARTICLE_NUMBER
static intNO_SUCH_NEWSGROUP
static intPERMISSION_DENIED
static intPOSTING_FAILED
static intPOSTING_NOT_ALLOWED
static intPROGRAM_FAULT
static intSEND_ARTICLE_TO_POST
static intSEND_ARTICLE_TO_TRANSFER
static intSERVER_READY_POSTING_ALLOWED
static intSERVER_READY_POSTING_NOT_ALLOWED
static intSERVICE_DISCONTINUED
static intSLAVE_STATUS_NOTED
static intTRANSFER_FAILED
Method Summary
static booleanisInformational(int reply)
Determine if a reply code is an informational response.
static booleanisNegativePermanent(int reply)
Determine if a reply code is a negative permanent response.
static booleanisNegativeTransient(int reply)
Determine if a reply code is a negative transient response.
static booleanisPositiveCompletion(int reply)
Determine if a reply code is a positive completion response.
static booleanisPositiveIntermediate(int reply)
Determine if a reply code is a positive intermediate response.

Field Detail

ARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS

public static final int ARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS

ARTICLE_NOT_WANTED

public static final int ARTICLE_NOT_WANTED

ARTICLE_POSTED_OK

public static final int ARTICLE_POSTED_OK

ARTICLE_REJECTED

public static final int ARTICLE_REJECTED

ARTICLE_RETRIEVED_BODY_FOLLOWS

public static final int ARTICLE_RETRIEVED_BODY_FOLLOWS

ARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW

public static final int ARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW

ARTICLE_RETRIEVED_HEAD_FOLLOWS

public static final int ARTICLE_RETRIEVED_HEAD_FOLLOWS

ARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY

public static final int ARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY

ARTICLE_TRANSFERRED_OK

public static final int ARTICLE_TRANSFERRED_OK

AUTHENTICATION_ACCEPTED

public static final int AUTHENTICATION_ACCEPTED

AUTHENTICATION_REJECTED

public static final int AUTHENTICATION_REJECTED

AUTHENTICATION_REQUIRED

public static final int AUTHENTICATION_REQUIRED

CLOSING_CONNECTION

public static final int CLOSING_CONNECTION

CODE_100

public static final int CODE_100

CODE_199

public static final int CODE_199

CODE_200

public static final int CODE_200

CODE_201

public static final int CODE_201

CODE_202

public static final int CODE_202

CODE_205

public static final int CODE_205

CODE_211

public static final int CODE_211

CODE_215

public static final int CODE_215

CODE_220

public static final int CODE_220

CODE_221

public static final int CODE_221

CODE_222

public static final int CODE_222

CODE_223

public static final int CODE_223

CODE_230

public static final int CODE_230

CODE_231

public static final int CODE_231

CODE_235

public static final int CODE_235

CODE_240

public static final int CODE_240

CODE_281

public static final int CODE_281

CODE_335

public static final int CODE_335

CODE_340

public static final int CODE_340

CODE_381

public static final int CODE_381

CODE_400

public static final int CODE_400

CODE_408

public static final int CODE_408

CODE_411

public static final int CODE_411

CODE_412

public static final int CODE_412

CODE_420

public static final int CODE_420

CODE_421

public static final int CODE_421

CODE_422

public static final int CODE_422

CODE_423

public static final int CODE_423

CODE_430

public static final int CODE_430

CODE_435

public static final int CODE_435

CODE_436

public static final int CODE_436

CODE_437

public static final int CODE_437

CODE_440

public static final int CODE_440

CODE_441

public static final int CODE_441

CODE_482

public static final int CODE_482

CODE_500

public static final int CODE_500

CODE_501

public static final int CODE_501

CODE_502

public static final int CODE_502

CODE_503

public static final int CODE_503

COMMAND_NOT_RECOGNIZED

public static final int COMMAND_NOT_RECOGNIZED

COMMAND_SYNTAX_ERROR

public static final int COMMAND_SYNTAX_ERROR

DEBUG_OUTPUT

public static final int DEBUG_OUTPUT

GROUP_SELECTED

public static final int GROUP_SELECTED

HELP_TEXT_FOLLOWS

public static final int HELP_TEXT_FOLLOWS

MORE_AUTH_INFO_REQUIRED

public static final int MORE_AUTH_INFO_REQUIRED

NEW_NEWSGROUP_LIST_FOLLOWS

public static final int NEW_NEWSGROUP_LIST_FOLLOWS

NO_CURRENT_ARTICLE_SELECTED

public static final int NO_CURRENT_ARTICLE_SELECTED

NO_NEWSGROUP_SELECTED

public static final int NO_NEWSGROUP_SELECTED

NO_NEXT_ARTICLE

public static final int NO_NEXT_ARTICLE

NO_PREVIOUS_ARTICLE

public static final int NO_PREVIOUS_ARTICLE

NO_SUCH_ARTICLE_FOUND

public static final int NO_SUCH_ARTICLE_FOUND

NO_SUCH_ARTICLE_NUMBER

public static final int NO_SUCH_ARTICLE_NUMBER

NO_SUCH_NEWSGROUP

public static final int NO_SUCH_NEWSGROUP

PERMISSION_DENIED

public static final int PERMISSION_DENIED

POSTING_FAILED

public static final int POSTING_FAILED

POSTING_NOT_ALLOWED

public static final int POSTING_NOT_ALLOWED

PROGRAM_FAULT

public static final int PROGRAM_FAULT

SEND_ARTICLE_TO_POST

public static final int SEND_ARTICLE_TO_POST

SEND_ARTICLE_TO_TRANSFER

public static final int SEND_ARTICLE_TO_TRANSFER

SERVER_READY_POSTING_ALLOWED

public static final int SERVER_READY_POSTING_ALLOWED

SERVER_READY_POSTING_NOT_ALLOWED

public static final int SERVER_READY_POSTING_NOT_ALLOWED

SERVICE_DISCONTINUED

public static final int SERVICE_DISCONTINUED

SLAVE_STATUS_NOTED

public static final int SLAVE_STATUS_NOTED

TRANSFER_FAILED

public static final int TRANSFER_FAILED

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.

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.

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.

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.