org.apache.commons.net.nntp

Class NNTPReply


public final class NNTPReply
extends java.lang.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 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
CODE_100
static int
CODE_199
static int
CODE_200
static int
CODE_201
static int
CODE_202
static int
CODE_205
static int
CODE_211
static int
CODE_215
static int
CODE_220
static int
CODE_221
static int
CODE_222
static int
CODE_223
static int
CODE_230
static int
CODE_231
static int
CODE_235
static int
CODE_240
static int
CODE_281
static int
CODE_335
static int
CODE_340
static int
CODE_381
static int
CODE_400
static int
CODE_408
static int
CODE_411
static int
CODE_412
static int
CODE_420
static int
CODE_421
static int
CODE_422
static int
CODE_423
static int
CODE_430
static int
CODE_435
static int
CODE_436
static int
CODE_437
static int
CODE_440
static int
CODE_441
static int
CODE_482
static int
CODE_500
static int
CODE_501
static int
CODE_502
static int
CODE_503
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.

Field Details

ARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS

public static final int ARTICLE_LIST_BY_MESSAGE_ID_FOLLOWS
Field Value:
230

ARTICLE_NOT_WANTED

public static final int ARTICLE_NOT_WANTED
Field Value:
435

ARTICLE_POSTED_OK

public static final int ARTICLE_POSTED_OK
Field Value:
240

ARTICLE_REJECTED

public static final int ARTICLE_REJECTED
Field Value:
437

ARTICLE_RETRIEVED_BODY_FOLLOWS

public static final int ARTICLE_RETRIEVED_BODY_FOLLOWS
Field Value:
222

ARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW

public static final int ARTICLE_RETRIEVED_HEAD_AND_BODY_FOLLOW
Field Value:
220

ARTICLE_RETRIEVED_HEAD_FOLLOWS

public static final int ARTICLE_RETRIEVED_HEAD_FOLLOWS
Field Value:
221

ARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY

public static final int ARTICLE_RETRIEVED_REQUEST_TEXT_SEPARATELY
Field Value:
223

ARTICLE_TRANSFERRED_OK

public static final int ARTICLE_TRANSFERRED_OK
Field Value:
235

AUTHENTICATION_ACCEPTED

public static final int AUTHENTICATION_ACCEPTED
Field Value:
281

AUTHENTICATION_REJECTED

public static final int AUTHENTICATION_REJECTED
Field Value:
482

AUTHENTICATION_REQUIRED

public static final int AUTHENTICATION_REQUIRED
Field Value:
408

CLOSING_CONNECTION

public static final int CLOSING_CONNECTION
Field Value:
205

CODE_100

public static final int CODE_100
Field Value:
100

CODE_199

public static final int CODE_199
Field Value:
199

CODE_200

public static final int CODE_200
Field Value:
200

CODE_201

public static final int CODE_201
Field Value:
201

CODE_202

public static final int CODE_202
Field Value:
202

CODE_205

public static final int CODE_205
Field Value:
205

CODE_211

public static final int CODE_211
Field Value:
211

CODE_215

public static final int CODE_215
Field Value:
215

CODE_220

public static final int CODE_220
Field Value:
220

CODE_221

public static final int CODE_221
Field Value:
221

CODE_222

public static final int CODE_222
Field Value:
222

CODE_223

public static final int CODE_223
Field Value:
223

CODE_230

public static final int CODE_230
Field Value:
230

CODE_231

public static final int CODE_231
Field Value:
231

CODE_235

public static final int CODE_235
Field Value:
235

CODE_240

public static final int CODE_240
Field Value:
240

CODE_281

public static final int CODE_281
Field Value:
281

CODE_335

public static final int CODE_335
Field Value:
335

CODE_340

public static final int CODE_340
Field Value:
340

CODE_381

public static final int CODE_381
Field Value:
381

CODE_400

public static final int CODE_400
Field Value:
400

CODE_408

public static final int CODE_408
Field Value:
408

CODE_411

public static final int CODE_411
Field Value:
411

CODE_412

public static final int CODE_412
Field Value:
412

CODE_420

public static final int CODE_420
Field Value:
420

CODE_421

public static final int CODE_421
Field Value:
421

CODE_422

public static final int CODE_422
Field Value:
422

CODE_423

public static final int CODE_423
Field Value:
423

CODE_430

public static final int CODE_430
Field Value:
430

CODE_435

public static final int CODE_435
Field Value:
435

CODE_436

public static final int CODE_436
Field Value:
436

CODE_437

public static final int CODE_437
Field Value:
437

CODE_440

public static final int CODE_440
Field Value:
440

CODE_441

public static final int CODE_441
Field Value:
441

CODE_482

public static final int CODE_482
Field Value:
482

CODE_500

public static final int CODE_500
Field Value:
500

CODE_501

public static final int CODE_501
Field Value:
501

CODE_502

public static final int CODE_502
Field Value:
502

CODE_503

public static final int CODE_503
Field Value:
503

COMMAND_NOT_RECOGNIZED

public static final int COMMAND_NOT_RECOGNIZED
Field Value:
500

COMMAND_SYNTAX_ERROR

public static final int COMMAND_SYNTAX_ERROR
Field Value:
501

DEBUG_OUTPUT

public static final int DEBUG_OUTPUT
Field Value:
199

GROUP_SELECTED

public static final int GROUP_SELECTED
Field Value:
211

HELP_TEXT_FOLLOWS

public static final int HELP_TEXT_FOLLOWS
Field Value:
100

MORE_AUTH_INFO_REQUIRED

public static final int MORE_AUTH_INFO_REQUIRED
Field Value:
381

NEW_NEWSGROUP_LIST_FOLLOWS

public static final int NEW_NEWSGROUP_LIST_FOLLOWS
Field Value:
231

NO_CURRENT_ARTICLE_SELECTED

public static final int NO_CURRENT_ARTICLE_SELECTED
Field Value:
420

NO_NEWSGROUP_SELECTED

public static final int NO_NEWSGROUP_SELECTED
Field Value:
412

NO_NEXT_ARTICLE

public static final int NO_NEXT_ARTICLE
Field Value:
421

NO_PREVIOUS_ARTICLE

public static final int NO_PREVIOUS_ARTICLE
Field Value:
422

NO_SUCH_ARTICLE_FOUND

public static final int NO_SUCH_ARTICLE_FOUND
Field Value:
430

NO_SUCH_ARTICLE_NUMBER

public static final int NO_SUCH_ARTICLE_NUMBER
Field Value:
423

NO_SUCH_NEWSGROUP

public static final int NO_SUCH_NEWSGROUP
Field Value:
411

PERMISSION_DENIED

public static final int PERMISSION_DENIED
Field Value:
502

POSTING_FAILED

public static final int POSTING_FAILED
Field Value:
441

POSTING_NOT_ALLOWED

public static final int POSTING_NOT_ALLOWED
Field Value:
440

PROGRAM_FAULT

public static final int PROGRAM_FAULT
Field Value:
503

SEND_ARTICLE_TO_POST

public static final int SEND_ARTICLE_TO_POST
Field Value:
340

SEND_ARTICLE_TO_TRANSFER

public static final int SEND_ARTICLE_TO_TRANSFER
Field Value:
335

SERVER_READY_POSTING_ALLOWED

public static final int SERVER_READY_POSTING_ALLOWED
Field Value:
200

SERVER_READY_POSTING_NOT_ALLOWED

public static final int SERVER_READY_POSTING_NOT_ALLOWED
Field Value:
201

SERVICE_DISCONTINUED

public static final int SERVICE_DISCONTINUED
Field Value:
400

SLAVE_STATUS_NOTED

public static final int SLAVE_STATUS_NOTED
Field Value:
202

TRANSFER_FAILED

public static final int TRANSFER_FAILED
Field Value:
436

Method Details

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.