Class NNTPReply

java.lang.Object
com.oroinc.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. 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 Details

  • 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.
    • 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.